netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: Alexander Loktionov <Alexander.Loktionov@aquantia.com>
Cc: kbuild-all@01.org, netdev@vger.kernel.org,
	David VomLehn <vomlehn@texas.net>,
	"David S . Miller" <davem@davemloft.net>,
	Simon Edelhaus <Simon.Edelhaus@aquantia.com>,
	Alexander Loktionov <Alexander.Loktionov@aquantia.com>,
	Dmitrii Tarakanov <Dmitrii.Tarakanov@aquantia.com>,
	Pavel Belous <Pavel.Belous@aquantia.com>,
	Dmitry Bezrukov <Dmitry.Bezrukov@aquantia.com>
Subject: [PATCH] net: ethernet: aquantia: fix alloc_cast.cocci warnings
Date: Thu, 19 Jan 2017 17:09:31 +0800	[thread overview]
Message-ID: <20170119090931.GA28354@lkp-ne04.lkp.intel.com> (raw)
In-Reply-To: <bfce3d39db5d3cf8cac5e1cf355ffe13c2a08b4c.1484788010.git.vomlehn@texas.net>

drivers/net/ethernet/aquantia/atlantic/aq_ring.c:24:20-41: WARNING: casting value returned by memory allocation function to (struct aq_ring_buff_s *) is useless.

 Remove casting the values returned by memory allocation functions
 like kmalloc, kzalloc, kmem_cache_alloc, kmem_cache_zalloc etc.

Semantic patch information:
 This makes an effort to find cases of casting of values returned by
 kmalloc, kzalloc, kcalloc, kmem_cache_alloc, kmem_cache_zalloc,
 kmem_cache_alloc_node, kmalloc_node and kzalloc_node and removes
 the casting as it is not required. The result in the patch case may
need some reformatting.

Generated by: scripts/coccinelle/api/alloc/alloc_cast.cocci

CC: David VomLehn <vomlehn@texas.net>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---

 aq_ring.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/net/ethernet/aquantia/atlantic/aq_ring.c
+++ b/drivers/net/ethernet/aquantia/atlantic/aq_ring.c
@@ -21,7 +21,7 @@ static struct aq_ring_s *aq_ring_alloc(s
 {
 	int err = 0;
 
-	self->buff_ring = (struct aq_ring_buff_s *)
+	self->buff_ring =
 		kzalloc(sizeof(struct aq_ring_buff_s) * self->size, GFP_KERNEL);
 
 	if (!self->buff_ring) {

  reply	other threads:[~2017-01-19  9:12 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-19  1:07 [PATCH v6 00/13] net: ethernet: aquantia: Add AQtion 2.5/5 GB NIC driver Alexander Loktionov
2017-01-19  1:07 ` [PATCH v6 01/13] net: ethernet: aquantia: Make and configuration files Alexander Loktionov
2017-01-19  1:07 ` [PATCH v6 02/13] net: ethernet: aquantia: Common functions and definitions Alexander Loktionov
2017-01-19  1:07 ` [PATCH v6 03/13] net: ethernet: aquantia: Add ring support code Alexander Loktionov
2017-01-19  1:07 ` [PATCH v6 04/13] net: ethernet: aquantia: Low-level hardware interfaces Alexander Loktionov
2017-01-19  1:07 ` [PATCH v6 05/13] net: ethernet: aquantia: Support for NIC-specific code Alexander Loktionov
2017-01-19  1:07 ` [PATCH v6 06/13] net: ethernet: aquantia: Atlantic A0 and B0 specific functions Alexander Loktionov
2017-01-19  1:07 ` [PATCH v6 07/13] net: ethernet: aquantia: Vector operations Alexander Loktionov
2017-01-19  1:07 ` [PATCH v6 08/13] net: ethernet: aquantia: PCI operations Alexander Loktionov
2017-01-19  1:08 ` [PATCH v6 09/13] net: ethernet: aquantia: Atlantic hardware abstraction layer Alexander Loktionov
2017-01-19  1:08 ` [PATCH v6 10/13] net: ethernet: aquantia: Hardware interface and utility functions Alexander Loktionov
2017-01-19  1:08 ` [PATCH v6 11/13] net: ethernet: aquantia: Ethtool support Alexander Loktionov
2017-01-19  1:08 ` [PATCH v6 12/13] net: ethernet: aquantia: Receive side scaling Alexander Loktionov
2017-01-19  1:08 ` [PATCH v6 13/13] net: ethernet: aquantia: Integrate AQtion 2.5/5 GB NIC driver Alexander Loktionov
2017-01-19  9:09   ` kbuild test robot [this message]
2017-01-20  8:19     ` [PATCH] net: ethernet: aquantia: fix alloc_cast.cocci warnings Joe Perches
2017-01-19  9:09   ` [PATCH v6 13/13] net: ethernet: aquantia: Integrate AQtion 2.5/5 GB NIC driver kbuild test robot
2017-01-20 13:49   ` kbuild test robot
2017-01-19 16:55 ` [PATCH v6 00/13] net: ethernet: aquantia: Add " 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=20170119090931.GA28354@lkp-ne04.lkp.intel.com \
    --to=lkp@intel.com \
    --cc=Alexander.Loktionov@aquantia.com \
    --cc=Dmitrii.Tarakanov@aquantia.com \
    --cc=Dmitry.Bezrukov@aquantia.com \
    --cc=Pavel.Belous@aquantia.com \
    --cc=Simon.Edelhaus@aquantia.com \
    --cc=davem@davemloft.net \
    --cc=kbuild-all@01.org \
    --cc=netdev@vger.kernel.org \
    --cc=vomlehn@texas.net \
    /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).