Re: [PATCH 09/46] libata: move ata_dump_id() to dynamic debugging

Bartlomiej Zolnierkiewicz
2020-02-10T12:47:28Z

On 2/4/20 5:55 PM, Hannes Reinecke wrote:
> Use ata_port_dbg() to print out the information in ata_dump_id()
> and remove the ata_msg_probe() conditional.

Can't we use ata_dev_dbg() instead of ata_port_dbg()?

Otherwise it looks fine.

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

> Signed-off-by: Hannes Reinecke <hare@suse.de>
> ---
> drivers/ata/libata-core.c | 37 +++++++++----------------------------
> 1 file changed, 9 insertions(+), 28 deletions(-)
>
> diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
> index b2b96420a2f2..8a18047f9bcb 100644
> --- a/drivers/ata/libata-core.c
> +++ b/drivers/ata/libata-core.c
> @@ -1449,32 +1449,14 @@ static int ata_hpa_resize(struct ata_device *dev)
> * caller.
> */
>
> -static inline void ata_dump_id(const u16 *id)
> -{
> - DPRINTK("49==0x%04x "
> - "53==0x%04x "
> - "63==0x%04x "
> - "64==0x%04x "
> - "75==0x%04x \n",
> - id[49],
> - id[53],
> - id[63],
> - id[64],
> - id[75]);
> - DPRINTK("80==0x%04x "
> - "81==0x%04x "
> - "82==0x%04x "
> - "83==0x%04x "
> - "84==0x%04x \n",
> - id[80],
> - id[81],
> - id[82],
> - id[83],
> - id[84]);
> - DPRINTK("88==0x%04x "
> - "93==0x%04x\n",
> - id[88],
> - id[93]);
> +static inline void ata_dump_id(struct ata_port *ap, const u16 *id)
> +{
> + ata_port_dbg(ap,
> + "49==0x%04x 53==0x%04x 63==0x%04x 64==0x%04x 75==0x%04x\n"
> + "80==0x%04x 81==0x%04x 82==0x%04x 83==0x%04x 84==0x%04x\n"
> + "88==0x%04x 93==0x%04x\n",
> + id[49], id[53], id[63], id[64], id[75], id[80],
> + id[81], id[82], id[83], id[84], id[88], id[93]);
> }
>
> /**
> @@ -2552,8 +2534,7 @@ int ata_dev_configure(struct ata_device *dev)
> /* find max transfer mode; for printk only */
> xfer_mask = ata_id_xfermask(id);
>
> - if (ata_msg_probe(ap))
> - ata_dump_id(id);
> + ata_dump_id(ap, id);
>
> /* SCSI only uses 4-char revisions, dump full 8 chars from ATA */
> ata_id_c_string(dev->id, fwrevbuf, ATA_ID_FW_REV,
>