qed: fix kzalloc-simple.cocci warnings
authorWu Fengguang <fengguang.wu@intel.com>
Thu, 1 Sep 2016 06:45:12 +0000 (14:45 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 1 Sep 2016 16:47:36 +0000 (09:47 -0700)
commit561ed23331dfefea4c8eec616463ee4d0c8fa4b7
tree06cb2a1534fbfced512d3f3211a58e7cba3f0add
parentcb849e3041e4238d2593b2a565a24757736b79fc
qed: fix kzalloc-simple.cocci warnings

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

 This considers some simple cases that are common and easy to validate
 Note in particular that there are no ...s in the rule, so all of the
 matched code has to be contiguous

Generated by: scripts/coccinelle/api/alloc/kzalloc-simple.cocci

CC: Sudarsana Reddy Kalluru <sudarsana.kalluru@qlogic.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Acked-by: Yuval Mintz <Yuval.Mintz@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/qlogic/qed/qed_dcbx.c