aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/dc395x.c
diff options
context:
space:
mode:
authorRasmus Villemoes <linux@rasmusvillemoes.dk>2014-12-02 18:10:49 -0500
committerJames Bottomley <JBottomley@Parallels.com>2015-02-02 12:57:45 -0500
commit0c3de38ff3eec506ef08ede32110d1f266366ccd (patch)
treecd94d017cf33979ccabc0cec01542fe4be50a38a /drivers/scsi/dc395x.c
parent5af2e38242f87231244393e69beca7284e70056f (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/dc395x.c')
-rw-r--r--drivers/scsi/dc395x.c78
1 files changed, 36 insertions, 42 deletions
diff --git a/drivers/scsi/dc395x.c b/drivers/scsi/dc395x.c
index 0c6be0a17f53..0a1ed50ff8bb 100644
--- a/drivers/scsi/dc395x.c
+++ b/drivers/scsi/dc395x.c
@@ -4610,13 +4610,10 @@ static void adapter_uninit(struct AdapterCtlBlk *acb)
4610} 4610}
4611 4611
4612 4612
4613#undef SPRINTF
4614#define SPRINTF(args...) seq_printf(m,##args)
4615
4616#undef YESNO 4613#undef YESNO
4617#define YESNO(YN) \ 4614#define YESNO(YN) \
4618 if (YN) SPRINTF(" Yes ");\ 4615 if (YN) seq_printf(m, " Yes ");\
4619 else SPRINTF(" No ") 4616 else seq_printf(m, " No ")
4620 4617
4621static int dc395x_show_info(struct seq_file *m, struct Scsi_Host *host) 4618static int dc395x_show_info(struct seq_file *m, struct Scsi_Host *host)
4622{ 4619{
@@ -4626,47 +4623,44 @@ static int dc395x_show_info(struct seq_file *m, struct Scsi_Host *host)
4626 unsigned long flags; 4623 unsigned long flags;
4627 int dev; 4624 int dev;
4628 4625
4629 SPRINTF(DC395X_BANNER " PCI SCSI Host Adapter\n"); 4626 seq_printf(m, DC395X_BANNER " PCI SCSI Host Adapter\n");
4630 SPRINTF(" Driver Version " DC395X_VERSION "\n"); 4627 seq_printf(m, " Driver Version " DC395X_VERSION "\n");
4631 4628
4632 DC395x_LOCK_IO(acb->scsi_host, flags); 4629 DC395x_LOCK_IO(acb->scsi_host, flags);
4633 4630
4634 SPRINTF("SCSI Host Nr %i, ", host->host_no); 4631 seq_printf(m, "SCSI Host Nr %i, ", host->host_no);
4635 SPRINTF("DC395U/UW/F DC315/U %s\n", 4632 seq_printf(m, "DC395U/UW/F DC315/U %s\n",
4636 (acb->config & HCC_WIDE_CARD) ? "Wide" : ""); 4633 (acb->config & HCC_WIDE_CARD) ? "Wide" : "");
4637 SPRINTF("io_port_base 0x%04lx, ", acb->io_port_base); 4634 seq_printf(m, "io_port_base 0x%04lx, ", acb->io_port_base);
4638 SPRINTF("irq_level 0x%04x, ", acb->irq_level); 4635 seq_printf(m, "irq_level 0x%04x, ", acb->irq_level);
4639 SPRINTF(" SelTimeout %ims\n", (1638 * acb->sel_timeout) / 1000); 4636 seq_printf(m, " SelTimeout %ims\n", (1638 * acb->sel_timeout) / 1000);
4640 4637
4641 SPRINTF("MaxID %i, MaxLUN %llu, ", host->max_id, host->max_lun); 4638 seq_printf(m, "MaxID %i, MaxLUN %llu, ", host->max_id, host->max_lun);
4642 SPRINTF("AdapterID %i\n", host->this_id); 4639 seq_printf(m, "AdapterID %i\n", host->this_id);
4643 4640
4644 SPRINTF("tag_max_num %i", acb->tag_max_num); 4641 seq_printf(m, "tag_max_num %i", acb->tag_max_num);
4645 /*SPRINTF(", DMA_Status %i\n", DC395x_read8(acb, TRM_S1040_DMA_STATUS)); */ 4642 /*seq_printf(m, ", DMA_Status %i\n", DC395x_read8(acb, TRM_S1040_DMA_STATUS)); */
4646 SPRINTF(", FilterCfg 0x%02x", 4643 seq_printf(m, ", FilterCfg 0x%02x",
4647 DC395x_read8(acb, TRM_S1040_SCSI_CONFIG1)); 4644 DC395x_read8(acb, TRM_S1040_SCSI_CONFIG1));
4648 SPRINTF(", DelayReset %is\n", acb->eeprom.delay_time); 4645 seq_printf(m, ", DelayReset %is\n", acb->eeprom.delay_time);
4649 /*SPRINTF("\n"); */ 4646 /*seq_printf(m, "\n"); */
4650 4647
4651 SPRINTF("Nr of DCBs: %i\n", list_size(&acb->dcb_list)); 4648 seq_printf(m, "Nr of DCBs: %i\n", list_size(&acb->dcb_list));
4652 SPRINTF 4649 seq_printf(m, "Map of attached LUNs: %02x %02x %02x %02x %02x %02x %02x %02x\n",
4653 ("Map of attached LUNs: %02x %02x %02x %02x %02x %02x %02x %02x\n",
4654 acb->dcb_map[0], acb->dcb_map[1], acb->dcb_map[2], 4650 acb->dcb_map[0], acb->dcb_map[1], acb->dcb_map[2],
4655 acb->dcb_map[3], acb->dcb_map[4], acb->dcb_map[5], 4651 acb->dcb_map[3], acb->dcb_map[4], acb->dcb_map[5],
4656 acb->dcb_map[6], acb->dcb_map[7]); 4652 acb->dcb_map[6], acb->dcb_map[7]);
4657 SPRINTF 4653 seq_printf(m, " %02x %02x %02x %02x %02x %02x %02x %02x\n",
4658 (" %02x %02x %02x %02x %02x %02x %02x %02x\n",
4659 acb->dcb_map[8], acb->dcb_map[9], acb->dcb_map[10], 4654 acb->dcb_map[8], acb->dcb_map[9], acb->dcb_map[10],
4660 acb->dcb_map[11], acb->dcb_map[12], acb->dcb_map[13], 4655 acb->dcb_map[11], acb->dcb_map[12], acb->dcb_map[13],
4661 acb->dcb_map[14], acb->dcb_map[15]); 4656 acb->dcb_map[14], acb->dcb_map[15]);
4662 4657
4663 SPRINTF 4658 seq_printf(m, "Un ID LUN Prty Sync Wide DsCn SndS TagQ nego_period SyncFreq SyncOffs MaxCmd\n");
4664 ("Un ID LUN Prty Sync Wide DsCn SndS TagQ nego_period SyncFreq SyncOffs MaxCmd\n");
4665 4659
4666 dev = 0; 4660 dev = 0;
4667 list_for_each_entry(dcb, &acb->dcb_list, list) { 4661 list_for_each_entry(dcb, &acb->dcb_list, list) {
4668 int nego_period; 4662 int nego_period;
4669 SPRINTF("%02i %02i %02i ", dev, dcb->target_id, 4663 seq_printf(m, "%02i %02i %02i ", dev, dcb->target_id,
4670 dcb->target_lun); 4664 dcb->target_lun);
4671 YESNO(dcb->dev_mode & NTC_DO_PARITY_CHK); 4665 YESNO(dcb->dev_mode & NTC_DO_PARITY_CHK);
4672 YESNO(dcb->sync_offset); 4666 YESNO(dcb->sync_offset);
@@ -4676,53 +4670,53 @@ static int dc395x_show_info(struct seq_file *m, struct Scsi_Host *host)
4676 YESNO(dcb->sync_mode & EN_TAG_QUEUEING); 4670 YESNO(dcb->sync_mode & EN_TAG_QUEUEING);
4677 nego_period = clock_period[dcb->sync_period & 0x07] << 2; 4671 nego_period = clock_period[dcb->sync_period & 0x07] << 2;
4678 if (dcb->sync_offset) 4672 if (dcb->sync_offset)
4679 SPRINTF(" %03i ns ", nego_period); 4673 seq_printf(m, " %03i ns ", nego_period);
4680 else 4674 else
4681 SPRINTF(" (%03i ns)", (dcb->min_nego_period << 2)); 4675 seq_printf(m, " (%03i ns)", (dcb->min_nego_period << 2));
4682 4676
4683 if (dcb->sync_offset & 0x0f) { 4677 if (dcb->sync_offset & 0x0f) {
4684 spd = 1000 / (nego_period); 4678 spd = 1000 / (nego_period);
4685 spd1 = 1000 % (nego_period); 4679 spd1 = 1000 % (nego_period);
4686 spd1 = (spd1 * 10 + nego_period / 2) / (nego_period); 4680 spd1 = (spd1 * 10 + nego_period / 2) / (nego_period);
4687 SPRINTF(" %2i.%1i M %02i ", spd, spd1, 4681 seq_printf(m, " %2i.%1i M %02i ", spd, spd1,
4688 (dcb->sync_offset & 0x0f)); 4682 (dcb->sync_offset & 0x0f));
4689 } else 4683 } else
4690 SPRINTF(" "); 4684 seq_printf(m, " ");
4691 4685
4692 /* Add more info ... */ 4686 /* Add more info ... */
4693 SPRINTF(" %02i\n", dcb->max_command); 4687 seq_printf(m, " %02i\n", dcb->max_command);
4694 dev++; 4688 dev++;
4695 } 4689 }
4696 4690
4697 if (timer_pending(&acb->waiting_timer)) 4691 if (timer_pending(&acb->waiting_timer))
4698 SPRINTF("Waiting queue timer running\n"); 4692 seq_printf(m, "Waiting queue timer running\n");
4699 else 4693 else
4700 SPRINTF("\n"); 4694 seq_printf(m, "\n");
4701 4695
4702 list_for_each_entry(dcb, &acb->dcb_list, list) { 4696 list_for_each_entry(dcb, &acb->dcb_list, list) {
4703 struct ScsiReqBlk *srb; 4697 struct ScsiReqBlk *srb;
4704 if (!list_empty(&dcb->srb_waiting_list)) 4698 if (!list_empty(&dcb->srb_waiting_list))
4705 SPRINTF("DCB (%02i-%i): Waiting: %i:", 4699 seq_printf(m, "DCB (%02i-%i): Waiting: %i:",
4706 dcb->target_id, dcb->target_lun, 4700 dcb->target_id, dcb->target_lun,
4707 list_size(&dcb->srb_waiting_list)); 4701 list_size(&dcb->srb_waiting_list));
4708 list_for_each_entry(srb, &dcb->srb_waiting_list, list) 4702 list_for_each_entry(srb, &dcb->srb_waiting_list, list)
4709 SPRINTF(" %p", srb->cmd); 4703 seq_printf(m, " %p", srb->cmd);
4710 if (!list_empty(&dcb->srb_going_list)) 4704 if (!list_empty(&dcb->srb_going_list))
4711 SPRINTF("\nDCB (%02i-%i): Going : %i:", 4705 seq_printf(m, "\nDCB (%02i-%i): Going : %i:",
4712 dcb->target_id, dcb->target_lun, 4706 dcb->target_id, dcb->target_lun,
4713 list_size(&dcb->srb_going_list)); 4707 list_size(&dcb->srb_going_list));
4714 list_for_each_entry(srb, &dcb->srb_going_list, list) 4708 list_for_each_entry(srb, &dcb->srb_going_list, list)
4715 SPRINTF(" %p", srb->cmd); 4709 seq_printf(m, " %p", srb->cmd);
4716 if (!list_empty(&dcb->srb_waiting_list) || !list_empty(&dcb->srb_going_list)) 4710 if (!list_empty(&dcb->srb_waiting_list) || !list_empty(&dcb->srb_going_list))
4717 SPRINTF("\n"); 4711 seq_printf(m, "\n");
4718 } 4712 }
4719 4713
4720 if (debug_enabled(DBG_1)) { 4714 if (debug_enabled(DBG_1)) {
4721 SPRINTF("DCB list for ACB %p:\n", acb); 4715 seq_printf(m, "DCB list for ACB %p:\n", acb);
4722 list_for_each_entry(dcb, &acb->dcb_list, list) { 4716 list_for_each_entry(dcb, &acb->dcb_list, list) {
4723 SPRINTF("%p -> ", dcb); 4717 seq_printf(m, "%p -> ", dcb);
4724 } 4718 }
4725 SPRINTF("END\n"); 4719 seq_printf(m, "END\n");
4726 } 4720 }
4727 4721
4728 DC395x_UNLOCK_IO(acb->scsi_host, flags); 4722 DC395x_UNLOCK_IO(acb->scsi_host, flags);