From 5cbded585d129d0226cb48ac4202b253c781be26 Mon Sep 17 00:00:00 2001 From: "Robert P. J. Day" Date: Wed, 13 Dec 2006 00:35:56 -0800 Subject: [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 , Ian Molton Cc: Mikael Starvik Cc: Yoshinori Sato Cc: Roman Zippel Cc: Geert Uytterhoeven Cc: Ralf Baechle Cc: Paul Mackerras Cc: Kyle McMartin Cc: Benjamin Herrenschmidt Cc: Martin Schwidefsky Cc: "David S. Miller" Cc: Jeff Dike Cc: Greg KH Cc: Jens Axboe Cc: Paul Fulghum Cc: Alan Cox Cc: Karsten Keil Cc: Mauro Carvalho Chehab Cc: Jeff Garzik Cc: James Bottomley Cc: Ian Kent Cc: Steven French Cc: David Woodhouse Cc: Neil Brown Cc: Jaroslav Kysela Cc: Takashi Iwai Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/isdn/divert/divert_procfs.c | 2 +- drivers/isdn/divert/isdn_divert.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers/isdn/divert') diff --git a/drivers/isdn/divert/divert_procfs.c b/drivers/isdn/divert/divert_procfs.c index 399b316..06967da 100644 --- a/drivers/isdn/divert/divert_procfs.c +++ b/drivers/isdn/divert/divert_procfs.c @@ -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; diff --git a/drivers/isdn/divert/isdn_divert.c b/drivers/isdn/divert/isdn_divert.c index 03319ea..7d97d54 100644 --- a/drivers/isdn/divert/isdn_divert.c +++ b/drivers/isdn/divert/isdn_divert.c @@ -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'; -- cgit v1.1