diff options
author | Robert P. J. Day <rpjday@mindspring.com> | 2006-12-13 03:35:56 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-13 12:05:58 -0500 |
commit | 5cbded585d129d0226cb48ac4202b253c781be26 (patch) | |
tree | fb24edc194a57ee81a3bf8a4dd8a95030dd0ad22 /drivers/net/wireless | |
parent | 0743b86800cf1dfbf96df4a438938127bbe4476c (diff) |
[PATCH] getting rid of all casts of k[cmz]alloc() calls
Run this:
#!/bin/sh
for f in $(grep -Erl "\([^\)]*\) *k[cmz]alloc" *) ; do
echo "De-casting $f..."
perl -pi -e "s/ ?= ?\([^\)]*\) *(k[cmz]alloc) *\(/ = \1\(/" $f
done
And then go through and reinstate those cases where code is casting pointers
to non-pointers.
And then drop a few hunks which conflicted with outstanding work.
Cc: Russell King <rmk@arm.linux.org.uk>, Ian Molton <spyro@f2s.com>
Cc: Mikael Starvik <starvik@axis.com>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: Roman Zippel <zippel@linux-m68k.org>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Kyle McMartin <kyle@mcmartin.ca>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Jeff Dike <jdike@addtoit.com>
Cc: Greg KH <greg@kroah.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
Cc: Paul Fulghum <paulkf@microgate.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Karsten Keil <kkeil@suse.de>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
Cc: Jeff Garzik <jeff@garzik.org>
Cc: James Bottomley <James.Bottomley@steeleye.com>
Cc: Ian Kent <raven@themaw.net>
Cc: Steven French <sfrench@us.ibm.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Neil Brown <neilb@cse.unsw.edu.au>
Cc: Jaroslav Kysela <perex@suse.cz>
Cc: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/hostap/hostap_ap.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/hostap/hostap_download.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/hostap/hostap_hw.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/hostap/hostap_ioctl.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/hostap/hostap_main.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ipw2100.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/prism54/isl_ioctl.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/wavelan_cs.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/zd1211rw/zd_chip.c | 2 |
9 files changed, 9 insertions, 9 deletions
diff --git a/drivers/net/wireless/hostap/hostap_ap.c b/drivers/net/wireless/hostap/hostap_ap.c index 974a8e5bec8b..efb8cf3bd8ad 100644 --- a/drivers/net/wireless/hostap/hostap_ap.c +++ b/drivers/net/wireless/hostap/hostap_ap.c | |||
@@ -1253,7 +1253,7 @@ static char * ap_auth_make_challenge(struct ap_data *ap) | |||
1253 | return NULL; | 1253 | return NULL; |
1254 | } | 1254 | } |
1255 | 1255 | ||
1256 | tmpbuf = (char *) kmalloc(WLAN_AUTH_CHALLENGE_LEN, GFP_ATOMIC); | 1256 | tmpbuf = kmalloc(WLAN_AUTH_CHALLENGE_LEN, GFP_ATOMIC); |
1257 | if (tmpbuf == NULL) { | 1257 | if (tmpbuf == NULL) { |
1258 | PDEBUG(DEBUG_AP, "AP: kmalloc failed for challenge\n"); | 1258 | PDEBUG(DEBUG_AP, "AP: kmalloc failed for challenge\n"); |
1259 | return NULL; | 1259 | return NULL; |
diff --git a/drivers/net/wireless/hostap/hostap_download.c b/drivers/net/wireless/hostap/hostap_download.c index 24fc387bba67..c7678e67697d 100644 --- a/drivers/net/wireless/hostap/hostap_download.c +++ b/drivers/net/wireless/hostap/hostap_download.c | |||
@@ -201,7 +201,7 @@ static u8 * prism2_read_pda(struct net_device *dev) | |||
201 | 0x7f0002 /* Intel PRO/Wireless 2011B (PCI) */, | 201 | 0x7f0002 /* Intel PRO/Wireless 2011B (PCI) */, |
202 | }; | 202 | }; |
203 | 203 | ||
204 | buf = (u8 *) kmalloc(PRISM2_PDA_SIZE, GFP_KERNEL); | 204 | buf = kmalloc(PRISM2_PDA_SIZE, GFP_KERNEL); |
205 | if (buf == NULL) | 205 | if (buf == NULL) |
206 | return NULL; | 206 | return NULL; |
207 | 207 | ||
diff --git a/drivers/net/wireless/hostap/hostap_hw.c b/drivers/net/wireless/hostap/hostap_hw.c index a394a23b9a20..3079378fb8cd 100644 --- a/drivers/net/wireless/hostap/hostap_hw.c +++ b/drivers/net/wireless/hostap/hostap_hw.c | |||
@@ -2252,7 +2252,7 @@ static int hostap_tx_compl_read(local_info_t *local, int error, | |||
2252 | if (txdesc->sw_support) { | 2252 | if (txdesc->sw_support) { |
2253 | len = le16_to_cpu(txdesc->data_len); | 2253 | len = le16_to_cpu(txdesc->data_len); |
2254 | if (len < PRISM2_DATA_MAXLEN) { | 2254 | if (len < PRISM2_DATA_MAXLEN) { |
2255 | *payload = (char *) kmalloc(len, GFP_ATOMIC); | 2255 | *payload = kmalloc(len, GFP_ATOMIC); |
2256 | if (*payload == NULL || | 2256 | if (*payload == NULL || |
2257 | hfa384x_from_bap(dev, BAP0, *payload, len)) { | 2257 | hfa384x_from_bap(dev, BAP0, *payload, len)) { |
2258 | PDEBUG(DEBUG_EXTRA, "%s: could not read TX " | 2258 | PDEBUG(DEBUG_EXTRA, "%s: could not read TX " |
diff --git a/drivers/net/wireless/hostap/hostap_ioctl.c b/drivers/net/wireless/hostap/hostap_ioctl.c index 3b7b8063ff1c..cb08bc5db2bd 100644 --- a/drivers/net/wireless/hostap/hostap_ioctl.c +++ b/drivers/net/wireless/hostap/hostap_ioctl.c | |||
@@ -3829,7 +3829,7 @@ static int prism2_ioctl_priv_hostapd(local_info_t *local, struct iw_point *p) | |||
3829 | p->length > PRISM2_HOSTAPD_MAX_BUF_SIZE || !p->pointer) | 3829 | p->length > PRISM2_HOSTAPD_MAX_BUF_SIZE || !p->pointer) |
3830 | return -EINVAL; | 3830 | return -EINVAL; |
3831 | 3831 | ||
3832 | param = (struct prism2_hostapd_param *) kmalloc(p->length, GFP_KERNEL); | 3832 | param = kmalloc(p->length, GFP_KERNEL); |
3833 | if (param == NULL) | 3833 | if (param == NULL) |
3834 | return -ENOMEM; | 3834 | return -ENOMEM; |
3835 | 3835 | ||
diff --git a/drivers/net/wireless/hostap/hostap_main.c b/drivers/net/wireless/hostap/hostap_main.c index 0796be9d9e77..04c19cefa1da 100644 --- a/drivers/net/wireless/hostap/hostap_main.c +++ b/drivers/net/wireless/hostap/hostap_main.c | |||
@@ -250,7 +250,7 @@ u16 hostap_tx_callback_register(local_info_t *local, | |||
250 | unsigned long flags; | 250 | unsigned long flags; |
251 | struct hostap_tx_callback_info *entry; | 251 | struct hostap_tx_callback_info *entry; |
252 | 252 | ||
253 | entry = (struct hostap_tx_callback_info *) kmalloc(sizeof(*entry), | 253 | entry = kmalloc(sizeof(*entry), |
254 | GFP_ATOMIC); | 254 | GFP_ATOMIC); |
255 | if (entry == NULL) | 255 | if (entry == NULL) |
256 | return 0; | 256 | return 0; |
diff --git a/drivers/net/wireless/ipw2100.c b/drivers/net/wireless/ipw2100.c index dd9ba4aad7bb..0e94fbbf7a94 100644 --- a/drivers/net/wireless/ipw2100.c +++ b/drivers/net/wireless/ipw2100.c | |||
@@ -2246,7 +2246,7 @@ static int ipw2100_snapshot_alloc(struct ipw2100_priv *priv) | |||
2246 | if (priv->snapshot[0]) | 2246 | if (priv->snapshot[0]) |
2247 | return 1; | 2247 | return 1; |
2248 | for (i = 0; i < 0x30; i++) { | 2248 | for (i = 0; i < 0x30; i++) { |
2249 | priv->snapshot[i] = (u8 *) kmalloc(0x1000, GFP_ATOMIC); | 2249 | priv->snapshot[i] = kmalloc(0x1000, GFP_ATOMIC); |
2250 | if (!priv->snapshot[i]) { | 2250 | if (!priv->snapshot[i]) { |
2251 | IPW_DEBUG_INFO("%s: Error allocating snapshot " | 2251 | IPW_DEBUG_INFO("%s: Error allocating snapshot " |
2252 | "buffer %d\n", priv->net_dev->name, i); | 2252 | "buffer %d\n", priv->net_dev->name, i); |
diff --git a/drivers/net/wireless/prism54/isl_ioctl.c b/drivers/net/wireless/prism54/isl_ioctl.c index 96606ed10076..838d510213c6 100644 --- a/drivers/net/wireless/prism54/isl_ioctl.c +++ b/drivers/net/wireless/prism54/isl_ioctl.c | |||
@@ -2775,7 +2775,7 @@ prism54_hostapd(struct net_device *ndev, struct iw_point *p) | |||
2775 | p->length > PRISM2_HOSTAPD_MAX_BUF_SIZE || !p->pointer) | 2775 | p->length > PRISM2_HOSTAPD_MAX_BUF_SIZE || !p->pointer) |
2776 | return -EINVAL; | 2776 | return -EINVAL; |
2777 | 2777 | ||
2778 | param = (struct prism2_hostapd_param *) kmalloc(p->length, GFP_KERNEL); | 2778 | param = kmalloc(p->length, GFP_KERNEL); |
2779 | if (param == NULL) | 2779 | if (param == NULL) |
2780 | return -ENOMEM; | 2780 | return -ENOMEM; |
2781 | 2781 | ||
diff --git a/drivers/net/wireless/wavelan_cs.c b/drivers/net/wireless/wavelan_cs.c index 233d906c08f0..5eb81638e846 100644 --- a/drivers/net/wireless/wavelan_cs.c +++ b/drivers/net/wireless/wavelan_cs.c | |||
@@ -603,7 +603,7 @@ static wavepoint_history *wl_new_wavepoint(unsigned short nwid, unsigned char se | |||
603 | if(lp->wavepoint_table.num_wavepoints==MAX_WAVEPOINTS) | 603 | if(lp->wavepoint_table.num_wavepoints==MAX_WAVEPOINTS) |
604 | return NULL; | 604 | return NULL; |
605 | 605 | ||
606 | new_wavepoint=(wavepoint_history *) kmalloc(sizeof(wavepoint_history),GFP_ATOMIC); | 606 | new_wavepoint = kmalloc(sizeof(wavepoint_history),GFP_ATOMIC); |
607 | if(new_wavepoint==NULL) | 607 | if(new_wavepoint==NULL) |
608 | return NULL; | 608 | return NULL; |
609 | 609 | ||
diff --git a/drivers/net/wireless/zd1211rw/zd_chip.c b/drivers/net/wireless/zd1211rw/zd_chip.c index 77e11ddad836..78ea72fb8f0c 100644 --- a/drivers/net/wireless/zd1211rw/zd_chip.c +++ b/drivers/net/wireless/zd1211rw/zd_chip.c | |||
@@ -101,7 +101,7 @@ int zd_ioread32v_locked(struct zd_chip *chip, u32 *values, const zd_addr_t *addr | |||
101 | 101 | ||
102 | /* Allocate a single memory block for values and addresses. */ | 102 | /* Allocate a single memory block for values and addresses. */ |
103 | count16 = 2*count; | 103 | count16 = 2*count; |
104 | a16 = (zd_addr_t *)kmalloc(count16 * (sizeof(zd_addr_t) + sizeof(u16)), | 104 | a16 = kmalloc(count16 * (sizeof(zd_addr_t) + sizeof(u16)), |
105 | GFP_NOFS); | 105 | GFP_NOFS); |
106 | if (!a16) { | 106 | if (!a16) { |
107 | dev_dbg_f(zd_chip_dev(chip), | 107 | dev_dbg_f(zd_chip_dev(chip), |