netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: Yuval Mintz <Yuval.Mintz@qlogic.com>
Cc: kbuild-all@01.org, netdev@vger.kernel.org,
	Ariel.Elior@qlogic.com, Yuval.Mintz@qlogic.com
Subject: [PATCH] qed: fix kzalloc-simple.cocci warnings
Date: Wed, 30 Sep 2015 21:33:28 +0800	[thread overview]
Message-ID: <20150930133328.GA193013@lkp-ib03> (raw)
In-Reply-To: <1443618217-18069-2-git-send-email-Yuval.Mintz@qlogic.com>

drivers/net/ethernet/qlogic/qed/qed_int.c:644:30-37: WARNING: kzalloc should be used for p_hwfn -> hw_info . p_igu_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: Yuval Mintz <Yuval.Mintz@qlogic.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---

 qed_int.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

--- a/drivers/net/ethernet/qlogic/qed/qed_int.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_int.c
@@ -641,13 +641,11 @@ int qed_int_igu_read_cam(struct qed_hwfn
 	u16			sb_id;
 	u16			prev_sb_id = 0xFF;
 
-	p_hwfn->hw_info.p_igu_info = kmalloc(sizeof(*p_igu_info), GFP_ATOMIC);
+	p_hwfn->hw_info.p_igu_info = kzalloc(sizeof(*p_igu_info), GFP_ATOMIC);
 
 	if (!p_hwfn->hw_info.p_igu_info)
 		return -ENOMEM;
 
-	memset(p_hwfn->hw_info.p_igu_info, 0, sizeof(*p_igu_info));
-
 	p_igu_info = p_hwfn->hw_info.p_igu_info;
 
 	/* Initialize base sb / sb cnt for PFs */

  parent reply	other threads:[~2015-09-30 13:34 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-30 13:03 [RFC v3 net-next 00/10] Add new drivers: qed & qede Yuval Mintz
2015-09-30 13:03 ` [RFC v3 net-next 01/10] qed: Add module with basic common support Yuval Mintz
2015-09-30 13:33   ` [PATCH] qed: fix simple_return.cocci warnings kbuild test robot
2015-09-30 13:33   ` kbuild test robot [this message]
2015-09-30 13:50   ` [RFC v3 net-next 01/10] qed: Add module with basic common support kbuild test robot
2015-09-30 13:54   ` kbuild test robot
2015-09-30 13:03 ` [RFC v3 net-next 02/10] qed: Add basic L2 interface Yuval Mintz
2015-09-30 13:03 ` [RFC v3 net-next 03/10] qede: Add basic Network driver Yuval Mintz
2015-09-30 13:03 ` [RFC v3 net-next 04/10] qed: Add slowpath L2 support Yuval Mintz
2015-09-30 13:40   ` kbuild test robot
2015-09-30 13:59   ` kbuild test robot
2015-09-30 13:03 ` [RFC v3 net-next 05/10] qede: Add basic network device support Yuval Mintz
2015-09-30 13:48   ` [PATCH] qede: fix simple_return.cocci warnings kbuild test robot
2015-09-30 13:48   ` [RFC v3 net-next 05/10] qede: Add basic network device support kbuild test robot
2015-09-30 13:03 ` [RFC v3 net-next 06/10] qede: classification configuration Yuval Mintz
2015-09-30 13:03 ` [RFC v3 net-next 07/10] qed: Add link support Yuval Mintz
2015-09-30 14:08   ` kbuild test robot
2015-09-30 13:03 ` [RFC v3 net-next 08/10] qede: Add support for link Yuval Mintz
2015-09-30 13:03 ` [RFC v3 net-next 09/10] qed: Add statistics support Yuval Mintz
2015-09-30 14:18   ` kbuild test robot
2015-09-30 14:23   ` kbuild test robot
2015-09-30 13:03 ` [RFC v3 net-next 10/10] qede: Add basic ethtool support Yuval Mintz
  -- strict thread matches above, loose matches on Subject: below --
2016-09-01  6:45 [net:master 27/28] drivers/net/ethernet/qlogic/qed/qed_dcbx.c:1230:13-20: WARNING: kzalloc should be used for dcbx_info, instead of kmalloc/memset kbuild test robot
2016-09-01  6:45 ` [PATCH] qed: fix kzalloc-simple.cocci warnings kbuild test robot
2016-09-01  7:37   ` Yuval Mintz
2016-09-01 16:48     ` David Miller
2016-09-02 17:44     ` Joe Perches
2017-04-21  0:20 [net:master 15/18] drivers/net/ethernet/qlogic/qed/qed_dcbx.c:1267:13-20: WARNING: kzalloc should be used for dcbx_info, instead of kmalloc/memset kbuild test robot
2017-04-21  0:20 ` [PATCH] qed: fix kzalloc-simple.cocci warnings kbuild test robot
2017-04-24 16:03   ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150930133328.GA193013@lkp-ib03 \
    --to=lkp@intel.com \
    --cc=Ariel.Elior@qlogic.com \
    --cc=Yuval.Mintz@qlogic.com \
    --cc=kbuild-all@01.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).