lkml.org 
[lkml]   [2017]   [Jan]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 1/3] sh/intc: Use kcalloc() in register_intc_controller()
Hi Markus,

On Fri, Jan 13, 2017 at 10:48 AM, SF Markus Elfring
<elfring@users.sourceforge.net> wrote:
> --- a/drivers/sh/intc/core.c
> +++ b/drivers/sh/intc/core.c

> @@ -253,7 +253,8 @@ int __init register_intc_controller(struct intc_desc *desc)
> }
>
> if (hw->prio_regs) {
> - d->prio = kzalloc(hw->nr_vectors * sizeof(*d->prio),
> + d->prio = kcalloc(hw->nr_vectors,
> + sizeof(*d->prio),

Please don't split lines without a good reason.

> GFP_NOWAIT);

In this particular case, I'd even use the opportunity to merge the above line
with the previous one instead, now it fits in 80 characters ;-)

> if (!d->prio)
> goto err4;
> @@ -269,7 +270,8 @@ int __init register_intc_controller(struct intc_desc *desc)
> }
>
> if (hw->sense_regs) {
> - d->sense = kzalloc(hw->nr_vectors * sizeof(*d->sense),
> + d->sense = kcalloc(hw->nr_vectors,
> + sizeof(*d->sense),

Likewise

> GFP_NOWAIT);
> if (!d->sense)

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

\
 
 \ /
  Last update: 2017-01-13 11:25    [W:0.048 / U:0.112 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site