diff options
author | Rasmus Villemoes <linux@rasmusvillemoes.dk> | 2014-12-02 18:10:49 -0500 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2015-02-02 12:57:45 -0500 |
commit | 0c3de38ff3eec506ef08ede32110d1f266366ccd (patch) | |
tree | cd94d017cf33979ccabc0cec01542fe4be50a38a /drivers/scsi/nsp32.c | |
parent | 5af2e38242f87231244393e69beca7284e70056f (diff) |
scsi: remove SPRINTF macro
The macro SPRINTF doesn't save a lot of typing or make the code more
readable, and depending on a specific identifier (m) in the
surrounding scope is generally frowned upon. Nuke it.
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Reviewed-by: Finn Thain <fthain@telegraphics.com.au>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/scsi/nsp32.c')
-rw-r--r-- | drivers/scsi/nsp32.c | 41 |
1 files changed, 19 insertions, 22 deletions
diff --git a/drivers/scsi/nsp32.c b/drivers/scsi/nsp32.c index 90abb03c9074..3e775517628d 100644 --- a/drivers/scsi/nsp32.c +++ b/drivers/scsi/nsp32.c | |||
@@ -1441,8 +1441,6 @@ static irqreturn_t do_nsp32_isr(int irq, void *dev_id) | |||
1441 | return IRQ_RETVAL(handled); | 1441 | return IRQ_RETVAL(handled); |
1442 | } | 1442 | } |
1443 | 1443 | ||
1444 | #undef SPRINTF | ||
1445 | #define SPRINTF(args...) seq_printf(m, ##args) | ||
1446 | 1444 | ||
1447 | static int nsp32_show_info(struct seq_file *m, struct Scsi_Host *host) | 1445 | static int nsp32_show_info(struct seq_file *m, struct Scsi_Host *host) |
1448 | { | 1446 | { |
@@ -1458,64 +1456,63 @@ static int nsp32_show_info(struct seq_file *m, struct Scsi_Host *host) | |||
1458 | data = (nsp32_hw_data *)host->hostdata; | 1456 | data = (nsp32_hw_data *)host->hostdata; |
1459 | base = host->io_port; | 1457 | base = host->io_port; |
1460 | 1458 | ||
1461 | SPRINTF("NinjaSCSI-32 status\n\n"); | 1459 | seq_printf(m, "NinjaSCSI-32 status\n\n"); |
1462 | SPRINTF("Driver version: %s, $Revision: 1.33 $\n", nsp32_release_version); | 1460 | seq_printf(m, "Driver version: %s, $Revision: 1.33 $\n", nsp32_release_version); |
1463 | SPRINTF("SCSI host No.: %d\n", hostno); | 1461 | seq_printf(m, "SCSI host No.: %d\n", hostno); |
1464 | SPRINTF("IRQ: %d\n", host->irq); | 1462 | seq_printf(m, "IRQ: %d\n", host->irq); |
1465 | SPRINTF("IO: 0x%lx-0x%lx\n", host->io_port, host->io_port + host->n_io_port - 1); | 1463 | seq_printf(m, "IO: 0x%lx-0x%lx\n", host->io_port, host->io_port + host->n_io_port - 1); |
1466 | SPRINTF("MMIO(virtual address): 0x%lx-0x%lx\n", host->base, host->base + data->MmioLength - 1); | 1464 | seq_printf(m, "MMIO(virtual address): 0x%lx-0x%lx\n", host->base, host->base + data->MmioLength - 1); |
1467 | SPRINTF("sg_tablesize: %d\n", host->sg_tablesize); | 1465 | seq_printf(m, "sg_tablesize: %d\n", host->sg_tablesize); |
1468 | SPRINTF("Chip revision: 0x%x\n", (nsp32_read2(base, INDEX_REG) >> 8) & 0xff); | 1466 | seq_printf(m, "Chip revision: 0x%x\n", (nsp32_read2(base, INDEX_REG) >> 8) & 0xff); |
1469 | 1467 | ||
1470 | mode_reg = nsp32_index_read1(base, CHIP_MODE); | 1468 | mode_reg = nsp32_index_read1(base, CHIP_MODE); |
1471 | model = data->pci_devid->driver_data; | 1469 | model = data->pci_devid->driver_data; |
1472 | 1470 | ||
1473 | #ifdef CONFIG_PM | 1471 | #ifdef CONFIG_PM |
1474 | SPRINTF("Power Management: %s\n", (mode_reg & OPTF) ? "yes" : "no"); | 1472 | seq_printf(m, "Power Management: %s\n", (mode_reg & OPTF) ? "yes" : "no"); |
1475 | #endif | 1473 | #endif |
1476 | SPRINTF("OEM: %ld, %s\n", (mode_reg & (OEM0|OEM1)), nsp32_model[model]); | 1474 | seq_printf(m, "OEM: %ld, %s\n", (mode_reg & (OEM0|OEM1)), nsp32_model[model]); |
1477 | 1475 | ||
1478 | spin_lock_irqsave(&(data->Lock), flags); | 1476 | spin_lock_irqsave(&(data->Lock), flags); |
1479 | SPRINTF("CurrentSC: 0x%p\n\n", data->CurrentSC); | 1477 | seq_printf(m, "CurrentSC: 0x%p\n\n", data->CurrentSC); |
1480 | spin_unlock_irqrestore(&(data->Lock), flags); | 1478 | spin_unlock_irqrestore(&(data->Lock), flags); |
1481 | 1479 | ||
1482 | 1480 | ||
1483 | SPRINTF("SDTR status\n"); | 1481 | seq_printf(m, "SDTR status\n"); |
1484 | for (id = 0; id < ARRAY_SIZE(data->target); id++) { | 1482 | for (id = 0; id < ARRAY_SIZE(data->target); id++) { |
1485 | 1483 | ||
1486 | SPRINTF("id %d: ", id); | 1484 | seq_printf(m, "id %d: ", id); |
1487 | 1485 | ||
1488 | if (id == host->this_id) { | 1486 | if (id == host->this_id) { |
1489 | SPRINTF("----- NinjaSCSI-32 host adapter\n"); | 1487 | seq_printf(m, "----- NinjaSCSI-32 host adapter\n"); |
1490 | continue; | 1488 | continue; |
1491 | } | 1489 | } |
1492 | 1490 | ||
1493 | if (data->target[id].sync_flag == SDTR_DONE) { | 1491 | if (data->target[id].sync_flag == SDTR_DONE) { |
1494 | if (data->target[id].period == 0 && | 1492 | if (data->target[id].period == 0 && |
1495 | data->target[id].offset == ASYNC_OFFSET ) { | 1493 | data->target[id].offset == ASYNC_OFFSET ) { |
1496 | SPRINTF("async"); | 1494 | seq_printf(m, "async"); |
1497 | } else { | 1495 | } else { |
1498 | SPRINTF(" sync"); | 1496 | seq_printf(m, " sync"); |
1499 | } | 1497 | } |
1500 | } else { | 1498 | } else { |
1501 | SPRINTF(" none"); | 1499 | seq_printf(m, " none"); |
1502 | } | 1500 | } |
1503 | 1501 | ||
1504 | if (data->target[id].period != 0) { | 1502 | if (data->target[id].period != 0) { |
1505 | 1503 | ||
1506 | speed = 1000000 / (data->target[id].period * 4); | 1504 | speed = 1000000 / (data->target[id].period * 4); |
1507 | 1505 | ||
1508 | SPRINTF(" transfer %d.%dMB/s, offset %d", | 1506 | seq_printf(m, " transfer %d.%dMB/s, offset %d", |
1509 | speed / 1000, | 1507 | speed / 1000, |
1510 | speed % 1000, | 1508 | speed % 1000, |
1511 | data->target[id].offset | 1509 | data->target[id].offset |
1512 | ); | 1510 | ); |
1513 | } | 1511 | } |
1514 | SPRINTF("\n"); | 1512 | seq_printf(m, "\n"); |
1515 | } | 1513 | } |
1516 | return 0; | 1514 | return 0; |
1517 | } | 1515 | } |
1518 | #undef SPRINTF | ||
1519 | 1516 | ||
1520 | 1517 | ||
1521 | 1518 | ||