Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1605364

[PATCH staging/speakup v3 2/3] remove unnecessary initial allocation of vc

From "Pranay Kr. Srivastava" <pranjas@gmail.com>
Newsgroups linux.kernel
Subject [PATCH staging/speakup v3 2/3] remove unnecessary initial allocation of vc
Date 2017-03-21 08:40 +0100
Message-ID <tnmyB-8M-1@gated-at.bofh.it> (permalink)
References <tg7l0-8hz-23@gated-at.bofh.it> <tnmff-8tT-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


This patch removes the unnecessary allocation of
current foreground vc during initialization.

This initialization is already handled in the loop
that follows it for all available virtual consoles.

Signed-off-by: Pranay Kr. Srivastava <pranjas@gmail.com>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 drivers/staging/speakup/main.c | 11 -----------
 1 file changed, 11 deletions(-)

diff --git a/drivers/staging/speakup/main.c b/drivers/staging/speakup/main.c
index a1d5b66..ca817ca 100644
--- a/drivers/staging/speakup/main.c
+++ b/drivers/staging/speakup/main.c
@@ -2317,7 +2317,6 @@ static int __init speakup_init(void)
 {
 	int i;
 	long err = 0;
-	struct st_spk_t *first_console;
 	struct vc_data *vc = vc_cons[fg_console].d;
 	struct var_t *var;
 
@@ -2342,15 +2341,6 @@ static int __init speakup_init(void)
 	if (err)
 		goto error_virtkeyboard;
 
-	first_console = kzalloc(sizeof(*first_console), GFP_KERNEL);
-	if (!first_console) {
-		err = -ENOMEM;
-		goto error_alloc;
-	}
-
-	speakup_console[vc->vc_num] = first_console;
-	speakup_date(vc);
-
 	for (i = 0; i < MAX_NR_CONSOLES; i++)
 		if (vc_cons[i].d) {
 			err = speakup_allocate(vc_cons[i].d);
@@ -2412,7 +2402,6 @@ static int __init speakup_init(void)
 	for (i = 0; i < MAX_NR_CONSOLES; i++)
 		kfree(speakup_console[i]);
 
-error_alloc:
 	speakup_remove_virtual_keyboard();
 
 error_virtkeyboard:
-- 
2.10.2

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH staging/speakup v3 0/3] cleanup error and initilization "Pranay Kr. Srivastava" <pranjas@gmail.com> - 2017-03-21 08:20 +0100
  [PATCH staging/speakup v3 1/3] return same error value from spk_set_key_info "Pranay Kr. Srivastava" <pranjas@gmail.com> - 2017-03-21 08:20 +0100
  [PATCH staging/speakup v3 2/3] remove unnecessary initial allocation of vc "Pranay Kr. Srivastava" <pranjas@gmail.com> - 2017-03-21 08:40 +0100

csiph-web