diff mbox series

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

Message ID 5d048235-2bac-4a27-b0ce-32e2aec298cb@omp.ru
State New
Headers show
Series libata: get rid of (almost) all printk() calls | expand

Commit Message

Sergey Shtylyov Nov. 8, 2024, 8:23 p.m. UTC
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

Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
---
 drivers/ata/pata_legacy.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

Comments

Hannes Reinecke Nov. 11, 2024, 10:02 a.m. UTC | #1
On 11/8/24 21:23, Sergey Shtylyov wrote:
> 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
> 
> Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
> ---
>   drivers/ata/pata_legacy.c | 11 ++++-------
>   1 file changed, 4 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/ata/pata_legacy.c b/drivers/ata/pata_legacy.c
> index e7ac142c2423..9c6918e48448 100644
> --- a/drivers/ata/pata_legacy.c
> +++ b/drivers/ata/pata_legacy.c
> @@ -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);

Reviewed-by: Hannes Reinecke <hare@suse.de>

Cheers,

Hannes
diff mbox series

Patch

diff --git a/drivers/ata/pata_legacy.c b/drivers/ata/pata_legacy.c
index e7ac142c2423..9c6918e48448 100644
--- a/drivers/ata/pata_legacy.c
+++ b/drivers/ata/pata_legacy.c
@@ -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);