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/fc4/fc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'drivers/fc4') diff --git a/drivers/fc4/fc.c b/drivers/fc4/fc.c index ca4e67a022d..22b62b3cd14 100644 --- a/drivers/fc4/fc.c +++ b/drivers/fc4/fc.c @@ -266,7 +266,7 @@ static void fcp_report_map_done(fc_channel *fc, int i, int status) printk ("FC: Bad magic from REPORT_AL_MAP on %s - %08x\n", fc->name, p->magic); fc->state = FC_STATE_OFFLINE; } else { - fc->posmap = (fcp_posmap *)kzalloc(sizeof(fcp_posmap)+p->len, GFP_KERNEL); + fc->posmap = kzalloc(sizeof(fcp_posmap)+p->len, GFP_KERNEL); if (!fc->posmap) { printk("FC: Not enough memory, offlining channel\n"); fc->state = FC_STATE_OFFLINE; @@ -355,7 +355,7 @@ void fcp_register(fc_channel *fc, u8 type, int unregister) for (i = fc->can_queue; i < fc->scsi_bitmap_end; i++) set_bit (i, fc->scsi_bitmap); fc->scsi_free = fc->can_queue; - fc->cmd_slots = (fcp_cmnd **)kzalloc(slots * sizeof(fcp_cmnd*), GFP_KERNEL); + fc->cmd_slots = kzalloc(slots * sizeof(fcp_cmnd*), GFP_KERNEL); fc->abort_count = 0; } else { fc->scsi_name[0] = 0; @@ -933,7 +933,7 @@ int fcp_scsi_dev_reset(struct scsi_cmnd *SCpnt) DECLARE_MUTEX_LOCKED(sem); if (!fc->rst_pkt) { - fc->rst_pkt = (struct scsi_cmnd *) kmalloc(sizeof(SCpnt), GFP_KERNEL); + fc->rst_pkt = kmalloc(sizeof(SCpnt), GFP_KERNEL); if (!fc->rst_pkt) return FAILED; fcmd = FCP_CMND(fc->rst_pkt); @@ -1107,7 +1107,7 @@ int fc_do_plogi(fc_channel *fc, unsigned char alpa, fc_wwn *node, fc_wwn *nport) logi *l; int status; - l = (logi *)kzalloc(2 * sizeof(logi), GFP_KERNEL); + l = kzalloc(2 * sizeof(logi), GFP_KERNEL); if (!l) return -ENOMEM; l->code = LS_PLOGI; memcpy (&l->nport_wwn, &fc->wwn_nport, sizeof(fc_wwn)); @@ -1141,7 +1141,7 @@ int fc_do_prli(fc_channel *fc, unsigned char alpa) prli *p; int status; - p = (prli *)kzalloc(2 * sizeof(prli), GFP_KERNEL); + p = kzalloc(2 * sizeof(prli), GFP_KERNEL); if (!p) return -ENOMEM; p->code = LS_PRLI; p->params[0] = 0x08002000; -- cgit v1.2.3