drivers: input: mouse: Remove useless casting in cypress_ps2.c
Subsystems (2)
PATCH v2 1/1 drivers: input: mouse: Remove useless casting in cypress_ps2.c
Get rid of unnecessary (void *) casting in 'cypress_init' function.
--- drivers/input/mouse/cypress_ps2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/mouse/cypress_ps2.c +1 -1
@@ -680,7 +680,7 @@ int cypress_init(struct psmouse *psmouse)struct cytp_data *cytp; cytp = (struct cytp_data *)kzalloc (sizeof (struct cytp_data ),GFP_KERNEL ); - psmouse->private = (void *)cytp; + psmouse->private = cytp;if (cytp ==NULL )return -ENOMEM ;
Signature · 1 line
1.8.4
Quoted 1 line · Geyslan G. Bem
Get rid of unnecessary (void *) casting in '
cypress_init' function.
[]
drivers/input/mouse/cypress_ps2.c
Quoted 1 line
drivers/input/mouse/cypress_ps2.c +0
-0
[]
drivers/input/mouse/cypress_ps2.c int cypress_init(struct psmouse *psmouse) · line 683
Quoted 6 lines
drivers/input/mouse/cypress_ps2.c +1
-1@@ -680,7 +680,7 @@ int cypress_init(struct psmouse *psmouse)struct cytp_data *cytp; cytp = (struct cytp_data *)kzalloc (sizeof (struct cytp_data ),GFP_KERNEL ); - psmouse->private = (void *)cytp; + psmouse->private = cytp;
If you are going to remove useless casts, please
also remove the unnecessary kzalloc cast too.
2013/10/16 Joe Perches <[email protected]>:
Quoted 8 lines · Geyslan G. Bem
Quoted 1 line
Get rid of unnecessary (void *) casting in '
cypress_init' function.[]
drivers/input/mouse/cypress_ps2.c
Quoted 1 line
drivers/input/mouse/cypress_ps2.c +0
-0[]
Quoted 3 lines
drivers/input/mouse/cypress_ps2.c +0
-0@@ -680,7 +680,7 @@ int cypress_init(struct psmouse *psmouse)struct cytp_data *cytp;
Quoted 8 lines
drivers/input/mouse/cypress_ps2.c int cypress_init(struct psmouse *psmouse) · line 683
Quoted 3 lines
drivers/input/mouse/cypress_ps2.c +1
-1cytp = (struct cytp_data *)kzalloc (sizeof (struct cytp_data ),GFP_KERNEL ); - psmouse->private = (void *)cytp; + psmouse->private = cytp;If you are going to remove useless casts, please
also remove the unnecessary kzalloc cast too.
Joe, thanks for reply. Actually I did it and receive this reply from Dmitry:
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.
psmouse->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 3 lines · Geyslan G. Bem
Get rid of unnecessary (void *) casting in '
cypress_init' function.Signed-off-by Geyslan G. Bem <[email protected]>
Applied, thank you.
Quoted 20 lines
--- drivers/input/mouse/cypress_ps2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/input/mouse/cypress_ps2.c +1
-1@@ -680,7 +680,7 @@ int cypress_init(struct psmouse *psmouse)struct cytp_data *cytp; cytp = (struct cytp_data *)kzalloc (sizeof (struct cytp_data ),GFP_KERNEL ); - psmouse->private = (void *)cytp; + psmouse->private = cytp;if (cytp ==NULL )return -ENOMEM ;Signature · 1 line
1.8.4
Signature · 1 line
Dmitry