Skip to contentSkip to conversation

drivers: input: mouse: Remove useless casting in cypress_ps2.c

PATCH Applied Geyslan G. Bem 3 participants 4 messages Oct 16, 2013 – Oct 17, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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
index f51765f..b87d7ba 100644
@@ -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
#1 lore raw
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.

#2 lore raw

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 -1
      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.

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.

maintainer Applied
#3 lore raw
In reply to Geyslan G. Bem
Quoted 3 lines · Geyslan G. Bem

Get rid of unnecessary (void *) casting in 'cypress_init' function.

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
index f51765f..b87d7ba 100644
@@ -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