aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorRobert P. J. Day <rpjday@mindspring.com>2006-12-13 03:35:56 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-13 12:05:58 -0500
commit5cbded585d129d0226cb48ac4202b253c781be26 (patch)
treefb24edc194a57ee81a3bf8a4dd8a95030dd0ad22 /drivers/scsi
parent0743b86800cf1dfbf96df4a438938127bbe4476c (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/scsi')
-rw-r--r--drivers/scsi/aacraid/aachba.c2
-rw-r--r--drivers/scsi/aacraid/comminit.c2
-rw-r--r--drivers/scsi/aha1542.c2
-rw-r--r--drivers/scsi/aic7xxx_old.c2
-rw-r--r--drivers/scsi/dc395x.c2
-rw-r--r--drivers/scsi/dpt_i2o.c10
-rw-r--r--drivers/scsi/initio.c2
-rw-r--r--drivers/scsi/osst.c2
-rw-r--r--drivers/scsi/pluto.c2
-rw-r--r--drivers/scsi/sr_ioctl.c2
-rw-r--r--drivers/scsi/sr_vendor.c4
11 files changed, 16 insertions, 16 deletions
diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c
index ac108f9e2674..426cd6f49f5d 100644
--- a/drivers/scsi/aacraid/aachba.c
+++ b/drivers/scsi/aacraid/aachba.c
@@ -288,7 +288,7 @@ int aac_get_containers(struct aac_dev *dev)
288 288
289 if (maximum_num_containers < MAXIMUM_NUM_CONTAINERS) 289 if (maximum_num_containers < MAXIMUM_NUM_CONTAINERS)
290 maximum_num_containers = MAXIMUM_NUM_CONTAINERS; 290 maximum_num_containers = MAXIMUM_NUM_CONTAINERS;
291 fsa_dev_ptr = (struct fsa_dev_info *) kmalloc( 291 fsa_dev_ptr = kmalloc(
292 sizeof(*fsa_dev_ptr) * maximum_num_containers, GFP_KERNEL); 292 sizeof(*fsa_dev_ptr) * maximum_num_containers, GFP_KERNEL);
293 if (!fsa_dev_ptr) { 293 if (!fsa_dev_ptr) {
294 aac_fib_free(fibptr); 294 aac_fib_free(fibptr);
diff --git a/drivers/scsi/aacraid/comminit.c b/drivers/scsi/aacraid/comminit.c
index d5cf8b91a0e7..6d305b2f854e 100644
--- a/drivers/scsi/aacraid/comminit.c
+++ b/drivers/scsi/aacraid/comminit.c
@@ -386,7 +386,7 @@ struct aac_dev *aac_init_adapter(struct aac_dev *dev)
386 * Ok now init the communication subsystem 386 * Ok now init the communication subsystem
387 */ 387 */
388 388
389 dev->queues = (struct aac_queue_block *) kmalloc(sizeof(struct aac_queue_block), GFP_KERNEL); 389 dev->queues = kmalloc(sizeof(struct aac_queue_block), GFP_KERNEL);
390 if (dev->queues == NULL) { 390 if (dev->queues == NULL) {
391 printk(KERN_ERR "Error could not allocate comm region.\n"); 391 printk(KERN_ERR "Error could not allocate comm region.\n");
392 return NULL; 392 return NULL;
diff --git a/drivers/scsi/aha1542.c b/drivers/scsi/aha1542.c
index d7a61a6bdaae..1d239f6c0103 100644
--- a/drivers/scsi/aha1542.c
+++ b/drivers/scsi/aha1542.c
@@ -699,7 +699,7 @@ static int aha1542_queuecommand(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *))
699#endif 699#endif
700 int i; 700 int i;
701 ccb[mbo].op = 2; /* SCSI Initiator Command w/scatter-gather */ 701 ccb[mbo].op = 2; /* SCSI Initiator Command w/scatter-gather */
702 SCpnt->host_scribble = (unsigned char *) kmalloc(512, GFP_KERNEL | GFP_DMA); 702 SCpnt->host_scribble = kmalloc(512, GFP_KERNEL | GFP_DMA);
703 sgpnt = (struct scatterlist *) SCpnt->request_buffer; 703 sgpnt = (struct scatterlist *) SCpnt->request_buffer;
704 cptr = (struct chain *) SCpnt->host_scribble; 704 cptr = (struct chain *) SCpnt->host_scribble;
705 if (cptr == NULL) { 705 if (cptr == NULL) {
diff --git a/drivers/scsi/aic7xxx_old.c b/drivers/scsi/aic7xxx_old.c
index 46eed10b25d9..7d1fec620948 100644
--- a/drivers/scsi/aic7xxx_old.c
+++ b/drivers/scsi/aic7xxx_old.c
@@ -2565,7 +2565,7 @@ aic7xxx_allocate_scb(struct aic7xxx_host *p)
2565 } 2565 }
2566 } 2566 }
2567 scb_count = min( (i-1), p->scb_data->maxscbs - p->scb_data->numscbs); 2567 scb_count = min( (i-1), p->scb_data->maxscbs - p->scb_data->numscbs);
2568 scb_ap = (struct aic7xxx_scb *)kmalloc(sizeof (struct aic7xxx_scb) * scb_count 2568 scb_ap = kmalloc(sizeof (struct aic7xxx_scb) * scb_count
2569 + sizeof(struct aic7xxx_scb_dma), GFP_ATOMIC); 2569 + sizeof(struct aic7xxx_scb_dma), GFP_ATOMIC);
2570 if (scb_ap == NULL) 2570 if (scb_ap == NULL)
2571 return(0); 2571 return(0);
diff --git a/drivers/scsi/dc395x.c b/drivers/scsi/dc395x.c
index e95b367d09ed..a965ed3548d5 100644
--- a/drivers/scsi/dc395x.c
+++ b/drivers/scsi/dc395x.c
@@ -4319,7 +4319,7 @@ static int __devinit adapter_sg_tables_alloc(struct AdapterCtlBlk *acb)
4319 4319
4320 dprintkdbg(DBG_1, "Allocate %i pages for SG tables\n", pages); 4320 dprintkdbg(DBG_1, "Allocate %i pages for SG tables\n", pages);
4321 while (pages--) { 4321 while (pages--) {
4322 ptr = (struct SGentry *)kmalloc(PAGE_SIZE, GFP_KERNEL); 4322 ptr = kmalloc(PAGE_SIZE, GFP_KERNEL);
4323 if (!ptr) { 4323 if (!ptr) {
4324 adapter_sg_tables_free(acb); 4324 adapter_sg_tables_free(acb);
4325 return 1; 4325 return 1;
diff --git a/drivers/scsi/dpt_i2o.c b/drivers/scsi/dpt_i2o.c
index 60b1b434eba7..365db537a28d 100644
--- a/drivers/scsi/dpt_i2o.c
+++ b/drivers/scsi/dpt_i2o.c
@@ -297,7 +297,7 @@ static void adpt_inquiry(adpt_hba* pHba)
297 s32 rcode; 297 s32 rcode;
298 298
299 memset(msg, 0, sizeof(msg)); 299 memset(msg, 0, sizeof(msg));
300 buf = (u8*)kmalloc(80,GFP_KERNEL|ADDR32); 300 buf = kmalloc(80,GFP_KERNEL|ADDR32);
301 if(!buf){ 301 if(!buf){
302 printk(KERN_ERR"%s: Could not allocate buffer\n",pHba->name); 302 printk(KERN_ERR"%s: Could not allocate buffer\n",pHba->name);
303 return; 303 return;
@@ -1311,7 +1311,7 @@ static s32 adpt_i2o_reset_hba(adpt_hba* pHba)
1311 schedule_timeout_uninterruptible(1); 1311 schedule_timeout_uninterruptible(1);
1312 } while (m == EMPTY_QUEUE); 1312 } while (m == EMPTY_QUEUE);
1313 1313
1314 status = (u8*)kmalloc(4, GFP_KERNEL|ADDR32); 1314 status = kmalloc(4, GFP_KERNEL|ADDR32);
1315 if(status == NULL) { 1315 if(status == NULL) {
1316 adpt_send_nop(pHba, m); 1316 adpt_send_nop(pHba, m);
1317 printk(KERN_ERR"IOP reset failed - no free memory.\n"); 1317 printk(KERN_ERR"IOP reset failed - no free memory.\n");
@@ -1444,7 +1444,7 @@ static int adpt_i2o_parse_lct(adpt_hba* pHba)
1444 } 1444 }
1445 continue; 1445 continue;
1446 } 1446 }
1447 d = (struct i2o_device *)kmalloc(sizeof(struct i2o_device), GFP_KERNEL); 1447 d = kmalloc(sizeof(struct i2o_device), GFP_KERNEL);
1448 if(d==NULL) 1448 if(d==NULL)
1449 { 1449 {
1450 printk(KERN_CRIT"%s: Out of memory for I2O device data.\n",pHba->name); 1450 printk(KERN_CRIT"%s: Out of memory for I2O device data.\n",pHba->name);
@@ -2425,7 +2425,7 @@ static s32 adpt_i2o_reparse_lct(adpt_hba* pHba)
2425 pDev = pDev->next_lun; 2425 pDev = pDev->next_lun;
2426 } 2426 }
2427 if(!pDev ) { // Something new add it 2427 if(!pDev ) { // Something new add it
2428 d = (struct i2o_device *)kmalloc(sizeof(struct i2o_device), GFP_KERNEL); 2428 d = kmalloc(sizeof(struct i2o_device), GFP_KERNEL);
2429 if(d==NULL) 2429 if(d==NULL)
2430 { 2430 {
2431 printk(KERN_CRIT "Out of memory for I2O device data.\n"); 2431 printk(KERN_CRIT "Out of memory for I2O device data.\n");
@@ -2728,7 +2728,7 @@ static s32 adpt_i2o_init_outbound_q(adpt_hba* pHba)
2728 2728
2729 kfree(pHba->reply_pool); 2729 kfree(pHba->reply_pool);
2730 2730
2731 pHba->reply_pool = (u32*)kmalloc(pHba->reply_fifo_size * REPLY_FRAME_SIZE * 4, GFP_KERNEL|ADDR32); 2731 pHba->reply_pool = kmalloc(pHba->reply_fifo_size * REPLY_FRAME_SIZE * 4, GFP_KERNEL|ADDR32);
2732 if(!pHba->reply_pool){ 2732 if(!pHba->reply_pool){
2733 printk(KERN_ERR"%s: Could not allocate reply pool\n",pHba->name); 2733 printk(KERN_ERR"%s: Could not allocate reply pool\n",pHba->name);
2734 return -1; 2734 return -1;
diff --git a/drivers/scsi/initio.c b/drivers/scsi/initio.c
index f160357e37a6..d561663fb4e4 100644
--- a/drivers/scsi/initio.c
+++ b/drivers/scsi/initio.c
@@ -2828,7 +2828,7 @@ static int i91u_detect(struct scsi_host_template * tpnt)
2828 2828
2829 for (; tul_num_scb >= MAX_TARGETS + 3; tul_num_scb--) { 2829 for (; tul_num_scb >= MAX_TARGETS + 3; tul_num_scb--) {
2830 i = tul_num_ch * tul_num_scb * sizeof(SCB); 2830 i = tul_num_ch * tul_num_scb * sizeof(SCB);
2831 if ((tul_scb = (SCB *) kmalloc(i, GFP_ATOMIC | GFP_DMA)) != NULL) 2831 if ((tul_scb = kmalloc(i, GFP_ATOMIC | GFP_DMA)) != NULL)
2832 break; 2832 break;
2833 } 2833 }
2834 if (tul_scb == NULL) { 2834 if (tul_scb == NULL) {
diff --git a/drivers/scsi/osst.c b/drivers/scsi/osst.c
index 824fe080d1dc..7d2311067903 100644
--- a/drivers/scsi/osst.c
+++ b/drivers/scsi/osst.c
@@ -5777,7 +5777,7 @@ static int osst_probe(struct device *dev)
5777 dev_num = i; 5777 dev_num = i;
5778 5778
5779 /* allocate a struct osst_tape for this device */ 5779 /* allocate a struct osst_tape for this device */
5780 tpnt = (struct osst_tape *)kmalloc(sizeof(struct osst_tape), GFP_ATOMIC); 5780 tpnt = kmalloc(sizeof(struct osst_tape), GFP_ATOMIC);
5781 if (tpnt == NULL) { 5781 if (tpnt == NULL) {
5782 write_unlock(&os_scsi_tapes_lock); 5782 write_unlock(&os_scsi_tapes_lock);
5783 printk(KERN_ERR "osst :E: Can't allocate device descriptor, device not attached.\n"); 5783 printk(KERN_ERR "osst :E: Can't allocate device descriptor, device not attached.\n");
diff --git a/drivers/scsi/pluto.c b/drivers/scsi/pluto.c
index aa60a5f1fbc3..3b2e1a53e6e2 100644
--- a/drivers/scsi/pluto.c
+++ b/drivers/scsi/pluto.c
@@ -117,7 +117,7 @@ int __init pluto_detect(struct scsi_host_template *tpnt)
117#endif 117#endif
118 return 0; 118 return 0;
119 } 119 }
120 fcs = (struct ctrl_inquiry *) kmalloc (sizeof (struct ctrl_inquiry) * fcscount, GFP_DMA); 120 fcs = kmalloc(sizeof (struct ctrl_inquiry) * fcscount, GFP_DMA);
121 if (!fcs) { 121 if (!fcs) {
122 printk ("PLUTO: Not enough memory to probe\n"); 122 printk ("PLUTO: Not enough memory to probe\n");
123 return 0; 123 return 0;
diff --git a/drivers/scsi/sr_ioctl.c b/drivers/scsi/sr_ioctl.c
index d1268cb46837..0578ba42718b 100644
--- a/drivers/scsi/sr_ioctl.c
+++ b/drivers/scsi/sr_ioctl.c
@@ -546,7 +546,7 @@ int sr_is_xa(Scsi_CD *cd)
546 if (!xa_test) 546 if (!xa_test)
547 return 0; 547 return 0;
548 548
549 raw_sector = (unsigned char *) kmalloc(2048, GFP_KERNEL | SR_GFP_DMA(cd)); 549 raw_sector = kmalloc(2048, GFP_KERNEL | SR_GFP_DMA(cd));
550 if (!raw_sector) 550 if (!raw_sector)
551 return -ENOMEM; 551 return -ENOMEM;
552 if (0 == sr_read_sector(cd, cd->ms_offset + 16, 552 if (0 == sr_read_sector(cd, cd->ms_offset + 16,
diff --git a/drivers/scsi/sr_vendor.c b/drivers/scsi/sr_vendor.c
index a3e9d0f2eb5b..4eb3da996b36 100644
--- a/drivers/scsi/sr_vendor.c
+++ b/drivers/scsi/sr_vendor.c
@@ -117,7 +117,7 @@ int sr_set_blocklength(Scsi_CD *cd, int blocklength)
117 density = (blocklength > 2048) ? 0x81 : 0x83; 117 density = (blocklength > 2048) ? 0x81 : 0x83;
118#endif 118#endif
119 119
120 buffer = (unsigned char *) kmalloc(512, GFP_KERNEL | GFP_DMA); 120 buffer = kmalloc(512, GFP_KERNEL | GFP_DMA);
121 if (!buffer) 121 if (!buffer)
122 return -ENOMEM; 122 return -ENOMEM;
123 123
@@ -164,7 +164,7 @@ int sr_cd_check(struct cdrom_device_info *cdi)
164 if (cd->cdi.mask & CDC_MULTI_SESSION) 164 if (cd->cdi.mask & CDC_MULTI_SESSION)
165 return 0; 165 return 0;
166 166
167 buffer = (unsigned char *) kmalloc(512, GFP_KERNEL | GFP_DMA); 167 buffer = kmalloc(512, GFP_KERNEL | GFP_DMA);
168 if (!buffer) 168 if (!buffer)
169 return -ENOMEM; 169 return -ENOMEM;
170 170