diff mbox

[6/6] libata: Be quiet when asked to

Message ID 20180301194024.25532-7-damien.lemoal@wdc.com (mailing list archive)
State Changes Requested
Headers show

Commit Message

Damien Le Moal March 1, 2018, 7:40 p.m. UTC
For a successful setting of the device transfer speed mode in
ata_dev_set_mode(), do not print the message
"ataX.XX: configured for xxx" if the EH context has the quiet flag set.

Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
---
 drivers/ata/libata-core.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Comments

Hannes Reinecke March 2, 2018, 7:33 a.m. UTC | #1
On 03/01/2018 08:40 PM, Damien Le Moal wrote:
> For a successful setting of the device transfer speed mode in
> ata_dev_set_mode(), do not print the message
> "ataX.XX: configured for xxx" if the EH context has the quiet flag set.
> 
> Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
> ---
>  drivers/ata/libata-core.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
> index 3c09122bf038..258afc2e8efd 100644
> --- a/drivers/ata/libata-core.c
> +++ b/drivers/ata/libata-core.c
> @@ -3573,9 +3573,10 @@ static int ata_dev_set_mode(struct ata_device *dev)
>  	DPRINTK("xfer_shift=%u, xfer_mode=0x%x\n",
>  		dev->xfer_shift, (int)dev->xfer_mode);
>  
> -	ata_dev_info(dev, "configured for %s%s\n",
> -		     ata_mode_string(ata_xfer_mode2mask(dev->xfer_mode)),
> -		     dev_err_whine);
> +	if (!(ehc->i.flags & ATA_EHI_QUIET))
> +		ata_dev_info(dev, "configured for %s%s\n",
> +			ata_mode_string(ata_xfer_mode2mask(dev->xfer_mode)),
> +			dev_err_whine);
>  
>  	return 0;
>  
> 
Reviewed-by: Hannes Reinecke <hare@suse.com>

Cheers,

Hannes
Tejun Heo March 4, 2018, 8:28 p.m. UTC | #2
Hello,

On Fri, Mar 02, 2018 at 04:40:24AM +0900, Damien Le Moal wrote:
> For a successful setting of the device transfer speed mode in
> ata_dev_set_mode(), do not print the message
> "ataX.XX: configured for xxx" if the EH context has the quiet flag set.
> 
> Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
> ---
>  drivers/ata/libata-core.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
> index 3c09122bf038..258afc2e8efd 100644
> --- a/drivers/ata/libata-core.c
> +++ b/drivers/ata/libata-core.c
> @@ -3573,9 +3573,10 @@ static int ata_dev_set_mode(struct ata_device *dev)
>  	DPRINTK("xfer_shift=%u, xfer_mode=0x%x\n",
>  		dev->xfer_shift, (int)dev->xfer_mode);
>  
> -	ata_dev_info(dev, "configured for %s%s\n",
> -		     ata_mode_string(ata_xfer_mode2mask(dev->xfer_mode)),
> -		     dev_err_whine);
> +	if (!(ehc->i.flags & ATA_EHI_QUIET))
> +		ata_dev_info(dev, "configured for %s%s\n",
> +			ata_mode_string(ata_xfer_mode2mask(dev->xfer_mode)),
> +			dev_err_whine);

EHI_QUIET is used during proble to print out the more releveant
messages, so doing the above may surprise some users.  Can we keep the
above message for initial probing?

Thanks.
diff mbox

Patch

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 3c09122bf038..258afc2e8efd 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -3573,9 +3573,10 @@  static int ata_dev_set_mode(struct ata_device *dev)
 	DPRINTK("xfer_shift=%u, xfer_mode=0x%x\n",
 		dev->xfer_shift, (int)dev->xfer_mode);
 
-	ata_dev_info(dev, "configured for %s%s\n",
-		     ata_mode_string(ata_xfer_mode2mask(dev->xfer_mode)),
-		     dev_err_whine);
+	if (!(ehc->i.flags & ATA_EHI_QUIET))
+		ata_dev_info(dev, "configured for %s%s\n",
+			ata_mode_string(ata_xfer_mode2mask(dev->xfer_mode)),
+			dev_err_whine);
 
 	return 0;