Re: [PATCH 08/12] pata_parport: use dev_* and print_hex_* instead of printk

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello again! :-)

   Resending the mail from Gmail account, as OMP account doesn't work ATM... :-/

On 2/11/23 5:42 PM, Ondrej Zary wrote:

> Use dev_info/dev_err/dev_dbg/print_hex_* instead of printk.
> Remove version print from log_adapter and meaningless VERSION defines.

   Sounds like this needs to be in a separate patch...

> Remove now useless verbose parameter of bpck6 module.

   This one too...

> Signed-off-by: Ondrej Zary <linux@xxxxxxx>
[...]

> diff --git a/drivers/ata/pata_parport/bpck.c b/drivers/ata/pata_parport/bpck.c
> index 89160a94b30e..d5bc419b2ab3 100644
> --- a/drivers/ata/pata_parport/bpck.c
> +++ b/drivers/ata/pata_parport/bpck.c
[...]
> @@ -421,24 +416,12 @@ static void bpck_log_adapter(struct pi_adapter *pi)
>  {	char	*mode_string[5] = { "4-bit","8-bit","EPP-8",
>  				    "EPP-16","EPP-32" };
>  	char scratch[128];
> -#ifdef DUMP_EEPROM
> -	int i;
> -#endif
>  
>  	bpck_read_eeprom(pi,scratch);
> -
> -#ifdef DUMP_EEPROM
> -	   for(i=0;i<128;i++)
> -		if ((scratch[i] < ' ') || (scratch[i] > '~'))
> -		    scratch[i] = '.';
> -	   printk("bpck EEPROM: %64.64s\n", scratch);
> -	   printk("             %64.64s\n", &scratch[64]);
> -#endif
> -
> -	printk("bpck %s, backpack %8.8s unit %d",
> -		BPCK_VERSION, &scratch[110], pi->unit);
> -	printk(" at 0x%x, mode %d (%s), delay %d\n",pi->port,
> -		pi->mode,mode_string[pi->mode],pi->delay);
> +	print_hex_dump_bytes("bpck EEPROM: ", DUMP_PREFIX_NONE, scratch, 128);

   Conversion to print_hex_dump_bytes() deserved its own patch, IMHO...

> +	dev_info(&pi->dev, "backpack %8.8s unit %d at 0x%x, mode %d (%s), delay %d\n",
> +		 &scratch[110], pi->unit, pi->port, pi->mode,
> +		 mode_string[pi->mode], pi->delay);
>  }
>  
>  static struct pi_protocol bpck = {
[...]
> diff --git a/drivers/ata/pata_parport/frpw.c b/drivers/ata/pata_parport/frpw.c
> index 9b8db1122154..92b359460e34 100644
> --- a/drivers/ata/pata_parport/frpw.c
> +++ b/drivers/ata/pata_parport/frpw.c
[...]
> @@ -272,11 +266,9 @@ static void frpw_log_adapter(struct pi_adapter *pi)
>  {       char    *mode_string[6] = {"4-bit","8-bit","EPP",
>  				   "EPP-8","EPP-16","EPP-32"};
>  
> -	printk("frpw %s, Freecom (%s) adapter at 0x%x, ",
> -		FRPW_VERSION,((pi->private%2) == 0)?"Xilinx":"ASIC",pi->port);
> -        printk("mode %d (%s), delay %d\n",pi->mode,
> -		mode_string[pi->mode],pi->delay);
> -
> +	dev_info(&pi->dev, "Freecom (%s) adapter at 0x%x, mode %d (%s), delay %d\n",
> +		 ((pi->private % 2) == 0) ? "Xilinx":"ASIC",

   Need to add the spaces around ':' as you added spaces around '?'...

[...]

MBR, Sergey



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux