diff mbox

[4/6] libata: Fix ata_err_string()

Message ID 20180301194024.25532-5-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
Add proper error string output for ATA_ERR_NCQ and ATA_ERR_NODEV_HINT
instead of returning "unknown error".

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

Comments

Hannes Reinecke March 2, 2018, 7:32 a.m. UTC | #1
On 03/01/2018 08:40 PM, Damien Le Moal wrote:
> Add proper error string output for ATA_ERR_NCQ and ATA_ERR_NODEV_HINT
> instead of returning "unknown error".
> 
> Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
> ---
>  drivers/ata/libata-eh.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
> index d6264235c3d7..006ea1507dcf 100644
> --- a/drivers/ata/libata-eh.c
> +++ b/drivers/ata/libata-eh.c
> @@ -1482,6 +1482,10 @@ static const char *ata_err_string(unsigned int err_mask)
>  		return "invalid argument";
>  	if (err_mask & AC_ERR_DEV)
>  		return "device error";
> +	if (err_mask & AC_ERR_NCQ)
> +		return "NCQ error";
> +	if (err_mask & AC_ERR_NODEV_HINT)
> +		return "Polling detection error";
>  	return "unknown error";
>  }
>  
> 
Reviewed-by: Hannes Reinecke <hare@suse.com>

Cheers,

Hannes
diff mbox

Patch

diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index d6264235c3d7..006ea1507dcf 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -1482,6 +1482,10 @@  static const char *ata_err_string(unsigned int err_mask)
 		return "invalid argument";
 	if (err_mask & AC_ERR_DEV)
 		return "device error";
+	if (err_mask & AC_ERR_NCQ)
+		return "NCQ error";
+	if (err_mask & AC_ERR_NODEV_HINT)
+		return "Polling detection error";
 	return "unknown error";
 }