Message ID | 1381939512-28534-1-git-send-email-geyslan@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Hi Geyslan, On Wed, Oct 16, 2013 at 01:05:12PM -0300, Geyslan G. Bem wrote: > Casting (void *) value returned by kzalloc is useless > as mentioned in Documentation/CodingStyle, Chap 14. > > Signed-off-by: Geyslan G. Bem <geyslan@gmail.com> > --- > drivers/input/mouse/cypress_ps2.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/input/mouse/cypress_ps2.c b/drivers/input/mouse/cypress_ps2.c > index f51765f..ef651cc 100644 > --- a/drivers/input/mouse/cypress_ps2.c > +++ b/drivers/input/mouse/cypress_ps2.c > @@ -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. > 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. > if (cytp == NULL) > return -ENOMEM; > -- > 1.8.4 > Thanks.
2013/10/16 Dmitry Torokhov <dmitry.torokhov@gmail.com>: > Hi Geyslan, > > On Wed, Oct 16, 2013 at 01:05:12PM -0300, Geyslan G. Bem wrote: >> Casting (void *) value returned by kzalloc is useless >> as mentioned in Documentation/CodingStyle, Chap 14. >> >> Signed-off-by: Geyslan G. Bem <geyslan@gmail.com> >> --- >> drivers/input/mouse/cypress_ps2.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/input/mouse/cypress_ps2.c b/drivers/input/mouse/cypress_ps2.c >> index f51765f..ef651cc 100644 >> --- a/drivers/input/mouse/cypress_ps2.c >> +++ b/drivers/input/mouse/cypress_ps2.c >> @@ -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. No problem. > >> 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. Sure, I can. > >> if (cytp == NULL) >> return -ENOMEM; >> -- >> 1.8.4 >> > > Thanks. > > -- > Dmitry -- To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/input/mouse/cypress_ps2.c b/drivers/input/mouse/cypress_ps2.c index f51765f..ef651cc 100644 --- a/drivers/input/mouse/cypress_ps2.c +++ b/drivers/input/mouse/cypress_ps2.c @@ -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;
Casting (void *) value returned by kzalloc is useless as mentioned in Documentation/CodingStyle, Chap 14. Signed-off-by: Geyslan G. Bem <geyslan@gmail.com> --- drivers/input/mouse/cypress_ps2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)