Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1475373

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

From Joe Perches <joe@perches.com>
Newsgroups linux.kernel
Subject Re: [PATCH] qed: fix kzalloc-simple.cocci warnings
Date 2016-09-02 19:50 +0200
Message-ID <sd0Lf-2s9-1@gated-at.bofh.it> (permalink)
References <sctZ0-5lz-15@gated-at.bofh.it> <sctZ0-5lz-13@gated-at.bofh.it> <scv4K-6oI-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] qed: fix kzalloc-simple.cocci warnings kbuild test robot <fengguang.wu@intel.com> - 2016-09-01 08:50 +0200
  RE: [PATCH] qed: fix kzalloc-simple.cocci warnings Yuval Mintz <Yuval.Mintz@qlogic.com> - 2016-09-01 10:00 +0200
    Re: [PATCH] qed: fix kzalloc-simple.cocci warnings David Miller <davem@davemloft.net> - 2016-09-01 18:50 +0200
    Re: [PATCH] qed: fix kzalloc-simple.cocci warnings Joe Perches <joe@perches.com> - 2016-09-02 19:50 +0200
      [PATCH] qed: Remove OOM messages Joe Perches <joe@perches.com> - 2016-09-02 19:50 +0200
        RE: [PATCH] qed: Remove OOM messages Yuval Mintz <Yuval.Mintz@qlogic.com> - 2016-09-04 10:40 +0200
        Re: [PATCH] qed: Remove OOM messages David Miller <davem@davemloft.net> - 2016-09-04 22:40 +0200
          Re: [PATCH] qed: Remove OOM messages Joe Perches <joe@perches.com> - 2016-09-04 23:30 +0200

csiph-web