Skip to contentSkip to conversation

libata: get rid of (almost) all printk() calls

PATCH In review Sergey Shtylyov 2 participants 14 messages Nov 8, 2024 – Nov 11, 2024 libata

lore
Share & tools
lore
#0 lore raw

cover libata: get rid of (almost) all printk() calls

Here are 6 patches against the for-next branch of the LibATA Group's repo.

Hannes Reinecke's large patch series [1] claimed to have moved libata to the structured logging, i.e. using dev_*() calls; however, some printk() calls were left as is. Convert them to dev_*() calls where possible, otherwise convert to pr_*() calls -- this pleases checkpatch.pl at last.

[1] https://lore.kernel.org/all/[email protected]/

Sergey Shtylyov (6):
ata: acard-ahci: use dev_info() instead of printk(KERN_INFO)
ata: ahci: use dev_info() instead of printk(KERN_INFO)
ata: libata-core: use pr_warn() instead of printk(KERN_WARNING)
ata: pata_cs5530: use pr_*() instead of printk(KERN_*)
ata: pata_legacy: use pr_*() instead of printk(KERN_*)
ata: pata_optidma: use dev_warn() instead of printk(KERN_WARNING)

 drivers/ata/acard-ahci.c   |  2 +-
 drivers/ata/ahci.c         |  5 ++---
 drivers/ata/libata-core.c  |  8 +++-----
 drivers/ata/pata_cs5530.c  |  6 +++---
 drivers/ata/pata_legacy.c  | 11 ++++-------
 drivers/ata/pata_optidma.c |  2 +-
 6 files changed, 14 insertions(+), 20 deletions(-)
Signature · 1 line
2.47.0
#1 lore raw

PATCH 1/6 ata: acard-ahci: use dev_info() instead of, printk(KERN_INFO)

The ACard AHCI PCI device driver still calls printk(KERN_INFO, ...) in its probe() method -- convert it to calling dev_info(), also somewhat rewording the message itself...

This helpfully fixes the following complaint from scripts/checkpatch.pl:

WARNING: Prefer [subsystem eg: netdev]_info([subsystem]dev, ... then dev_info(dev, ... then pr_info(... to printk(KERN_INFO ...

---
 drivers/ata/acard-ahci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/ata/acard-ahci.c +1 -1
index 547f56341705..0e16e64d1c5d 100644
@@ -415,7 +415,7 @@ static int acard_ahci_init_one(struct pci_dev *pdev, const struct pci_device_id
 	if (!(hpriv->cap & HOST_CAP_SSS) || ahci_ignore_sss)
 		host->flags |= ATA_HOST_PARALLEL_SCAN;
 	else
-		printk(KERN_INFO "ahci: SSS flag set, parallel bus scan disabled\n");
+		dev_info(&pdev->dev, "AHCI SSS flag set, parallel bus scan disabled\n");
 
 	for (i = 0; i < host->n_ports; i++) {
 		struct ata_port *ap = host->ports[i];
Signature · 1 line
2.47.0
#2 lore raw

Re: [PATCH 1/6] ata: acard-ahci: use dev_info() instead of, printk(KERN_INFO)

Hello!

Oops, stray char after "of" in the subject... :-/

MBR, Sergey

Reviewed-by on v1 1/6
#3 lore raw

Re: [PATCH 1/6] ata: acard-ahci: use dev_info() instead of, printk(KERN_INFO)

In reply to Sergey Shtylyov
Quoted 20 lines · Sergey Shtylyov

The ACard AHCI PCI device driver still calls printk(KERN_INFO, ...) in its probe() method -- convert it to calling dev_info(), also somewhat rewording the message itself...

This helpfully fixes the following complaint from scripts/checkpatch.pl:

WARNING: Prefer [subsystem eg: netdev]_info([subsystem]dev, ... then dev_info(dev, ... then pr_info(... to printk(KERN_INFO ...

---
  drivers/ata/acard-ahci.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/ata/acard-ahci.c +0 -0
index 547f56341705..0e16e64d1c5d 100644

drivers/ata/acard-ahci.c static int acard_ahci_init_one(struct pci_dev *pdev, const struct pci_device_id · line 421

Quoted 8 lines
drivers/ata/acard-ahci.c +1 -1
@@ -415,7 +415,7 @@ static int acard_ahci_init_one(struct pci_dev *pdev, const struct pci_device_id
  	if (!(hpriv->cap & HOST_CAP_SSS) || ahci_ignore_sss)
  		host->flags |= ATA_HOST_PARALLEL_SCAN;
  	else
-		printk(KERN_INFO "ahci: SSS flag set, parallel bus scan disabled\n");
+		dev_info(&pdev->dev, "AHCI SSS flag set, parallel bus scan disabled\n");
 
  	for (i = 0; i < host->n_ports; i++) {
  		struct ata_port *ap = host->ports[i];

Cheers,

Hannes

Signature · 4 lines
Dr. Hannes Reinecke                  Kernel Storage Architect
[email protected]                                +49 911 74053 688
SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg
HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich
#4 lore raw

PATCH 2/6 ata: ahci: use dev_info() instead of printk(KERN_INFO)

In reply to Sergey Shtylyov

The AHCI PCI device driver still calls printk(KERN_INFO, ...) in ahci_mcp89_apple_enable() and ahci_init_msi() -- convert them to calling dev_info(), somewhat rewording the messages themselves...

This helpfully fixes the following complaint from scripts/checkpatch.pl:

WARNING: Prefer [subsystem eg: netdev]_info([subsystem]dev, ... then dev_info(dev, ... then pr_info(... to printk(KERN_INFO ...

---
 drivers/ata/ahci.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/ata/ahci.c +2 -3
index 2d3d3d67b4d9..32c79b41ddea 100644
@@ -1141,7 +1141,7 @@ static void ahci_mcp89_apple_enable(struct pci_dev *pdev)
 {
 	u32 val;
 
-	printk(KERN_INFO "ahci: enabling MCP89 AHCI mode\n");
+	dev_info(&pdev->dev, "enabling MCP89 AHCI mode\n");
 
 	pci_read_config_dword(pdev, 0xf8, &val);
 	val |= 1 << 0x1b;
@@ -1692,8 +1692,7 @@ static int ahci_init_msi(struct pci_dev *pdev, unsigned int n_ports,
 			 * Fallback to single MSI mode if the controller
 			 * enforced MRSM mode.
 			 */
-			printk(KERN_INFO
-				"ahci: MRSM is on, fallback to single MSI\n");
+			dev_info(&pdev->dev, "AHCI MRSM is on, fallback to single MSI\n");
 			pci_free_irq_vectors(pdev);
 		}
 	}
Signature · 1 line
2.47.0
Reviewed-by on v1 2/6
#5 lore raw

Re: [PATCH 2/6] ata: ahci: use dev_info() instead of printk(KERN_INFO)

Quoted 29 lines · Sergey Shtylyov

The AHCI PCI device driver still calls printk(KERN_INFO, ...) in ahci_mcp89_apple_enable() and ahci_init_msi() -- convert them to calling dev_info(), somewhat rewording the messages themselves...

This helpfully fixes the following complaint from scripts/checkpatch.pl:

WARNING: Prefer [subsystem eg: netdev]_info([subsystem]dev, ... then dev_info(dev, ... then pr_info(... to printk(KERN_INFO ...

---
  drivers/ata/ahci.c | 5 ++---
  1 file changed, 2 insertions(+), 3 deletions(-)
drivers/ata/ahci.c +1 -1
index 2d3d3d67b4d9..32c79b41ddea 100644
@@ -1141,7 +1141,7 @@ static void ahci_mcp89_apple_enable(struct pci_dev *pdev)
  {
  	u32 val;
 
-	printk(KERN_INFO "ahci: enabling MCP89 AHCI mode\n");
+	dev_info(&pdev->dev, "enabling MCP89 AHCI mode\n");
 
  	pci_read_config_dword(pdev, 0xf8, &val);
  	val |= 1 << 0x1b;

drivers/ata/ahci.c static int ahci_init_msi(struct pci_dev *pdev, unsigned int n_ports, · line 1698

Quoted 9 lines
drivers/ata/ahci.c +1 -2
@@ -1692,8 +1692,7 @@ static int ahci_init_msi(struct pci_dev *pdev, unsigned int n_ports,
  			 * Fallback to single MSI mode if the controller
  			 * enforced MRSM mode.
  			 */
-			printk(KERN_INFO
-				"ahci: MRSM is on, fallback to single MSI\n");
+			dev_info(&pdev->dev, "AHCI MRSM is on, fallback to single MSI\n");
  			pci_free_irq_vectors(pdev);
  		}
  	}

Cheers,

Hannes

Signature · 4 lines
Dr. Hannes Reinecke                  Kernel Storage Architect
[email protected]                                +49 911 74053 688
SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg
HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich
#6 lore raw

PATCH 3/6 ata: libata-core: use pr_warn() instead of printk(KERN_WARNING)

In reply to Sergey Shtylyov

ata_parse_force_param() still calls printk(KERN_WARNING, ...) -- convert it to calling pr_warn(), also joining the broken up message strings...

This helpfully fixes the following complaints from scripts/checkpatch.pl:

WARNING: Prefer [subsystem eg: netdev]_warn([subsystem]dev, ... then dev_warn(dev, ... then pr_warn(... to printk(KERN_WARNING ...

WARNING: quoted string split across lines

---
 drivers/ata/libata-core.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/ata/libata-core.c +3 -5
index cdb20a700b55..47f652981043 100644
@@ -6443,8 +6443,7 @@ static void __init ata_parse_force_param(void)
 
 	ata_force_tbl = kcalloc(size, sizeof(ata_force_tbl[0]), GFP_KERNEL);
 	if (!ata_force_tbl) {
-		printk(KERN_WARNING "ata: failed to extend force table, "
-		       "libata.force ignored\n");
+		pr_warn("ata: failed to extend force table, libata.force ignored\n");
 		return;
 	}
 
@@ -6455,9 +6454,8 @@ static void __init ata_parse_force_param(void)
 
 		next = cur;
 		if (ata_parse_force_one(&next, &te, &reason)) {
-			printk(KERN_WARNING "ata: failed to parse force "
-			       "parameter \"%s\" (%s)\n",
-			       cur, reason);
+			pr_warn("ata: failed to parse force parameter \"%s\" (%s)\n",
+				cur, reason);
 			continue;
 		}
 
Signature · 1 line
2.47.0
Reviewed-by on v1 3/6
#7 lore raw

Re: [PATCH 3/6] ata: libata-core: use pr_warn() instead of printk(KERN_WARNING)

Quoted 32 lines · Sergey Shtylyov

ata_parse_force_param() still calls printk(KERN_WARNING, ...) -- convert it to calling pr_warn(), also joining the broken up message strings...

This helpfully fixes the following complaints from scripts/checkpatch.pl:

WARNING: Prefer [subsystem eg: netdev]_warn([subsystem]dev, ... then dev_warn(dev, ... then pr_warn(... to printk(KERN_WARNING ...

WARNING: quoted string split across lines

---
  drivers/ata/libata-core.c | 8 +++-----
  1 file changed, 3 insertions(+), 5 deletions(-)
drivers/ata/libata-core.c +1 -2
index cdb20a700b55..47f652981043 100644
@@ -6443,8 +6443,7 @@ static void __init ata_parse_force_param(void)
 
  	ata_force_tbl = kcalloc(size, sizeof(ata_force_tbl[0]), GFP_KERNEL);
  	if (!ata_force_tbl) {
-		printk(KERN_WARNING "ata: failed to extend force table, "
-		       "libata.force ignored\n");
+		pr_warn("ata: failed to extend force table, libata.force ignored\n");
  		return;
  	}
 
@@ -6455,9 +6454,8 @@ static void __init ata_parse_force_param(void)
 

drivers/ata/libata-core.c static void __init ata_parse_force_param(void) · line 6461

Quoted 10 lines
drivers/ata/libata-core.c +2 -3
  		next = cur;
  		if (ata_parse_force_one(&next, &te, &reason)) {
-			printk(KERN_WARNING "ata: failed to parse force "
-			       "parameter \"%s\" (%s)\n",
-			       cur, reason);
+			pr_warn("ata: failed to parse force parameter \"%s\" (%s)\n",
+				cur, reason);
  			continue;
  		}
 

Cheers,

Hannes

Signature · 4 lines
Dr. Hannes Reinecke                  Kernel Storage Architect
[email protected]                                +49 911 74053 688
SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg
HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich
#8 lore raw

PATCH 4/6 ata: pata_cs5530: use pr_*() instead of printk(KERN_*)

In reply to Sergey Shtylyov

The CS5530 PCI device driver still calls printk(KERN_INFO, ...) in cs5530_is_palmax() and printk(KERN_ERR, ...) in cs5530_init_chip() -- convert them to calling pr_info() and pr_err() respectively...

This helpfully fixes the following complaints from scripts/checkpatch.pl:

WARNING: Prefer [subsystem eg: netdev]_info([subsystem]dev, ... then dev_info(dev, ... then pr_info(... to printk(KERN_INFO ...

WARNING: Prefer [subsystem eg: netdev]_err([subsystem]dev, ... then dev_err(dev, ... then pr_err(... to printk(KERN_ERR ...

---
 drivers/ata/pata_cs5530.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/ata/pata_cs5530.c +3 -3
index 1e67b0f8db43..4ff98c4722e9 100644
@@ -177,7 +177,7 @@ static const struct dmi_system_id palmax_dmi_table[] = {
 static int cs5530_is_palmax(void)
 {
 	if (dmi_check_system(palmax_dmi_table)) {
-		printk(KERN_INFO "Palmax PD1100: Disabling DMA on docking port.\n");
+		pr_info("Palmax PD1100: Disabling DMA on docking port.\n");
 		return 1;
 	}
 	return 0;
@@ -206,11 +206,11 @@ static int cs5530_init_chip(void)
 		}
 	}
 	if (!master_0) {
-		printk(KERN_ERR DRV_NAME ": unable to locate PCI MASTER function\n");
+		pr_err(DRV_NAME ": unable to locate PCI MASTER function\n");
 		goto fail_put;
 	}
 	if (!cs5530_0) {
-		printk(KERN_ERR DRV_NAME ": unable to locate CS5530 LEGACY function\n");
+		pr_err(DRV_NAME ": unable to locate CS5530 LEGACY function\n");
 		goto fail_put;
 	}
 
Signature · 1 line
2.47.0
Reviewed-by on v1 4/6
#9 lore raw

Re: [PATCH 4/6] ata: pata_cs5530: use pr_*() instead of printk(KERN_*)

Quoted 35 lines · Sergey Shtylyov

The CS5530 PCI device driver still calls printk(KERN_INFO, ...) in cs5530_is_palmax() and printk(KERN_ERR, ...) in cs5530_init_chip() -- convert them to calling pr_info() and pr_err() respectively...

This helpfully fixes the following complaints from scripts/checkpatch.pl:

WARNING: Prefer [subsystem eg: netdev]_info([subsystem]dev, ... then dev_info(dev, ... then pr_info(... to printk(KERN_INFO ...

WARNING: Prefer [subsystem eg: netdev]_err([subsystem]dev, ... then dev_err(dev, ... then pr_err(... to printk(KERN_ERR ...

---
  drivers/ata/pata_cs5530.c | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)
drivers/ata/pata_cs5530.c +1 -1
index 1e67b0f8db43..4ff98c4722e9 100644
@@ -177,7 +177,7 @@ static const struct dmi_system_id palmax_dmi_table[] = {
  static int cs5530_is_palmax(void)
  {
  	if (dmi_check_system(palmax_dmi_table)) {
-		printk(KERN_INFO "Palmax PD1100: Disabling DMA on docking port.\n");
+		pr_info("Palmax PD1100: Disabling DMA on docking port.\n");
  		return 1;
  	}
  	return 0;
@@ -206,11 +206,11 @@ static int cs5530_init_chip(void)
  		}
  	}
  	if (!master_0) {

drivers/ata/pata_cs5530.c static int cs5530_init_chip(void) · line 216

Quoted 10 lines
drivers/ata/pata_cs5530.c +2 -2
-		printk(KERN_ERR DRV_NAME ": unable to locate PCI MASTER function\n");
+		pr_err(DRV_NAME ": unable to locate PCI MASTER function\n");
  		goto fail_put;
  	}
  	if (!cs5530_0) {
-		printk(KERN_ERR DRV_NAME ": unable to locate CS5530 LEGACY function\n");
+		pr_err(DRV_NAME ": unable to locate CS5530 LEGACY function\n");
  		goto fail_put;
  	}
 

Cheers,

Hannes

Signature · 4 lines
Dr. Hannes Reinecke                  Kernel Storage Architect
[email protected]                                +49 911 74053 688
SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg
HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich
#10 lore raw

PATCH 5/6 ata: pata_legacy: use pr_*() instead of printk(KERN_*)

In reply to Sergey Shtylyov

The PATA legacy device driver still calls printk(KERN_ERR, ...) in legacy_probe_add() and printk(KERN_INFO, ...) in probe_chip_type() and probe_opti_vlb() -- convert them to calling pr_err() and pr_info() respectively, also joining the broken up message strings...

This helpfully fixes the following complaints from scripts/checkpatch.pl:

WARNING: Prefer [subsystem eg: netdev]_err([subsystem]dev, ... then dev_err(dev, ... then pr_err(... to printk(KERN_ERR ...

WARNING: Prefer [subsystem eg: netdev]_info([subsystem]dev, ... then dev_info(dev, ... then pr_info(... to printk(KERN_INFO ...

WARNING: quoted string split across lines

---
 drivers/ata/pata_legacy.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)
drivers/ata/pata_legacy.c +4 -7
index e7ac142c2423..9c6918e48448 100644
@@ -209,7 +209,7 @@ static int legacy_probe_add(unsigned long port, unsigned int irq,
 		lp++;
 	}
 	if (free == NULL) {
-		printk(KERN_ERR "pata_legacy: Too many interfaces.\n");
+		pr_err("pata_legacy: Too many interfaces.\n");
 		return -1;
 	}
 	/* Fill in the entry for later probing */
@@ -927,8 +927,7 @@ static __init int probe_chip_type(struct legacy_probe *probe)
 
 		if ((inb(0x1F2) & 0x80) == 0) {
 			/* PDC20230c or 20630 ? */
-			printk(KERN_INFO  "PDC20230-C/20630 VLB ATA controller"
-							" detected.\n");
+			pr_info("PDC20230-C/20630 VLB ATA controller detected.\n");
 			udelay(100);
 			inb(0x1F5);
 			local_irq_restore(flags);
@@ -938,8 +937,7 @@ static __init int probe_chip_type(struct legacy_probe *probe)
 			inb(0x1F2);
 			inb(0x1F2);
 			if (inb(0x1F2) == 0x00)
-				printk(KERN_INFO "PDC20230-B VLB ATA "
-						     "controller detected.\n");
+				pr_info("PDC20230-B VLB ATA controller detected.\n");
 			local_irq_restore(flags);
 			return BIOS;
 		}
@@ -1096,8 +1094,7 @@ static __init void probe_opti_vlb(void)
 	u8 ctrl = (opti_syscfg(0x30) & 0xC0) >> 6;
 
 	opti82c46x = 3;	/* Assume master and slave first */
-	printk(KERN_INFO DRV_NAME ": Opti 82C46%s chipset support.\n",
-								optis[ctrl]);
+	pr_info(DRV_NAME ": Opti 82C46%s chipset support.\n", optis[ctrl]);
 	if (ctrl == 3)
 		chans = (opti_syscfg(0x3F) & 0x20) ? 2 : 1;
 	ctrl = opti_syscfg(0xAC);
Signature · 1 line
2.47.0
Reviewed-by on v1 5/6
#11 lore raw

Re: [PATCH 5/6] ata: pata_legacy: use pr_*() instead of printk(KERN_*)

Quoted 54 lines · Sergey Shtylyov

The PATA legacy device driver still calls printk(KERN_ERR, ...) in legacy_probe_add() and printk(KERN_INFO, ...) in probe_chip_type() and probe_opti_vlb() -- convert them to calling pr_err() and pr_info() respectively, also joining the broken up message strings...

This helpfully fixes the following complaints from scripts/checkpatch.pl:

WARNING: Prefer [subsystem eg: netdev]_err([subsystem]dev, ... then dev_err(dev, ... then pr_err(... to printk(KERN_ERR ...

WARNING: Prefer [subsystem eg: netdev]_info([subsystem]dev, ... then dev_info(dev, ... then pr_info(... to printk(KERN_INFO ...

WARNING: quoted string split across lines

---
  drivers/ata/pata_legacy.c | 11 ++++-------
  1 file changed, 4 insertions(+), 7 deletions(-)
drivers/ata/pata_legacy.c +3 -5
index e7ac142c2423..9c6918e48448 100644
@@ -209,7 +209,7 @@ static int legacy_probe_add(unsigned long port, unsigned int irq,
  		lp++;
  	}
  	if (free == NULL) {
-		printk(KERN_ERR "pata_legacy: Too many interfaces.\n");
+		pr_err("pata_legacy: Too many interfaces.\n");
  		return -1;
  	}
  	/* Fill in the entry for later probing */
@@ -927,8 +927,7 @@ static __init int probe_chip_type(struct legacy_probe *probe)
 
  		if ((inb(0x1F2) & 0x80) == 0) {
  			/* PDC20230c or 20630 ? */
-			printk(KERN_INFO  "PDC20230-C/20630 VLB ATA controller"
-							" detected.\n");
+			pr_info("PDC20230-C/20630 VLB ATA controller detected.\n");
  			udelay(100);
  			inb(0x1F5);
  			local_irq_restore(flags);
@@ -938,8 +937,7 @@ static __init int probe_chip_type(struct legacy_probe *probe)
  			inb(0x1F2);
  			inb(0x1F2);
  			if (inb(0x1F2) == 0x00)
-				printk(KERN_INFO "PDC20230-B VLB ATA "
-						     "controller detected.\n");
+				pr_info("PDC20230-B VLB ATA controller detected.\n");
  			local_irq_restore(flags);
  			return BIOS;
  		}

drivers/ata/pata_legacy.c static __init void probe_opti_vlb(void) · line 1100

Quoted 9 lines
drivers/ata/pata_legacy.c +1 -2
@@ -1096,8 +1094,7 @@ static __init void probe_opti_vlb(void)
  	u8 ctrl = (opti_syscfg(0x30) & 0xC0) >> 6;
 
  	opti82c46x = 3;	/* Assume master and slave first */
-	printk(KERN_INFO DRV_NAME ": Opti 82C46%s chipset support.\n",
-								optis[ctrl]);
+	pr_info(DRV_NAME ": Opti 82C46%s chipset support.\n", optis[ctrl]);
  	if (ctrl == 3)
  		chans = (opti_syscfg(0x3F) & 0x20) ? 2 : 1;
  	ctrl = opti_syscfg(0xAC);

Cheers,

Hannes

Signature · 4 lines
Dr. Hannes Reinecke                  Kernel Storage Architect
[email protected]                                +49 911 74053 688
SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg
HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich
#12 lore raw

PATCH 6/6 ata: pata_optidma: use dev_warn() instead of printk(KERN_WARNING)

In reply to Sergey Shtylyov

The OPTi PCI device driver still calls printk(KERN_WARNING, ...) in optiplus_with_udma() -- convert it to calling pr_warn()...

This helpfully fixes the following complaints from scripts/checkpatch.pl:

WARNING: Prefer [subsystem eg: netdev]_info([subsystem]dev, ... then dev_warn(dev, ... then pr_info(... to printk(KERN_WARNING ...

---
 drivers/ata/pata_optidma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/ata/pata_optidma.c +1 -1
index dfc36b4ec9c6..23e2326ce31e 100644
@@ -390,7 +390,7 @@ static int optiplus_with_udma(struct pci_dev *pdev)
 	if (r & 0x80)	/* IDEDIR disabled */
 		ret = 1;
 done:
-	printk(KERN_WARNING "UDMA not supported in this configuration.\n");
+	dev_warn(&pdev->dev, "UDMA not supported in this configuration.\n");
 done_nomsg:		/* Wrong chip revision */
 	pci_dev_put(dev1);
 	return ret;
Signature · 1 line
2.47.0
Reviewed-by on v1 6/6
#13 lore raw

Re: [PATCH 6/6] ata: pata_optidma: use dev_warn() instead of printk(KERN_WARNING)

Quoted 19 lines · Sergey Shtylyov

The OPTi PCI device driver still calls printk(KERN_WARNING, ...) in optiplus_with_udma() -- convert it to calling pr_warn()...

This helpfully fixes the following complaints from scripts/checkpatch.pl:

WARNING: Prefer [subsystem eg: netdev]_info([subsystem]dev, ... then dev_warn(dev, ... then pr_info(... to printk(KERN_WARNING ...

---
  drivers/ata/pata_optidma.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/ata/pata_optidma.c +0 -0
index dfc36b4ec9c6..23e2326ce31e 100644

drivers/ata/pata_optidma.c static int optiplus_with_udma(struct pci_dev *pdev) · line 396

Quoted 8 lines
drivers/ata/pata_optidma.c +1 -1
@@ -390,7 +390,7 @@ static int optiplus_with_udma(struct pci_dev *pdev)
  	if (r & 0x80)	/* IDEDIR disabled */
  		ret = 1;
  done:
-	printk(KERN_WARNING "UDMA not supported in this configuration.\n");
+	dev_warn(&pdev->dev, "UDMA not supported in this configuration.\n");
  done_nomsg:		/* Wrong chip revision */
  	pci_dev_put(dev1);
  	return ret;

Cheers,

Hannes

Signature · 4 lines
Dr. Hannes Reinecke                  Kernel Storage Architect
[email protected]                                +49 911 74053 688
SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg
HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich