aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/qib/qib_init.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/infiniband/hw/qib/qib_init.c')
-rw-r--r--drivers/infiniband/hw/qib/qib_init.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/infiniband/hw/qib/qib_init.c b/drivers/infiniband/hw/qib/qib_init.c
index 729da39c49ed..2ee36953e234 100644
--- a/drivers/infiniband/hw/qib/qib_init.c
+++ b/drivers/infiniband/hw/qib/qib_init.c
@@ -140,7 +140,7 @@ int qib_create_ctxts(struct qib_devdata *dd)
140 * Allocate full ctxtcnt array, rather than just cfgctxts, because 140 * Allocate full ctxtcnt array, rather than just cfgctxts, because
141 * cleanup iterates across all possible ctxts. 141 * cleanup iterates across all possible ctxts.
142 */ 142 */
143 dd->rcd = kzalloc(sizeof(*dd->rcd) * dd->ctxtcnt, GFP_KERNEL); 143 dd->rcd = kcalloc(dd->ctxtcnt, sizeof(*dd->rcd), GFP_KERNEL);
144 if (!dd->rcd) { 144 if (!dd->rcd) {
145 qib_dev_err(dd, 145 qib_dev_err(dd,
146 "Unable to allocate ctxtdata array, failing\n"); 146 "Unable to allocate ctxtdata array, failing\n");
@@ -234,6 +234,7 @@ int qib_init_pportdata(struct qib_pportdata *ppd, struct qib_devdata *dd,
234 u8 hw_pidx, u8 port) 234 u8 hw_pidx, u8 port)
235{ 235{
236 int size; 236 int size;
237
237 ppd->dd = dd; 238 ppd->dd = dd;
238 ppd->hw_pidx = hw_pidx; 239 ppd->hw_pidx = hw_pidx;
239 ppd->port = port; /* IB port number, not index */ 240 ppd->port = port; /* IB port number, not index */
@@ -613,6 +614,7 @@ static int qib_create_workqueues(struct qib_devdata *dd)
613 ppd = dd->pport + pidx; 614 ppd = dd->pport + pidx;
614 if (!ppd->qib_wq) { 615 if (!ppd->qib_wq) {
615 char wq_name[8]; /* 3 + 2 + 1 + 1 + 1 */ 616 char wq_name[8]; /* 3 + 2 + 1 + 1 + 1 */
617
616 snprintf(wq_name, sizeof(wq_name), "qib%d_%d", 618 snprintf(wq_name, sizeof(wq_name), "qib%d_%d",
617 dd->unit, pidx); 619 dd->unit, pidx);
618 ppd->qib_wq = 620 ppd->qib_wq =
@@ -714,6 +716,7 @@ int qib_init(struct qib_devdata *dd, int reinit)
714 716
715 for (pidx = 0; pidx < dd->num_pports; ++pidx) { 717 for (pidx = 0; pidx < dd->num_pports; ++pidx) {
716 int mtu; 718 int mtu;
719
717 if (lastfail) 720 if (lastfail)
718 ret = lastfail; 721 ret = lastfail;
719 ppd = dd->pport + pidx; 722 ppd = dd->pport + pidx;
@@ -931,7 +934,6 @@ static void qib_shutdown_device(struct qib_devdata *dd)
931 qib_free_pportdata(ppd); 934 qib_free_pportdata(ppd);
932 } 935 }
933 936
934 qib_update_eeprom_log(dd);
935} 937}
936 938
937/** 939/**
@@ -1026,8 +1028,7 @@ static void qib_verify_pioperf(struct qib_devdata *dd)
1026 addr = vmalloc(cnt); 1028 addr = vmalloc(cnt);
1027 if (!addr) { 1029 if (!addr) {
1028 qib_devinfo(dd->pcidev, 1030 qib_devinfo(dd->pcidev,
1029 "Couldn't get memory for checking PIO perf," 1031 "Couldn't get memory for checking PIO perf, skipping\n");
1030 " skipping\n");
1031 goto done; 1032 goto done;
1032 } 1033 }
1033 1034
@@ -1163,6 +1164,7 @@ struct qib_devdata *qib_alloc_devdata(struct pci_dev *pdev, size_t extra)
1163 1164
1164 if (!qib_cpulist_count) { 1165 if (!qib_cpulist_count) {
1165 u32 count = num_online_cpus(); 1166 u32 count = num_online_cpus();
1167
1166 qib_cpulist = kzalloc(BITS_TO_LONGS(count) * 1168 qib_cpulist = kzalloc(BITS_TO_LONGS(count) *
1167 sizeof(long), GFP_KERNEL); 1169 sizeof(long), GFP_KERNEL);
1168 if (qib_cpulist) 1170 if (qib_cpulist)
@@ -1179,7 +1181,7 @@ bail:
1179 if (!list_empty(&dd->list)) 1181 if (!list_empty(&dd->list))
1180 list_del_init(&dd->list); 1182 list_del_init(&dd->list);
1181 ib_dealloc_device(&dd->verbs_dev.ibdev); 1183 ib_dealloc_device(&dd->verbs_dev.ibdev);
1182 return ERR_PTR(ret);; 1184 return ERR_PTR(ret);
1183} 1185}
1184 1186
1185/* 1187/*