login
Login
/
Register
Search
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2007
»
August
»
30
Re: [PATCH 13/30] net: Don't do pointless kmalloc return value casts in zd1211 driver
view
thread
!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From:
Daniel Drake <dsd@...>
To: Jesper Juhl <jesper.juhl@...>
Cc: Linux Kernel Mailing List <linux-kernel@...>, <netdev@...>, David S. Miller <davem@...>, Ulrich Kunitz <kune@...>, <linux-wireless@...>
Subject:
Re: [PATCH 13/30] net: Don't do pointless kmalloc return value casts in zd1211 driver
Date: Thursday, August 30, 2007 - 1:54 pm
Jesper Juhl wrote:
quoted text
> Since kmalloc() returns a void pointer there is no reason to cast > its return value. > This patch also removes a pointless initialization of a variable.
NAK: adds a sparse warning zd_chip.c:116:15: warning: implicit cast to nocast type
quoted text
> Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com> > --- > drivers/net/wireless/zd1211rw/zd_chip.c | 5 ++--- > 1 files changed, 2 insertions(+), 3 deletions(-) > > diff --git a/drivers/net/wireless/zd1211rw/zd_chip.c b/drivers/net/wireless/zd1211rw/zd_chip.c > index c39f198..4942e5c 100644 > --- a/drivers/net/wireless/zd1211rw/zd_chip.c > +++ b/drivers/net/wireless/zd1211rw/zd_chip.c > @@ -106,8 +106,8 @@ int zd_ioread32v_locked(struct zd_chip *chip, u32 *values, const zd_addr_t *addr > { > int r; > int i; > - zd_addr_t *a16 = (zd_addr_t *)NULL; > u16 *v16; > + zd_addr_t *a16; > unsigned int count16; > > if (count > USB_MAX_IOREAD32_COUNT) > @@ -115,8 +115,7 @@ int zd_ioread32v_locked(struct zd_chip *chip, u32 *values, const zd_addr_t *addr > > /* Allocate a single memory block for values and addresses. */ > count16 = 2*count; > - a16 = (zd_addr_t *) kmalloc(count16 * (sizeof(zd_addr_t) + sizeof(u16)), > - GFP_KERNEL); > + a16 = kmalloc(count16 * (sizeof(zd_addr_t) + sizeof(u16)), GFP_KERNEL); > if (!a16) { > dev_dbg_f(zd_chip_dev(chip), > "error ENOMEM in allocation of a16\n");
-
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [thread] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
Re: [PATCH 13/30] net: Don't do pointless kmalloc return val...
, Daniel Drake
, (Thu Aug 30, 1:54 pm)
Re: [PATCH 13/30] net: Don't do pointless kmalloc return val...
, Jesper Juhl
, (Thu Aug 30, 4:20 pm)
Re: [PATCH 13/30] net: Don't do pointless kmalloc return val...
, Herbert Xu
, (Fri Aug 31, 5:30 am)
Re: [PATCH 13/30] net: Don't do pointless kmalloc return val...
, Daniel Drake
, (Thu Aug 30, 7:47 pm)
Re: [PATCH 13/30] net: Don't do pointless kmalloc return val...
, Joe Perches
, (Thu Aug 30, 6:19 pm)
[PATCH] Don't needlessly initialize variable to NULL in zd_c...
, Jesper Juhl
, (Thu Aug 30, 6:30 pm)
Re: [PATCH] Don't needlessly initialize variable to NULL in ...
, Randy Dunlap
, (Thu Aug 30, 6:42 pm)
Re: [PATCH] Don't needlessly initialize variable to NULL in ...
, Jesper Juhl
, (Thu Aug 30, 7:04 pm)
Navigation
Create content
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
david
Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3
Linus Torvalds
Linux 2.6.27-rc5
Greg KH
[GIT PATCH] driver core patches against 2.6.24
David Miller
Slow DOWN, please!!!
git
:
openbsd-misc
:
linux-netdev
:
Jarek Poplawski
[PATCH] pkt_sched: Destroy gen estimators under rtnl_lock().
David Miller
[GIT]: Networking
Gerrit Renker
[PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side)
Natalie Protasevich
[BUG] New Kernel Bugs
Colocation donated by:
Who's online
There are currently
0 users
and
726 guests
online.
Syndicate