aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/dpt_i2o.c
diff options
context:
space:
mode:
authorvignesh.babu@wipro.com <vignesh.babu@wipro.com>2007-04-16 02:05:38 -0400
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2007-05-06 10:33:11 -0400
commitab552204599d311988be89fe0bbbe5ea9d84184a (patch)
tree2856dd2e220ee0ba576c8d27a0e021e9cb2ad90c /drivers/scsi/dpt_i2o.c
parent4530a16967a52e7ff6f8840d7e323cfb589fa2ae (diff)
[SCSI] dpt_i2o: kmalloc/memset->kzalloc
Replacing kmalloc/memset combination with kzalloc. Signed-off-by: vignesh babu <vignesh.babu@wipro.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/dpt_i2o.c')
-rw-r--r--drivers/scsi/dpt_i2o.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/drivers/scsi/dpt_i2o.c b/drivers/scsi/dpt_i2o.c
index f7b9dbd64a96..6c384ab2884a 100644
--- a/drivers/scsi/dpt_i2o.c
+++ b/drivers/scsi/dpt_i2o.c
@@ -1309,13 +1309,12 @@ static s32 adpt_i2o_reset_hba(adpt_hba* pHba)
1309 schedule_timeout_uninterruptible(1); 1309 schedule_timeout_uninterruptible(1);
1310 } while (m == EMPTY_QUEUE); 1310 } while (m == EMPTY_QUEUE);
1311 1311
1312 status = kmalloc(4, GFP_KERNEL|ADDR32); 1312 status = kzalloc(4, GFP_KERNEL|ADDR32);
1313 if(status == NULL) { 1313 if(status == NULL) {
1314 adpt_send_nop(pHba, m); 1314 adpt_send_nop(pHba, m);
1315 printk(KERN_ERR"IOP reset failed - no free memory.\n"); 1315 printk(KERN_ERR"IOP reset failed - no free memory.\n");
1316 return -ENOMEM; 1316 return -ENOMEM;
1317 } 1317 }
1318 memset(status,0,4);
1319 1318
1320 msg[0]=EIGHT_WORD_MSG_SIZE|SGL_OFFSET_0; 1319 msg[0]=EIGHT_WORD_MSG_SIZE|SGL_OFFSET_0;
1321 msg[1]=I2O_CMD_ADAPTER_RESET<<24|HOST_TID<<12|ADAPTER_TID; 1320 msg[1]=I2O_CMD_ADAPTER_RESET<<24|HOST_TID<<12|ADAPTER_TID;
@@ -1505,21 +1504,19 @@ static int adpt_i2o_parse_lct(adpt_hba* pHba)
1505 continue; 1504 continue;
1506 } 1505 }
1507 if( pHba->channel[bus_no].device[scsi_id] == NULL){ 1506 if( pHba->channel[bus_no].device[scsi_id] == NULL){
1508 pDev = kmalloc(sizeof(struct adpt_device),GFP_KERNEL); 1507 pDev = kzalloc(sizeof(struct adpt_device),GFP_KERNEL);
1509 if(pDev == NULL) { 1508 if(pDev == NULL) {
1510 return -ENOMEM; 1509 return -ENOMEM;
1511 } 1510 }
1512 pHba->channel[bus_no].device[scsi_id] = pDev; 1511 pHba->channel[bus_no].device[scsi_id] = pDev;
1513 memset(pDev,0,sizeof(struct adpt_device));
1514 } else { 1512 } else {
1515 for( pDev = pHba->channel[bus_no].device[scsi_id]; 1513 for( pDev = pHba->channel[bus_no].device[scsi_id];
1516 pDev->next_lun; pDev = pDev->next_lun){ 1514 pDev->next_lun; pDev = pDev->next_lun){
1517 } 1515 }
1518 pDev->next_lun = kmalloc(sizeof(struct adpt_device),GFP_KERNEL); 1516 pDev->next_lun = kzalloc(sizeof(struct adpt_device),GFP_KERNEL);
1519 if(pDev->next_lun == NULL) { 1517 if(pDev->next_lun == NULL) {
1520 return -ENOMEM; 1518 return -ENOMEM;
1521 } 1519 }
1522 memset(pDev->next_lun,0,sizeof(struct adpt_device));
1523 pDev = pDev->next_lun; 1520 pDev = pDev->next_lun;
1524 } 1521 }
1525 pDev->tid = tid; 1522 pDev->tid = tid;
@@ -1668,12 +1665,11 @@ static int adpt_i2o_passthru(adpt_hba* pHba, u32 __user *arg)
1668 reply_size = REPLY_FRAME_SIZE; 1665 reply_size = REPLY_FRAME_SIZE;
1669 } 1666 }
1670 reply_size *= 4; 1667 reply_size *= 4;
1671 reply = kmalloc(REPLY_FRAME_SIZE*4, GFP_KERNEL); 1668 reply = kzalloc(REPLY_FRAME_SIZE*4, GFP_KERNEL);
1672 if(reply == NULL) { 1669 if(reply == NULL) {
1673 printk(KERN_WARNING"%s: Could not allocate reply buffer\n",pHba->name); 1670 printk(KERN_WARNING"%s: Could not allocate reply buffer\n",pHba->name);
1674 return -ENOMEM; 1671 return -ENOMEM;
1675 } 1672 }
1676 memset(reply,0,REPLY_FRAME_SIZE*4);
1677 sg_offset = (msg[0]>>4)&0xf; 1673 sg_offset = (msg[0]>>4)&0xf;
1678 msg[2] = 0x40000000; // IOCTL context 1674 msg[2] = 0x40000000; // IOCTL context
1679 msg[3] = (u32)reply; 1675 msg[3] = (u32)reply;
@@ -2445,7 +2441,7 @@ static s32 adpt_i2o_reparse_lct(adpt_hba* pHba)
2445 } 2441 }
2446 pDev = pHba->channel[bus_no].device[scsi_id]; 2442 pDev = pHba->channel[bus_no].device[scsi_id];
2447 if( pDev == NULL){ 2443 if( pDev == NULL){
2448 pDev = kmalloc(sizeof(struct adpt_device),GFP_KERNEL); 2444 pDev = kzalloc(sizeof(struct adpt_device),GFP_KERNEL);
2449 if(pDev == NULL) { 2445 if(pDev == NULL) {
2450 return -ENOMEM; 2446 return -ENOMEM;
2451 } 2447 }
@@ -2454,12 +2450,11 @@ static s32 adpt_i2o_reparse_lct(adpt_hba* pHba)
2454 while (pDev->next_lun) { 2450 while (pDev->next_lun) {
2455 pDev = pDev->next_lun; 2451 pDev = pDev->next_lun;
2456 } 2452 }
2457 pDev = pDev->next_lun = kmalloc(sizeof(struct adpt_device),GFP_KERNEL); 2453 pDev = pDev->next_lun = kzalloc(sizeof(struct adpt_device),GFP_KERNEL);
2458 if(pDev == NULL) { 2454 if(pDev == NULL) {
2459 return -ENOMEM; 2455 return -ENOMEM;
2460 } 2456 }
2461 } 2457 }
2462 memset(pDev,0,sizeof(struct adpt_device));
2463 pDev->tid = d->lct_data.tid; 2458 pDev->tid = d->lct_data.tid;
2464 pDev->scsi_channel = bus_no; 2459 pDev->scsi_channel = bus_no;
2465 pDev->scsi_id = scsi_id; 2460 pDev->scsi_id = scsi_id;