Subject: Re: [PATCH] qed: fix kzalloc-simple.cocci warnings

From: Joe Perches <[email-masked]>
Date: Fri, 02 Sep 2016 10:44:21 -0700

On Thu, 2016-09-01 at 07:37 +0000, Yuval Mintz wrote:
> > drivers/net/ethernet/qlogic/qed/qed_dcbx.c:1230:13-20: WARNING: kzalloc
> > should be used for dcbx_info, instead of kmalloc/memset
> > drivers/net/ethernet/qlogic/qed/qed_dcbx.c:1192:13-20: WARNING: kzalloc
> > should be used for dcbx_info, instead of kmalloc/memset
> > 
> >  Use kzalloc rather than kmalloc followed by memset with 0
[]
> One question the automated script -
> Can't it [relative] easily be upgraded to also have 'Fixes:' as part
> of its message?

It's really not a "fix" as it has no real effect on behavior.

The code is perfectly fine as is really.

It is a code size reduction though.

Another thing with a behavior change and one that would also
reduce code size would be to remove the unnecessary OOM
messages after the allocs.

I'll send a patch for that.