Re: [PATCH 1/3] sh/intc: Use kcalloc() in register_intc_controller()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Markus,

On Fri, Jan 13, 2017 at 10:48 AM, SF Markus Elfring
<elfring@xxxxxxxxxxxxxxxxxxxxx> 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@xxxxxxxxxxxxxx

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
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux