mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-31 04:01:48 -04:00
[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 <[email protected]>, Ian Molton <[email protected]> Cc: Mikael Starvik <[email protected]> Cc: Yoshinori Sato <[email protected]> Cc: Roman Zippel <[email protected]> Cc: Geert Uytterhoeven <[email protected]> Cc: Ralf Baechle <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Kyle McMartin <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Cc: Martin Schwidefsky <[email protected]> Cc: "David S. Miller" <[email protected]> Cc: Jeff Dike <[email protected]> Cc: Greg KH <[email protected]> Cc: Jens Axboe <[email protected]> Cc: Paul Fulghum <[email protected]> Cc: Alan Cox <[email protected]> Cc: Karsten Keil <[email protected]> Cc: Mauro Carvalho Chehab <[email protected]> Cc: Jeff Garzik <[email protected]> Cc: James Bottomley <[email protected]> Cc: Ian Kent <[email protected]> Cc: Steven French <[email protected]> Cc: David Woodhouse <[email protected]> Cc: Neil Brown <[email protected]> Cc: Jaroslav Kysela <[email protected]> Cc: Takashi Iwai <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
0743b86800
commit
5cbded585d
172 changed files with 250 additions and 250 deletions
|
|
@ -408,7 +408,7 @@ act2000_isa_download(act2000_card * card, act2000_ddef __user * cb)
|
|||
p = cblock.buffer;
|
||||
if (!access_ok(VERIFY_READ, p, length))
|
||||
return -EFAULT;
|
||||
buf = (u_char *) kmalloc(1024, GFP_KERNEL);
|
||||
buf = kmalloc(1024, GFP_KERNEL);
|
||||
if (!buf)
|
||||
return -ENOMEM;
|
||||
timeout = 0;
|
||||
|
|
|
|||
|
|
@ -2013,7 +2013,7 @@ static int capidrv_addcontr(u16 contr, struct capi_profile *profp)
|
|||
strcpy(card->name, id);
|
||||
card->contrnr = contr;
|
||||
card->nbchan = profp->nbchannel;
|
||||
card->bchans = (capidrv_bchan *) kmalloc(sizeof(capidrv_bchan) * card->nbchan, GFP_ATOMIC);
|
||||
card->bchans = kmalloc(sizeof(capidrv_bchan) * card->nbchan, GFP_ATOMIC);
|
||||
if (!card->bchans) {
|
||||
printk(KERN_WARNING
|
||||
"capidrv: (%s) Could not allocate bchan-structs.\n", id);
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ put_info_buffer(char *cp)
|
|||
return;
|
||||
if (!*cp)
|
||||
return;
|
||||
if (!(ib = (struct divert_info *) kmalloc(sizeof(struct divert_info) + strlen(cp), GFP_ATOMIC)))
|
||||
if (!(ib = kmalloc(sizeof(struct divert_info) + strlen(cp), GFP_ATOMIC)))
|
||||
return; /* no memory */
|
||||
strcpy(ib->info_start, cp); /* set output string */
|
||||
ib->next = NULL;
|
||||
|
|
|
|||
|
|
@ -153,7 +153,7 @@ int cf_command(int drvid, int mode,
|
|||
*ielenp = p - ielenp - 1; /* set total IE length */
|
||||
|
||||
/* allocate mem for information struct */
|
||||
if (!(cs = (struct call_struc *) kmalloc(sizeof(struct call_struc), GFP_ATOMIC)))
|
||||
if (!(cs = kmalloc(sizeof(struct call_struc), GFP_ATOMIC)))
|
||||
return(-ENOMEM); /* no memory */
|
||||
init_timer(&cs->timer);
|
||||
cs->info[0] = '\0';
|
||||
|
|
@ -276,7 +276,7 @@ int insertrule(int idx, divert_rule *newrule)
|
|||
{ struct deflect_struc *ds,*ds1=NULL;
|
||||
unsigned long flags;
|
||||
|
||||
if (!(ds = (struct deflect_struc *) kmalloc(sizeof(struct deflect_struc),
|
||||
if (!(ds = kmalloc(sizeof(struct deflect_struc),
|
||||
GFP_KERNEL)))
|
||||
return(-ENOMEM); /* no memory */
|
||||
|
||||
|
|
@ -451,7 +451,7 @@ static int isdn_divert_icall(isdn_ctrl *ic)
|
|||
if (dv->rule.action == DEFLECT_PROCEED)
|
||||
if ((!if_used) || ((!extern_wait_max) && (!dv->rule.waittime)))
|
||||
return(0); /* no external deflection needed */
|
||||
if (!(cs = (struct call_struc *) kmalloc(sizeof(struct call_struc), GFP_ATOMIC)))
|
||||
if (!(cs = kmalloc(sizeof(struct call_struc), GFP_ATOMIC)))
|
||||
return(0); /* no memory */
|
||||
init_timer(&cs->timer);
|
||||
cs->info[0] = '\0';
|
||||
|
|
|
|||
|
|
@ -275,7 +275,7 @@ hysdn_conf_open(struct inode *ino, struct file *filep)
|
|||
} else if ((filep->f_mode & (FMODE_READ | FMODE_WRITE)) == FMODE_READ) {
|
||||
/* read access -> output card info data */
|
||||
|
||||
if (!(tmp = (char *) kmalloc(INFO_OUT_LEN * 2 + 2, GFP_KERNEL))) {
|
||||
if (!(tmp = kmalloc(INFO_OUT_LEN * 2 + 2, GFP_KERNEL))) {
|
||||
unlock_kernel();
|
||||
return (-EFAULT); /* out of memory */
|
||||
}
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ put_log_buffer(hysdn_card * card, char *cp)
|
|||
if (pd->if_used <= 0)
|
||||
return; /* no open file for read */
|
||||
|
||||
if (!(ib = (struct log_data *) kmalloc(sizeof(struct log_data) + strlen(cp), GFP_ATOMIC)))
|
||||
if (!(ib = kmalloc(sizeof(struct log_data) + strlen(cp), GFP_ATOMIC)))
|
||||
return; /* no memory */
|
||||
strcpy(ib->log_start, cp); /* set output string */
|
||||
ib->next = NULL;
|
||||
|
|
|
|||
|
|
@ -328,7 +328,7 @@ adpcm_state *
|
|||
isdn_audio_adpcm_init(adpcm_state * s, int nbits)
|
||||
{
|
||||
if (!s)
|
||||
s = (adpcm_state *) kmalloc(sizeof(adpcm_state), GFP_ATOMIC);
|
||||
s = kmalloc(sizeof(adpcm_state), GFP_ATOMIC);
|
||||
if (s) {
|
||||
s->a = 0;
|
||||
s->d = 5;
|
||||
|
|
@ -343,7 +343,7 @@ dtmf_state *
|
|||
isdn_audio_dtmf_init(dtmf_state * s)
|
||||
{
|
||||
if (!s)
|
||||
s = (dtmf_state *) kmalloc(sizeof(dtmf_state), GFP_ATOMIC);
|
||||
s = kmalloc(sizeof(dtmf_state), GFP_ATOMIC);
|
||||
if (s) {
|
||||
s->idx = 0;
|
||||
s->last = ' ';
|
||||
|
|
@ -621,7 +621,7 @@ silence_state *
|
|||
isdn_audio_silence_init(silence_state * s)
|
||||
{
|
||||
if (!s)
|
||||
s = (silence_state *) kmalloc(sizeof(silence_state), GFP_ATOMIC);
|
||||
s = kmalloc(sizeof(silence_state), GFP_ATOMIC);
|
||||
if (s) {
|
||||
s->idx = 0;
|
||||
s->state = 0;
|
||||
|
|
|
|||
|
|
@ -2948,7 +2948,7 @@ isdn_net_addphone(isdn_net_ioctl_phone * phone)
|
|||
isdn_net_phone *n;
|
||||
|
||||
if (p) {
|
||||
if (!(n = (isdn_net_phone *) kmalloc(sizeof(isdn_net_phone), GFP_KERNEL)))
|
||||
if (!(n = kmalloc(sizeof(isdn_net_phone), GFP_KERNEL)))
|
||||
return -ENOMEM;
|
||||
strcpy(n->num, phone->phone);
|
||||
n->next = p->local->phone[phone->outgoing & 1];
|
||||
|
|
|
|||
|
|
@ -717,7 +717,7 @@ isdn_ppp_fill_rq(unsigned char *buf, int len, int proto, int slot)
|
|||
printk(KERN_DEBUG "ippp: device not activated.\n");
|
||||
return 0;
|
||||
}
|
||||
nbuf = (unsigned char *) kmalloc(len + 4, GFP_ATOMIC);
|
||||
nbuf = kmalloc(len + 4, GFP_ATOMIC);
|
||||
if (!nbuf) {
|
||||
printk(KERN_WARNING "ippp: Can't alloc buf\n");
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ pcbit_l2_write(struct pcbit_dev *dev, ulong msg, ushort refnum,
|
|||
dev_kfree_skb(skb);
|
||||
return -1;
|
||||
}
|
||||
if ((frame = (struct frame_buf *) kmalloc(sizeof(struct frame_buf),
|
||||
if ((frame = kmalloc(sizeof(struct frame_buf),
|
||||
GFP_ATOMIC)) == NULL) {
|
||||
printk(KERN_WARNING "pcbit_2_write: kmalloc failed\n");
|
||||
dev_kfree_skb(skb);
|
||||
|
|
|
|||
Loading…
Reference in a new issue