diff options
author | Mariusz Kozlowski <m.kozlowski@tuxland.pl> | 2007-08-11 04:13:24 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.localdomain> | 2007-10-12 14:41:00 -0400 |
commit | bbfbbbc1182f8b44c8cc4c99f4a3f3a512149022 (patch) | |
tree | f7e3d50cda2e3d55bff88c2cc617d60df8ddb2cb /drivers/scsi/dpt_i2o.c | |
parent | f36789e22ac32a6554b8e4d05ab6125fc1161745 (diff) |
[SCSI] kmalloc + memset conversion to kzalloc
In NCR_D700, a4000t, aic7xxx_old, bvme6000, dpt_i2o, gdth, lpfc,
megaraid, mvme16x osst, pluto, qla2xxx, zorro7xx
Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/dpt_i2o.c')
-rw-r--r-- | drivers/scsi/dpt_i2o.c | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/drivers/scsi/dpt_i2o.c b/drivers/scsi/dpt_i2o.c index 502732ac270d..9d7bdf73e1e3 100644 --- a/drivers/scsi/dpt_i2o.c +++ b/drivers/scsi/dpt_i2o.c | |||
@@ -949,16 +949,14 @@ static int adpt_install_hba(struct pci_dev* pDev) | |||
949 | } | 949 | } |
950 | 950 | ||
951 | // Allocate and zero the data structure | 951 | // Allocate and zero the data structure |
952 | pHba = kmalloc(sizeof(adpt_hba), GFP_KERNEL); | 952 | pHba = kzalloc(sizeof(adpt_hba), GFP_KERNEL); |
953 | if( pHba == NULL) { | 953 | if (!pHba) { |
954 | if(msg_addr_virt != base_addr_virt){ | 954 | if (msg_addr_virt != base_addr_virt) |
955 | iounmap(msg_addr_virt); | 955 | iounmap(msg_addr_virt); |
956 | } | ||
957 | iounmap(base_addr_virt); | 956 | iounmap(base_addr_virt); |
958 | pci_release_regions(pDev); | 957 | pci_release_regions(pDev); |
959 | return -ENOMEM; | 958 | return -ENOMEM; |
960 | } | 959 | } |
961 | memset(pHba, 0, sizeof(adpt_hba)); | ||
962 | 960 | ||
963 | mutex_lock(&adpt_configuration_lock); | 961 | mutex_lock(&adpt_configuration_lock); |
964 | 962 | ||
@@ -2622,14 +2620,13 @@ static s32 adpt_i2o_init_outbound_q(adpt_hba* pHba) | |||
2622 | 2620 | ||
2623 | msg=(u32 __iomem *)(pHba->msg_addr_virt+m); | 2621 | msg=(u32 __iomem *)(pHba->msg_addr_virt+m); |
2624 | 2622 | ||
2625 | status = kmalloc(4,GFP_KERNEL|ADDR32); | 2623 | status = kzalloc(4, GFP_KERNEL|ADDR32); |
2626 | if (status==NULL) { | 2624 | if (!status) { |
2627 | adpt_send_nop(pHba, m); | 2625 | adpt_send_nop(pHba, m); |
2628 | printk(KERN_WARNING"%s: IOP reset failed - no free memory.\n", | 2626 | printk(KERN_WARNING"%s: IOP reset failed - no free memory.\n", |
2629 | pHba->name); | 2627 | pHba->name); |
2630 | return -ENOMEM; | 2628 | return -ENOMEM; |
2631 | } | 2629 | } |
2632 | memset(status, 0, 4); | ||
2633 | 2630 | ||
2634 | writel(EIGHT_WORD_MSG_SIZE| SGL_OFFSET_6, &msg[0]); | 2631 | writel(EIGHT_WORD_MSG_SIZE| SGL_OFFSET_6, &msg[0]); |
2635 | writel(I2O_CMD_OUTBOUND_INIT<<24 | HOST_TID<<12 | ADAPTER_TID, &msg[1]); | 2632 | writel(I2O_CMD_OUTBOUND_INIT<<24 | HOST_TID<<12 | ADAPTER_TID, &msg[1]); |
@@ -2668,12 +2665,11 @@ static s32 adpt_i2o_init_outbound_q(adpt_hba* pHba) | |||
2668 | 2665 | ||
2669 | kfree(pHba->reply_pool); | 2666 | kfree(pHba->reply_pool); |
2670 | 2667 | ||
2671 | pHba->reply_pool = kmalloc(pHba->reply_fifo_size * REPLY_FRAME_SIZE * 4, GFP_KERNEL|ADDR32); | 2668 | pHba->reply_pool = kzalloc(pHba->reply_fifo_size * REPLY_FRAME_SIZE * 4, GFP_KERNEL|ADDR32); |
2672 | if(!pHba->reply_pool){ | 2669 | if (!pHba->reply_pool) { |
2673 | printk(KERN_ERR"%s: Could not allocate reply pool\n",pHba->name); | 2670 | printk(KERN_ERR "%s: Could not allocate reply pool\n", pHba->name); |
2674 | return -1; | 2671 | return -ENOMEM; |
2675 | } | 2672 | } |
2676 | memset(pHba->reply_pool, 0 , pHba->reply_fifo_size * REPLY_FRAME_SIZE * 4); | ||
2677 | 2673 | ||
2678 | ptr = pHba->reply_pool; | 2674 | ptr = pHba->reply_pool; |
2679 | for(i = 0; i < pHba->reply_fifo_size; i++) { | 2675 | for(i = 0; i < pHba->reply_fifo_size; i++) { |
@@ -2884,12 +2880,11 @@ static int adpt_i2o_build_sys_table(void) | |||
2884 | 2880 | ||
2885 | kfree(sys_tbl); | 2881 | kfree(sys_tbl); |
2886 | 2882 | ||
2887 | sys_tbl = kmalloc(sys_tbl_len, GFP_KERNEL|ADDR32); | 2883 | sys_tbl = kzalloc(sys_tbl_len, GFP_KERNEL|ADDR32); |
2888 | if(!sys_tbl) { | 2884 | if (!sys_tbl) { |
2889 | printk(KERN_WARNING "SysTab Set failed. Out of memory.\n"); | 2885 | printk(KERN_WARNING "SysTab Set failed. Out of memory.\n"); |
2890 | return -ENOMEM; | 2886 | return -ENOMEM; |
2891 | } | 2887 | } |
2892 | memset(sys_tbl, 0, sys_tbl_len); | ||
2893 | 2888 | ||
2894 | sys_tbl->num_entries = hba_count; | 2889 | sys_tbl->num_entries = hba_count; |
2895 | sys_tbl->version = I2OVERSION; | 2890 | sys_tbl->version = I2OVERSION; |