[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1484900397.12563.1.camel@perches.com>
Date: Fri, 20 Jan 2017 00:19:57 -0800
From: Joe Perches <joe@...ches.com>
To: kbuild test robot <lkp@...el.com>,
Alexander Loktionov <Alexander.Loktionov@...antia.com>
Cc: kbuild-all@...org, netdev@...r.kernel.org,
David VomLehn <vomlehn@...as.net>,
"David S . Miller" <davem@...emloft.net>,
Simon Edelhaus <Simon.Edelhaus@...antia.com>,
Dmitrii Tarakanov <Dmitrii.Tarakanov@...antia.com>,
Pavel Belous <Pavel.Belous@...antia.com>,
Dmitry Bezrukov <Dmitry.Bezrukov@...antia.com>
Subject: Re: [PATCH] net: ethernet: aquantia: fix alloc_cast.cocci warnings
On Thu, 2017-01-19 at 17:09 +0800, kbuild test robot wrote:
> 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.
[]
> --- 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);
This should likely be kcalloc
Powered by blists - more mailing lists