Thread (4 messages) 4 messages, 3 authors, 2013-10-17

Re: [PATCH v2] drivers: input: mouse: Remove useless casting in cypress_ps2.c

From: Geyslan Gregório Bem <hidden>
Date: 2013-10-16 22:53:45
Also in: lkml

2013/10/16 Joe Perches [off-list ref]:
On Wed, 2013-10-16 at 19:31 -0300, Geyslan G. Bem wrote:
quoted
Get rid of unnecessary (void *) casting in 'cypress_init' function.
[]
quoted
diff --git a/drivers/input/mouse/cypress_ps2.c b/drivers/input/mouse/cypress_ps2.c
[]
quoted
@@ -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.
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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help