drivers: input: mouse: Remove useless casting in cypress_ps2.c
Subsystems (2)
PATCH 1/1 drivers: input: mouse: Remove useless casting in cypress_ps2.c
Casting (void *) value returned by kzalloc is useless as mentioned in Documentation/CodingStyle, Chap 14.
--- drivers/input/mouse/cypress_ps2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/mouse/cypress_ps2.c +1 -1
@@ -679,7 +679,7 @@ int cypress_init(struct psmouse *psmouse) {struct cytp_data *cytp; - cytp = (struct cytp_data *)kzalloc (sizeof (struct cytp_data ),GFP_KERNEL ); + cytp =kzalloc (sizeof (struct cytp_data ),GFP_KERNEL ); psmouse->private = (void *)cytp;if (cytp ==NULL )return -ENOMEM ;
Signature · 1 line
1.8.4
Dmitry Torokhov
maintainerHi Geyslan,
Quoted 13 lines · Geyslan G. Bem
Casting (void *) value returned by kzalloc is useless as mentioned in
Documentation/CodingStyle, Chap 14.Signed-off-by Geyslan G. Bem <[email protected]>--- drivers/input/mouse/cypress_ps2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/input/mouse/cypress_ps2.c +0
-0
drivers/input/mouse/cypress_ps2.c int cypress_init(struct psmouse *psmouse) · line 682
Quoted 5 lines
drivers/input/mouse/cypress_ps2.c +1
-1@@ -679,7 +679,7 @@ int cypress_init(struct psmouse *psmouse) {struct cytp_data *cytp; - cytp = (struct cytp_data *)kzalloc (sizeof (struct cytp_data ),GFP_KERNEL ); + cytp =kzalloc (sizeof (struct cytp_data ),GFP_KERNEL );
I already have a patch for this from Jingoo Han in my queue.
drivers/input/mouse/cypress_ps2.c int cypress_init(struct psmouse *psmouse) · line 683
Quoted 1 line
drivers/input/mouse/cypress_ps2.c +0
-0psmouse->private = (void *)cytp;
But this cast is also not needed, so if you could send me a patch for it I'd appreciate that.
Quoted 5 lines
drivers/input/mouse/cypress_ps2.c +0
-0if (cytp ==NULL )return -ENOMEM ;Signature · 1 line
1.8.4
Thanks.
Signature · 1 line
Dmitry
2013/10/16 Dmitry Torokhov <[email protected]>:
Quoted 19 lines
Hi Geyslan,
Quoted 16 lines · Geyslan G. Bem
Casting (void *) value returned by kzalloc is useless as mentioned in
Documentation/CodingStyle, Chap 14.Signed-off-by Geyslan G. Bem <[email protected]>--- drivers/input/mouse/cypress_ps2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/input/mouse/cypress_ps2.c +0
-0@@ -679,7 +679,7 @@ int cypress_init(struct psmouse *psmouse) {struct cytp_data *cytp;
Quoted 4 lines
drivers/input/mouse/cypress_ps2.c int cypress_init(struct psmouse *psmouse) · line 682
Quoted 2 lines
drivers/input/mouse/cypress_ps2.c +1
-1- cytp = (struct cytp_data *)kzalloc (sizeof (struct cytp_data ),GFP_KERNEL ); + cytp =kzalloc (sizeof (struct cytp_data ),GFP_KERNEL );I already have a patch for this from Jingoo Han in my queue.
No problem.
Quoted 5 lines
drivers/input/mouse/cypress_ps2.c int cypress_init(struct psmouse *psmouse) · line 683
Quoted 2 lines
drivers/input/mouse/cypress_ps2.c +0
-0psmouse->private = (void *)cytp;But this cast is also not needed, so if you could send me a patch for it I'd appreciate that.
Sure, I can.
Quoted 11 lines
Quoted 6 lines
drivers/input/mouse/cypress_ps2.c +0
-1if (cytp ==NULL )return -ENOMEM ; --1.8.4
Thanks.
--
Dmitry