public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RESEND PATCH] scsi: aha1740: Use str_enabled_disabled() helper
@ 2025-02-09  8:19 Thorsten Blum
  2025-02-13  3:31 ` Martin K. Petersen
  0 siblings, 1 reply; 2+ messages in thread
From: Thorsten Blum @ 2025-02-09  8:19 UTC (permalink / raw)
  To: James E.J. Bottomley, Martin K. Petersen
  Cc: Thorsten Blum, linux-scsi, linux-kernel

Remove hard-coded strings by using the str_enabled_disabled() helper
function.

Use pr_info() instead of printk(KERN_INFO) to silence multiple
checkpatch warnings.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
 drivers/scsi/aha1740.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/scsi/aha1740.c b/drivers/scsi/aha1740.c
index be7ebbbb9ba8..c21286eaa8a1 100644
--- a/drivers/scsi/aha1740.c
+++ b/drivers/scsi/aha1740.c
@@ -114,9 +114,9 @@ static int aha1740_show_info(struct seq_file *m, struct Scsi_Host *shpnt)
 {
 	struct aha1740_hostdata *host = HOSTDATA(shpnt);
 	seq_printf(m, "aha174x at IO:%lx, IRQ %d, SLOT %d.\n"
-		      "Extended translation %sabled.\n",
+		      "Extended translation %s.\n",
 		      shpnt->io_port, shpnt->irq, host->edev->slot,
-		      host->translation ? "en" : "dis");
+		      str_enabled_disabled(host->translation));
 	return 0;
 }
 
@@ -578,10 +578,10 @@ static int aha1740_probe (struct device *dev)
 		outb(G2CNTRL_HRST, G2CNTRL(slotbase));
 		outb(0, G2CNTRL(slotbase));
 	}
-	printk(KERN_INFO "Configuring slot %d at IO:%x, IRQ %u (%s)\n",
-	       edev->slot, slotbase, irq_level, irq_type ? "edge" : "level");
-	printk(KERN_INFO "aha174x: Extended translation %sabled.\n",
-	       translation ? "en" : "dis");
+	pr_info("Configuring slot %d at IO:%x, IRQ %u (%s)\n",
+		edev->slot, slotbase, irq_level, irq_type ? "edge" : "level");
+	pr_info("aha174x: Extended translation %s.\n",
+		str_enabled_disabled(translation));
 	shpnt = scsi_host_alloc(&aha1740_template,
 			      sizeof(struct aha1740_hostdata));
 	if(shpnt == NULL)
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [RESEND PATCH] scsi: aha1740: Use str_enabled_disabled() helper
  2025-02-09  8:19 [RESEND PATCH] scsi: aha1740: Use str_enabled_disabled() helper Thorsten Blum
@ 2025-02-13  3:31 ` Martin K. Petersen
  0 siblings, 0 replies; 2+ messages in thread
From: Martin K. Petersen @ 2025-02-13  3:31 UTC (permalink / raw)
  To: Thorsten Blum
  Cc: James E.J. Bottomley, Martin K. Petersen, linux-scsi,
	linux-kernel


Hi Thorsten!

> Remove hard-coded strings by using the str_enabled_disabled() helper
> function.

This is a very old driver and I'm not too inclined to make cosmetic
changes to it. I'm also not entirely sold on the idea that the helper
makes things more readable. I know what a ternary does, the helper I
have to go look up.

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-02-13  3:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-09  8:19 [RESEND PATCH] scsi: aha1740: Use str_enabled_disabled() helper Thorsten Blum
2025-02-13  3:31 ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox