* [PATCH 07/17][trivial] net, wireless: Remove unnecessary casts of void ptr returning alloc function return values
@ 2010-11-08 23:09 Jesper Juhl
[not found] ` <alpine.LNX.2.00.1011082330390.23697-h2p7t3/P30RzeRGmFJ5qR7ZzlVVXadcDXqFh9Ls21Oc@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: Jesper Juhl @ 2010-11-08 23:09 UTC (permalink / raw)
To: linux-kernel
Cc: trivial, Ulrich Kunitz, Daniel Drake, John W. Linville,
linux-wireless, netdev
Hi,
The [vk][cmz]alloc(_node) family of functions return void pointers which
it's completely unnecessary/pointless to cast to other pointer types since
that happens implicitly.
This patch removes such casts from drivers/net/
Signed-off-by: Jesper Juhl <jj@chaosbits•net>
---
zd_chip.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/wireless/zd1211rw/zd_chip.c b/drivers/net/wireless/zd1211rw/zd_chip.c
index 87a95bc..dfcebed 100644
--- a/drivers/net/wireless/zd1211rw/zd_chip.c
+++ b/drivers/net/wireless/zd1211rw/zd_chip.c
@@ -117,8 +117,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");
--
Jesper Juhl <jj@chaosbits•net> http://www.chaosbits.net/
Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please.
^ permalink raw reply related [flat|nested] 2+ messages in thread[parent not found: <alpine.LNX.2.00.1011082330390.23697-h2p7t3/P30RzeRGmFJ5qR7ZzlVVXadcDXqFh9Ls21Oc@public.gmane.org>]
* Re: [PATCH 07/17][trivial] net, wireless: Remove unnecessary casts of void ptr returning alloc function return values [not found] ` <alpine.LNX.2.00.1011082330390.23697-h2p7t3/P30RzeRGmFJ5qR7ZzlVVXadcDXqFh9Ls21Oc@public.gmane.org> @ 2010-11-09 1:23 ` John W. Linville 0 siblings, 0 replies; 2+ messages in thread From: John W. Linville @ 2010-11-09 1:23 UTC (permalink / raw) To: Jesper Juhl Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA, trivial-DgEjT+Ai2ygdnm+yROfE0A, Ulrich Kunitz, Daniel Drake, linux-wireless-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA On Tue, Nov 09, 2010 at 12:09:13AM +0100, Jesper Juhl wrote: > Hi, > > The [vk][cmz]alloc(_node) family of functions return void pointers which > it's completely unnecessary/pointless to cast to other pointer types since > that happens implicitly. > > This patch removes such casts from drivers/net/ > > > Signed-off-by: Jesper Juhl <jj-IYz4IdjRLj0sV2N9l4h3zg@public•gmane.org> > --- > zd_chip.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > diff --git a/drivers/net/wireless/zd1211rw/zd_chip.c b/drivers/net/wireless/zd1211rw/zd_chip.c > index 87a95bc..dfcebed 100644 > --- a/drivers/net/wireless/zd1211rw/zd_chip.c > +++ b/drivers/net/wireless/zd1211rw/zd_chip.c > @@ -117,8 +117,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"); kcalloc? -- John W. Linville Someday the world will need a hero, and you linville-2XuSBdqkA4R54TAoqtyWWQ@public•gmane.org might be all we have. Be ready. -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public•gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-11-09 1:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-08 23:09 [PATCH 07/17][trivial] net, wireless: Remove unnecessary casts of void ptr returning alloc function return values Jesper Juhl
[not found] ` <alpine.LNX.2.00.1011082330390.23697-h2p7t3/P30RzeRGmFJ5qR7ZzlVVXadcDXqFh9Ls21Oc@public.gmane.org>
2010-11-09 1:23 ` John W. Linville
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox