Re: [PATCH 1/5] IB/qib: Use kcalloc() in qib_init_iba7322_funcs()

From: Yuval Shaia
Date: Wed Apr 05 2017 - 11:19:45 EST


On Wed, Apr 05, 2017 at 05:06:58PM +0200, Johannes Thumshirn wrote:
> On Wed, Apr 05, 2017 at 04:54:40PM +0200, SF Markus Elfring wrote:
> > >> @@ -7324,8 +7324,9 @@ struct qib_devdata *qib_init_iba7322_funcs(struct pci_dev *pdev,
> > >> actual_cnt -= dd->num_pports;
> > >>
> > >> tabsize = actual_cnt;
> > >> - dd->cspec->msix_entries = kzalloc(tabsize *
> > >> - sizeof(struct qib_msix_entry), GFP_KERNEL);
> > >> + dd->cspec->msix_entries = kcalloc(tabsize,
> > >> + sizeof(*dd->cspec->msix_entries),
> > >> + GFP_KERNEL);
> > >
> > > Are we fine with loosing the zeroing of the entries?
> >
> > How did you get this concern?
> >
> > Do you really miss such functionality from the other interface?
>
> Ahm... Don't kzalloc() and kcalloc() both pass in __GFP_ZERO?

Yes.
Please ignore my comment.

>
> --
> Johannes Thumshirn Storage
> jthumshirn@xxxxxxx +49 911 74053 689
> SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
> GF: Felix Imendörffer, Jane Smithard, Graham Norton
> HRB 21284 (AG Nürnberg)
> Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850