linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
To: Hannes Reinecke <hare@suse.de>
Cc: Jens Axboe <axboe@kernel.dk>,
	linux-ide@vger.kernel.org, Hannes Reinecke <hare@suse.com>,
	Tejun Heo <tj@kernel.org>
Subject: Re: [PATCH 01/24] libata: move ata_{port,link,dev}_dbg to dynamic debugging
Date: Thu, 30 Jan 2020 11:42:30 +0100	[thread overview]
Message-ID: <78a7d597-7d44-6b64-ed60-e7da74df692c@samsung.com> (raw)
In-Reply-To: <20181213104716.31930-2-hare@suse.de>


[ added Tejun to Cc: ]

On 12/13/18 11:46 AM, Hannes Reinecke wrote:
> Use dev_dbg() for ata_{port,link,dev}_dbg to allow for selective
> debugging during runtime.
> 
> Signed-off-by: Hannes Reinecke <hare@suse.com>
> ---
>  include/linux/libata.h | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/include/linux/libata.h b/include/linux/libata.h
> index 38c95d66ab12..7b2f039d3d21 100644
> --- a/include/linux/libata.h
> +++ b/include/linux/libata.h
> @@ -1436,7 +1436,7 @@ void ata_dev_printk(const struct ata_device *dev, const char *level,
>  #define ata_port_info(ap, fmt, ...)				\
>  	ata_port_printk(ap, KERN_INFO, fmt, ##__VA_ARGS__)
>  #define ata_port_dbg(ap, fmt, ...)				\
> -	ata_port_printk(ap, KERN_DEBUG, fmt, ##__VA_ARGS__)
> +	dev_dbg(&ap->tdev, fmt, ##__VA_ARGS__)
>  
>  #define ata_link_err(link, fmt, ...)				\
>  	ata_link_printk(link, KERN_ERR, fmt, ##__VA_ARGS__)
> @@ -1447,7 +1447,7 @@ void ata_dev_printk(const struct ata_device *dev, const char *level,
>  #define ata_link_info(link, fmt, ...)				\
>  	ata_link_printk(link, KERN_INFO, fmt, ##__VA_ARGS__)
>  #define ata_link_dbg(link, fmt, ...)				\
> -	ata_link_printk(link, KERN_DEBUG, fmt, ##__VA_ARGS__)
> +	dev_dbg(&link->tdev, fmt, ##__VA_ARGS__)
>  
>  #define ata_dev_err(dev, fmt, ...)				\
>  	ata_dev_printk(dev, KERN_ERR, fmt, ##__VA_ARGS__)
> @@ -1458,7 +1458,7 @@ void ata_dev_printk(const struct ata_device *dev, const char *level,
>  #define ata_dev_info(dev, fmt, ...)				\
>  	ata_dev_printk(dev, KERN_INFO, fmt, ##__VA_ARGS__)
>  #define ata_dev_dbg(dev, fmt, ...)				\
> -	ata_dev_printk(dev, KERN_DEBUG, fmt, ##__VA_ARGS__)
> +	dev_dbg(&dev->tdev, fmt, ##__VA_ARGS__)

While you are at it please remove ata_{port,link,dev}_printk()
altogether.

[ Since code in libata-transport.c sets valid device names using
  dev_set_name() we can simply use generic dev_*() helpers. ]

Please also note that ata_{link,dev}_printk() differs slightly in PMP
handling for links and devices names from code in libata-transport.c:

void ata_link_printk(const struct ata_link *link, const char *level,
		     const char *fmt, ...)
...
	if (sata_pmp_attached(link->ap) || link->ap->slave_link)
		printk("%sata%u.%02u: %pV",
		       level, link->ap->print_id, link->pmp, &vaf);
	else
		printk("%sata%u: %pV",
		       level, link->ap->print_id, &vaf);
...

int ata_tlink_add(struct ata_link *link)
...
	if (ata_is_host_link(link))
		dev_set_name(dev, "link%d", ap->print_id);
        else
		dev_set_name(dev, "link%d.%d", ap->print_id, link->pmp);
...


void ata_dev_printk(const struct ata_device *dev, const char *level,
		    const char *fmt, ...)
...
	printk("%sata%u.%02u: %pV",
	       level, dev->link->ap->print_id, dev->link->pmp + dev->devno,
	       &vaf);
...

static int ata_tdev_add(struct ata_device *ata_dev)
...
	if (ata_is_host_link(link))
		dev_set_name(dev, "dev%d.%d", ap->print_id,ata_dev->devno);
        else
		dev_set_name(dev, "dev%d.%d.0", ap->print_id, link->pmp);
...

I assume that the code in libata-transport.c is the preferred one but
I would like Jens or Tejun to confirm this.

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

  parent reply	other threads:[~2020-01-30 10:42 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20181213104740epcas3p419fa4d0d7bbd5a5004ba3f3c632ba7bd@epcas3p4.samsung.com>
     [not found] ` <20181213104716.31930-1-hare@suse.de>
2020-01-30 10:24   ` [PATCH 00/24] ata: move DPRINTK to dynamic debugging Bartlomiej Zolnierkiewicz
2020-01-30 10:55     ` Hannes Reinecke
     [not found]   ` <CGME20181213104740epcas3p430cad94d8c4c4f58f1d6595ea1eff438@epcas3p4.samsung.com>
     [not found]     ` <20181213104716.31930-2-hare@suse.de>
2020-01-30 10:42       ` Bartlomiej Zolnierkiewicz [this message]
2020-01-31 11:44         ` [PATCH 01/24] libata: move ata_{port,link,dev}_dbg " Hannes Reinecke
     [not found]   ` <CGME20181213104751epcas1p46f3208764bdb8b6a0c03ff234cbe61bf@epcas1p4.samsung.com>
     [not found]     ` <20181213104716.31930-13-hare@suse.de>
2020-01-30 10:46       ` [PATCH 02/24] sata_nv: move DPRINTK to ata debugging Bartlomiej Zolnierkiewicz
2020-01-31 12:57         ` Hannes Reinecke
     [not found]   ` <CGME20181213104742epcas5p487aa32d0bacabb467af45fcab65c7096@epcas5p4.samsung.com>
     [not found]     ` <20181213104716.31930-15-hare@suse.de>
2020-01-30 10:46       ` [PATCH 03/24] sata_sx4: " Bartlomiej Zolnierkiewicz
     [not found]   ` <CGME20181213104753epcas4p2a438bc1a7eb6196a44644b0f93463d9d@epcas4p2.samsung.com>
     [not found]     ` <20181213104716.31930-16-hare@suse.de>
2020-01-30 10:47       ` [PATCH 04/24] sata_sil24: " Bartlomiej Zolnierkiewicz
     [not found]   ` <CGME20181213104740epcas3p12db09f60dff38bdae330d6a541fd4656@epcas3p1.samsung.com>
     [not found]     ` <20181213104716.31930-17-hare@suse.de>
2020-01-30 10:48       ` [PATCH 05/24] sata_rcar: " Bartlomiej Zolnierkiewicz
     [not found]   ` <CGME20181213104832epcas5p268d10f69ecfa32949f56cae0fed83f90@epcas5p2.samsung.com>
     [not found]     ` <20181213104716.31930-18-hare@suse.de>
2020-01-30 10:48       ` [PATCH 06/24] sata_qstor: " Bartlomiej Zolnierkiewicz
     [not found]   ` <CGME20181213104738epcas2p471da9b8d359cec2dbb81dd9cdee37a15@epcas2p4.samsung.com>
     [not found]     ` <20181213104716.31930-19-hare@suse.de>
2020-01-30 10:49       ` [PATCH 07/24] pdc_adma: " Bartlomiej Zolnierkiewicz
     [not found]   ` <CGME20181213104745epcas2p20c8dc2116482a250d09928fac8cea709@epcas2p2.samsung.com>
     [not found]     ` <20181213104716.31930-20-hare@suse.de>
2020-01-30 10:50       ` [PATCH 08/24] ahci: " Bartlomiej Zolnierkiewicz
     [not found]   ` <CGME20181213104817epcas1p1bd74393040fb4b5da0b4aa2f401d1934@epcas1p1.samsung.com>
     [not found]     ` <20181213104716.31930-21-hare@suse.de>
2020-01-30 10:50       ` [PATCH 09/24] ahci_qorig: " Bartlomiej Zolnierkiewicz
     [not found]   ` <CGME20181213104816epcas1p2b354b2f30c32d5e7a9d8cc42d2004c0f@epcas1p2.samsung.com>
     [not found]     ` <20181213104716.31930-22-hare@suse.de>
2020-01-30 10:52       ` [PATCH 10/24] pata_octeon_cf: " Bartlomiej Zolnierkiewicz
     [not found]   ` <CGME20181213104752epcas1p47af8f76a903a917f9a1b6b9a6a1313d8@epcas1p4.samsung.com>
     [not found]     ` <20181213104716.31930-23-hare@suse.de>
2020-01-30 10:52       ` [PATCH 11/24] pata_sil680: " Bartlomiej Zolnierkiewicz
     [not found]   ` <CGME20181213104821epcas1p232acb49869e54a322a48109bb43eeacc@epcas1p2.samsung.com>
     [not found]     ` <20181213104716.31930-24-hare@suse.de>
2020-01-30 10:53       ` [PATCH 12/24] ata_piix: Remove DPRINTK usage Bartlomiej Zolnierkiewicz
     [not found]   ` <CGME20181213104745epcas2p448f3dcac7e01735ab3cded7c52d94ae9@epcas2p4.samsung.com>
     [not found]     ` <20181213104716.31930-25-hare@suse.de>
2020-01-30 10:55       ` [PATCH 13/24] libahci: move DPRINTK to ata debugging Bartlomiej Zolnierkiewicz
     [not found]   ` <CGME20181213104817epcas1p25cb6abb26bf269e4ec5619c3920d3c83@epcas1p2.samsung.com>
     [not found]     ` <20181213104716.31930-26-hare@suse.de>
2020-01-30 11:07       ` [PATCH 14/24] libata: " Bartlomiej Zolnierkiewicz
     [not found]   ` <CGME20181213104753epcas4p3d7c28762331751d9dc184213ece87774@epcas4p3.samsung.com>
     [not found]     ` <20181213104716.31930-27-hare@suse.de>
2020-01-30 11:22       ` [PATCH 15/24] pata_pdc2027x: Replace PDPRINTK() with dynamic debugging Bartlomiej Zolnierkiewicz
     [not found]   ` <CGME20181213104740epcas3p498f1b4f489320a9c04f74c072643e988@epcas3p4.samsung.com>
     [not found]     ` <20181213104716.31930-28-hare@suse.de>
2020-01-30 11:25       ` [PATCH 16/24] sata_fsl: move DPRINTK to ata debugging Bartlomiej Zolnierkiewicz
     [not found]   ` <CGME20181213104810epcas2p3bdc448513b7a8a9fb65966bed4e4c9d8@epcas2p3.samsung.com>
     [not found]     ` <20181213104716.31930-29-hare@suse.de>
2020-01-30 11:36       ` [PATCH 17/24] sata_mv: replace DPRINTK with 'pci_dump' module parameter Bartlomiej Zolnierkiewicz
     [not found]   ` <CGME20181213104753epcas1p1732188e6d1b66d18bc4e3f53cc0a12ce@epcas1p1.samsung.com>
     [not found]     ` <20181213104716.31930-30-hare@suse.de>
2020-01-30 11:44       ` [PATCH 18/24] libata: add 'link' argument to ata_dev_classify() Bartlomiej Zolnierkiewicz
     [not found]   ` <CGME20181213104817epcas1p173179f4212a03ab93af37eeab41c89d7@epcas1p1.samsung.com>
     [not found]     ` <20181213104716.31930-31-hare@suse.de>
2020-01-30 11:52       ` [PATCH 19/24] libata: Use ata_port_printk() in ata_dump_id() Bartlomiej Zolnierkiewicz
2020-01-30 11:53         ` Bartlomiej Zolnierkiewicz
     [not found]   ` <CGME20181213104753epcas1p338a6423f03225a101ef438786f3932b0@epcas1p3.samsung.com>
     [not found]     ` <20181213104716.31930-32-hare@suse.de>
2020-01-30 11:55       ` [PATCH 20/24] pata_pdc202xx_old: move DPRINTK to ata debugging Bartlomiej Zolnierkiewicz
     [not found]   ` <CGME20181213104745epcas2p285b2e3d67650cbeee8298e30124ab9a4@epcas2p2.samsung.com>
     [not found]     ` <20181213104716.31930-33-hare@suse.de>
2020-01-30 11:56       ` [PATCH 21/24] libata: remove DPRINTK() macro Bartlomiej Zolnierkiewicz
     [not found]   ` <CGME20181213104752epcas4p2e4bfedf01151d022ebc8057d5725e27f@epcas4p2.samsung.com>
     [not found]     ` <20181213104716.31930-34-hare@suse.de>
2020-01-30 12:00       ` [PATCH 22/24] ata: Remove remaining references to ATA_DEBUG Bartlomiej Zolnierkiewicz
     [not found]   ` <CGME20181213104810epcas2p164ab666a276177a13a806be75ea7e7cd@epcas2p1.samsung.com>
     [not found]     ` <20181213104716.31930-35-hare@suse.de>
2020-01-30 12:02       ` [PATCH 23/24] libata: drop BPRINTK() Bartlomiej Zolnierkiewicz
     [not found]   ` <CGME20181213104739epcas5p1e0991efea2a383501aefa5613639afaa@epcas5p1.samsung.com>
     [not found]     ` <20181213104716.31930-36-hare@suse.de>
2020-01-30 12:03       ` [PATCH 24/24] libata.h: Whitespace cleanup Bartlomiej Zolnierkiewicz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=78a7d597-7d44-6b64-ed60-e7da74df692c@samsung.com \
    --to=b.zolnierkie@samsung.com \
    --cc=axboe@kernel.dk \
    --cc=hare@suse.com \
    --cc=hare@suse.de \
    --cc=linux-ide@vger.kernel.org \
    --cc=tj@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).