]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - drivers/scsi/ipr.c
treewide: Use array_size() in vmalloc()
[linux.git] / drivers / scsi / ipr.c
index dda1a64ab89cfb32738fca17c23831c7e0d34ffe..0a9b8b387bd2e70e87310ef7908012a46f32942f 100644 (file)
@@ -435,6 +435,8 @@ struct ipr_error_table_t ipr_error_table[] = {
        "4080: IOA exceeded maximum operating temperature"},
        {0x060B8000, 0, IPR_DEFAULT_LOG_LEVEL,
        "4085: Service required"},
+       {0x060B8100, 0, IPR_DEFAULT_LOG_LEVEL,
+       "4086: SAS Adapter Hardware Configuration Error"},
        {0x06288000, 0, IPR_DEFAULT_LOG_LEVEL,
        "3140: Device bus not ready to ready transition"},
        {0x06290000, 0, IPR_DEFAULT_LOG_LEVEL,
@@ -4329,9 +4331,11 @@ static int ipr_alloc_dump(struct ipr_ioa_cfg *ioa_cfg)
        }
 
        if (ioa_cfg->sis64)
-               ioa_data = vmalloc(IPR_FMT3_MAX_NUM_DUMP_PAGES * sizeof(__be32 *));
+               ioa_data = vmalloc(array_size(IPR_FMT3_MAX_NUM_DUMP_PAGES,
+                                             sizeof(__be32 *)));
        else
-               ioa_data = vmalloc(IPR_FMT2_MAX_NUM_DUMP_PAGES * sizeof(__be32 *));
+               ioa_data = vmalloc(array_size(IPR_FMT2_MAX_NUM_DUMP_PAGES,
+                                             sizeof(__be32 *)));
 
        if (!ioa_data) {
                ipr_err("Dump memory allocation failed\n");
@@ -9711,8 +9715,9 @@ static int ipr_alloc_mem(struct ipr_ioa_cfg *ioa_cfg)
        int i, rc = -ENOMEM;
 
        ENTER;
-       ioa_cfg->res_entries = kzalloc(sizeof(struct ipr_resource_entry) *
-                                      ioa_cfg->max_devs_supported, GFP_KERNEL);
+       ioa_cfg->res_entries = kcalloc(ioa_cfg->max_devs_supported,
+                                      sizeof(struct ipr_resource_entry),
+                                      GFP_KERNEL);
 
        if (!ioa_cfg->res_entries)
                goto out;
@@ -9773,8 +9778,9 @@ static int ipr_alloc_mem(struct ipr_ioa_cfg *ioa_cfg)
                list_add_tail(&ioa_cfg->hostrcb[i]->queue, &ioa_cfg->hostrcb_free_q);
        }
 
-       ioa_cfg->trace = kzalloc(sizeof(struct ipr_trace_entry) *
-                                IPR_NUM_TRACE_ENTRIES, GFP_KERNEL);
+       ioa_cfg->trace = kcalloc(IPR_NUM_TRACE_ENTRIES,
+                                sizeof(struct ipr_trace_entry),
+                                GFP_KERNEL);
 
        if (!ioa_cfg->trace)
                goto out_free_hostrcb_dma;