diff options
author | Frank Haverkamp <haver@linux.vnet.ibm.com> | 2014-09-10 10:37:51 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-09-24 02:15:47 -0400 |
commit | d9c11d45b33c9226abd50a50c87e19bfa7c7a2cb (patch) | |
tree | a903d91e1f9b18277672e51aed5d639c152604a1 | |
parent | bc407dd319bb8c3608369989d95b700d00e6cf43 (diff) |
GenWQE: Fix checkpatch complaints
The checkpatch.pl script got improved. I ran it on the latest GenWQE
sources and fixed what it complained about.
Signed-off-by: Frank Haverkamp <haver@linux.vnet.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/misc/genwqe/card_base.c | 18 | ||||
-rw-r--r-- | drivers/misc/genwqe/card_ddcb.c | 22 | ||||
-rw-r--r-- | drivers/misc/genwqe/card_dev.c | 7 | ||||
-rw-r--r-- | drivers/misc/genwqe/card_utils.c | 5 |
4 files changed, 25 insertions, 27 deletions
diff --git a/drivers/misc/genwqe/card_base.c b/drivers/misc/genwqe/card_base.c index 16672d9e1e0c..4cf8f82cfca2 100644 --- a/drivers/misc/genwqe/card_base.c +++ b/drivers/misc/genwqe/card_base.c | |||
@@ -388,8 +388,9 @@ static int genwqe_ffdc_buffs_alloc(struct genwqe_dev *cd) | |||
388 | 388 | ||
389 | /* currently support only the debug units mentioned here */ | 389 | /* currently support only the debug units mentioned here */ |
390 | cd->ffdc[type].entries = e; | 390 | cd->ffdc[type].entries = e; |
391 | cd->ffdc[type].regs = kmalloc(e * sizeof(struct genwqe_reg), | 391 | cd->ffdc[type].regs = |
392 | GFP_KERNEL); | 392 | kmalloc_array(e, sizeof(struct genwqe_reg), |
393 | GFP_KERNEL); | ||
393 | /* | 394 | /* |
394 | * regs == NULL is ok, the using code treats this as no regs, | 395 | * regs == NULL is ok, the using code treats this as no regs, |
395 | * Printing warning is ok in this case. | 396 | * Printing warning is ok in this case. |
@@ -728,8 +729,8 @@ static u64 genwqe_fir_checking(struct genwqe_dev *cd) | |||
728 | __genwqe_writeq(cd, sfir_addr, sfir); | 729 | __genwqe_writeq(cd, sfir_addr, sfir); |
729 | 730 | ||
730 | dev_dbg(&pci_dev->dev, | 731 | dev_dbg(&pci_dev->dev, |
731 | "[HM] Clearing 2ndary FIR 0x%08x " | 732 | "[HM] Clearing 2ndary FIR 0x%08x with 0x%016llx\n", |
732 | "with 0x%016llx\n", sfir_addr, sfir); | 733 | sfir_addr, sfir); |
733 | 734 | ||
734 | /* | 735 | /* |
735 | * note, these cannot be error-Firs | 736 | * note, these cannot be error-Firs |
@@ -745,9 +746,8 @@ static u64 genwqe_fir_checking(struct genwqe_dev *cd) | |||
745 | __genwqe_writeq(cd, fir_clr_addr, mask); | 746 | __genwqe_writeq(cd, fir_clr_addr, mask); |
746 | 747 | ||
747 | dev_dbg(&pci_dev->dev, | 748 | dev_dbg(&pci_dev->dev, |
748 | "[HM] Clearing primary FIR 0x%08x " | 749 | "[HM] Clearing primary FIR 0x%08x with 0x%016llx\n", |
749 | "with 0x%016llx\n", fir_clr_addr, | 750 | fir_clr_addr, mask); |
750 | mask); | ||
751 | } | 751 | } |
752 | } | 752 | } |
753 | } | 753 | } |
@@ -1209,8 +1209,8 @@ static int genwqe_probe(struct pci_dev *pci_dev, | |||
1209 | err = genwqe_health_check_start(cd); | 1209 | err = genwqe_health_check_start(cd); |
1210 | if (err < 0) { | 1210 | if (err < 0) { |
1211 | dev_err(&pci_dev->dev, | 1211 | dev_err(&pci_dev->dev, |
1212 | "err: cannot start health checking! " | 1212 | "err: cannot start health checking! (err=%d)\n", |
1213 | "(err=%d)\n", err); | 1213 | err); |
1214 | goto out_stop_services; | 1214 | goto out_stop_services; |
1215 | } | 1215 | } |
1216 | } | 1216 | } |
diff --git a/drivers/misc/genwqe/card_ddcb.c b/drivers/misc/genwqe/card_ddcb.c index fe8e433cdd15..f10575000180 100644 --- a/drivers/misc/genwqe/card_ddcb.c +++ b/drivers/misc/genwqe/card_ddcb.c | |||
@@ -185,8 +185,7 @@ static void print_ddcb_info(struct genwqe_dev *cd, struct ddcb_queue *queue) | |||
185 | pddcb = queue->ddcb_vaddr; | 185 | pddcb = queue->ddcb_vaddr; |
186 | for (i = 0; i < queue->ddcb_max; i++) { | 186 | for (i = 0; i < queue->ddcb_max; i++) { |
187 | dev_err(&pci_dev->dev, | 187 | dev_err(&pci_dev->dev, |
188 | " %c %-3d: RETC=%03x SEQ=%04x " | 188 | " %c %-3d: RETC=%03x SEQ=%04x HSI=%02X SHI=%02x PRIV=%06llx CMD=%03x\n", |
189 | "HSI=%02X SHI=%02x PRIV=%06llx CMD=%03x\n", | ||
190 | i == queue->ddcb_act ? '>' : ' ', | 189 | i == queue->ddcb_act ? '>' : ' ', |
191 | i, | 190 | i, |
192 | be16_to_cpu(pddcb->retc_16), | 191 | be16_to_cpu(pddcb->retc_16), |
@@ -214,6 +213,7 @@ struct genwqe_ddcb_cmd *ddcb_requ_alloc(void) | |||
214 | void ddcb_requ_free(struct genwqe_ddcb_cmd *cmd) | 213 | void ddcb_requ_free(struct genwqe_ddcb_cmd *cmd) |
215 | { | 214 | { |
216 | struct ddcb_requ *req = container_of(cmd, struct ddcb_requ, cmd); | 215 | struct ddcb_requ *req = container_of(cmd, struct ddcb_requ, cmd); |
216 | |||
217 | kfree(req); | 217 | kfree(req); |
218 | } | 218 | } |
219 | 219 | ||
@@ -306,7 +306,7 @@ static int enqueue_ddcb(struct genwqe_dev *cd, struct ddcb_queue *queue, | |||
306 | 306 | ||
307 | new = (old | DDCB_NEXT_BE32); | 307 | new = (old | DDCB_NEXT_BE32); |
308 | 308 | ||
309 | wmb(); | 309 | wmb(); /* need to ensure write ordering */ |
310 | icrc_hsi_shi = cmpxchg(&prev_ddcb->icrc_hsi_shi_32, old, new); | 310 | icrc_hsi_shi = cmpxchg(&prev_ddcb->icrc_hsi_shi_32, old, new); |
311 | 311 | ||
312 | if (icrc_hsi_shi == old) | 312 | if (icrc_hsi_shi == old) |
@@ -317,7 +317,7 @@ static int enqueue_ddcb(struct genwqe_dev *cd, struct ddcb_queue *queue, | |||
317 | ddcb_mark_tapped(pddcb); | 317 | ddcb_mark_tapped(pddcb); |
318 | num = (u64)ddcb_no << 8; | 318 | num = (u64)ddcb_no << 8; |
319 | 319 | ||
320 | wmb(); | 320 | wmb(); /* need to ensure write ordering */ |
321 | __genwqe_writeq(cd, queue->IO_QUEUE_OFFSET, num); /* start queue */ | 321 | __genwqe_writeq(cd, queue->IO_QUEUE_OFFSET, num); /* start queue */ |
322 | 322 | ||
323 | return RET_DDCB_TAPPED; | 323 | return RET_DDCB_TAPPED; |
@@ -416,9 +416,7 @@ static int genwqe_check_ddcb_queue(struct genwqe_dev *cd, | |||
416 | status = __genwqe_readq(cd, queue->IO_QUEUE_STATUS); | 416 | status = __genwqe_readq(cd, queue->IO_QUEUE_STATUS); |
417 | 417 | ||
418 | dev_err(&pci_dev->dev, | 418 | dev_err(&pci_dev->dev, |
419 | "[%s] SEQN=%04x HSI=%02x RETC=%03x " | 419 | "[%s] SEQN=%04x HSI=%02x RETC=%03x Q_ERRCNTS=%016llx Q_STATUS=%016llx DDCB_DMA_ADDR=%016llx\n", |
420 | " Q_ERRCNTS=%016llx Q_STATUS=%016llx\n" | ||
421 | " DDCB_DMA_ADDR=%016llx\n", | ||
422 | __func__, be16_to_cpu(pddcb->seqnum_16), | 420 | __func__, be16_to_cpu(pddcb->seqnum_16), |
423 | pddcb->hsi, retc_16, errcnts, status, | 421 | pddcb->hsi, retc_16, errcnts, status, |
424 | queue->ddcb_daddr + ddcb_offs); | 422 | queue->ddcb_daddr + ddcb_offs); |
@@ -439,8 +437,7 @@ static int genwqe_check_ddcb_queue(struct genwqe_dev *cd, | |||
439 | vcrc_16 = be16_to_cpu(pddcb->vcrc_16); | 437 | vcrc_16 = be16_to_cpu(pddcb->vcrc_16); |
440 | if (vcrc != vcrc_16) { | 438 | if (vcrc != vcrc_16) { |
441 | printk_ratelimited(KERN_ERR | 439 | printk_ratelimited(KERN_ERR |
442 | "%s %s: err: wrong VCRC pre=%02x vcrc_len=%d " | 440 | "%s %s: err: wrong VCRC pre=%02x vcrc_len=%d bytes vcrc_data=%04x is not vcrc_card=%04x\n", |
443 | "bytes vcrc_data=%04x is not vcrc_card=%04x\n", | ||
444 | GENWQE_DEVNAME, dev_name(&pci_dev->dev), | 441 | GENWQE_DEVNAME, dev_name(&pci_dev->dev), |
445 | pddcb->pre, VCRC_LENGTH(req->cmd.asv_length), | 442 | pddcb->pre, VCRC_LENGTH(req->cmd.asv_length), |
446 | vcrc, vcrc_16); | 443 | vcrc, vcrc_16); |
@@ -717,8 +714,7 @@ go_home: | |||
717 | genwqe_hexdump(pci_dev, pddcb, sizeof(*pddcb)); | 714 | genwqe_hexdump(pci_dev, pddcb, sizeof(*pddcb)); |
718 | 715 | ||
719 | dev_err(&pci_dev->dev, | 716 | dev_err(&pci_dev->dev, |
720 | "[%s] err: DDCB#%d not purged and not completed " | 717 | "[%s] err: DDCB#%d not purged and not completed after %d seconds QSTAT=%016llx!!\n", |
721 | "after %d seconds QSTAT=%016llx!!\n", | ||
722 | __func__, req->num, genwqe_ddcb_software_timeout, | 718 | __func__, req->num, genwqe_ddcb_software_timeout, |
723 | queue_status); | 719 | queue_status); |
724 | 720 | ||
@@ -1344,8 +1340,8 @@ int genwqe_finish_queue(struct genwqe_dev *cd) | |||
1344 | break; | 1340 | break; |
1345 | 1341 | ||
1346 | dev_dbg(&pci_dev->dev, | 1342 | dev_dbg(&pci_dev->dev, |
1347 | " DEBUG [%d/%d] waiting for queue to get empty: " | 1343 | " DEBUG [%d/%d] waiting for queue to get empty: %d requests!\n", |
1348 | "%d requests!\n", i, waitmax, in_flight); | 1344 | i, waitmax, in_flight); |
1349 | 1345 | ||
1350 | /* | 1346 | /* |
1351 | * Severe severe error situation: The card itself has | 1347 | * Severe severe error situation: The card itself has |
diff --git a/drivers/misc/genwqe/card_dev.c b/drivers/misc/genwqe/card_dev.c index 80fdde2873de..59e0081acc8f 100644 --- a/drivers/misc/genwqe/card_dev.c +++ b/drivers/misc/genwqe/card_dev.c | |||
@@ -213,9 +213,9 @@ static void genwqe_remove_mappings(struct genwqe_file *cfile) | |||
213 | * GENWQE_MAPPING_SGL_TEMP should be removed by tidy up code. | 213 | * GENWQE_MAPPING_SGL_TEMP should be removed by tidy up code. |
214 | */ | 214 | */ |
215 | dev_err(&pci_dev->dev, | 215 | dev_err(&pci_dev->dev, |
216 | "[%s] %d. cleanup mapping: u_vaddr=%p " | 216 | "[%s] %d. cleanup mapping: u_vaddr=%p u_kaddr=%016lx dma_addr=%lx\n", |
217 | "u_kaddr=%016lx dma_addr=%lx\n", __func__, i++, | 217 | __func__, i++, dma_map->u_vaddr, |
218 | dma_map->u_vaddr, (unsigned long)dma_map->k_vaddr, | 218 | (unsigned long)dma_map->k_vaddr, |
219 | (unsigned long)dma_map->dma_addr); | 219 | (unsigned long)dma_map->dma_addr); |
220 | 220 | ||
221 | if (dma_map->type == GENWQE_MAPPING_RAW) { | 221 | if (dma_map->type == GENWQE_MAPPING_RAW) { |
@@ -346,6 +346,7 @@ static int genwqe_open(struct inode *inode, struct file *filp) | |||
346 | static int genwqe_fasync(int fd, struct file *filp, int mode) | 346 | static int genwqe_fasync(int fd, struct file *filp, int mode) |
347 | { | 347 | { |
348 | struct genwqe_file *cdev = (struct genwqe_file *)filp->private_data; | 348 | struct genwqe_file *cdev = (struct genwqe_file *)filp->private_data; |
349 | |||
349 | return fasync_helper(fd, filp, mode, &cdev->async_queue); | 350 | return fasync_helper(fd, filp, mode, &cdev->async_queue); |
350 | } | 351 | } |
351 | 352 | ||
diff --git a/drivers/misc/genwqe/card_utils.c b/drivers/misc/genwqe/card_utils.c index 349b342c369b..7cb3b7e41739 100644 --- a/drivers/misc/genwqe/card_utils.c +++ b/drivers/misc/genwqe/card_utils.c | |||
@@ -150,6 +150,7 @@ int genwqe_read_app_id(struct genwqe_dev *cd, char *app_name, int len) | |||
150 | memset(app_name, 0, len); | 150 | memset(app_name, 0, len); |
151 | for (i = 0, j = 0; j < min(len, 4); j++) { | 151 | for (i = 0, j = 0; j < min(len, 4); j++) { |
152 | char ch = (char)((app_id >> (24 - j*8)) & 0xff); | 152 | char ch = (char)((app_id >> (24 - j*8)) & 0xff); |
153 | |||
153 | if (ch == ' ') | 154 | if (ch == ' ') |
154 | continue; | 155 | continue; |
155 | app_name[i++] = isprint(ch) ? ch : 'X'; | 156 | app_name[i++] = isprint(ch) ? ch : 'X'; |
@@ -304,8 +305,7 @@ int genwqe_alloc_sync_sgl(struct genwqe_dev *cd, struct genwqe_sgl *sgl, | |||
304 | sgl->nr_pages = DIV_ROUND_UP(sgl->fpage_offs + user_size, PAGE_SIZE); | 305 | sgl->nr_pages = DIV_ROUND_UP(sgl->fpage_offs + user_size, PAGE_SIZE); |
305 | sgl->lpage_size = (user_size - sgl->fpage_size) % PAGE_SIZE; | 306 | sgl->lpage_size = (user_size - sgl->fpage_size) % PAGE_SIZE; |
306 | 307 | ||
307 | dev_dbg(&pci_dev->dev, "[%s] uaddr=%p usize=%8ld nr_pages=%ld " | 308 | dev_dbg(&pci_dev->dev, "[%s] uaddr=%p usize=%8ld nr_pages=%ld fpage_offs=%lx fpage_size=%ld lpage_size=%ld\n", |
308 | "fpage_offs=%lx fpage_size=%ld lpage_size=%ld\n", | ||
309 | __func__, user_addr, user_size, sgl->nr_pages, | 309 | __func__, user_addr, user_size, sgl->nr_pages, |
310 | sgl->fpage_offs, sgl->fpage_size, sgl->lpage_size); | 310 | sgl->fpage_offs, sgl->fpage_size, sgl->lpage_size); |
311 | 311 | ||
@@ -662,6 +662,7 @@ int genwqe_user_vunmap(struct genwqe_dev *cd, struct dma_mapping *m, | |||
662 | u8 genwqe_card_type(struct genwqe_dev *cd) | 662 | u8 genwqe_card_type(struct genwqe_dev *cd) |
663 | { | 663 | { |
664 | u64 card_type = cd->slu_unitcfg; | 664 | u64 card_type = cd->slu_unitcfg; |
665 | |||
665 | return (u8)((card_type & IO_SLU_UNITCFG_TYPE_MASK) >> 20); | 666 | return (u8)((card_type & IO_SLU_UNITCFG_TYPE_MASK) >> 20); |
666 | } | 667 | } |
667 | 668 | ||