diff mbox series

scsi: qla2xxx: Do not log message when reading port speed via sysfs

Message ID 20200504175416.15417-1-emilne@redhat.com (mailing list archive)
State Mainlined
Commit fb9024b0646939e59d8a0b6799b317070619795a
Headers show
Series scsi: qla2xxx: Do not log message when reading port speed via sysfs | expand

Commit Message

Ewan Milne May 4, 2020, 5:54 p.m. UTC
Calling ql_log() inside qla2x00_port_speed_show() is causing messages
to be output to the console for no particularly good reason.  The sysfs
read routine should just return the information to userspace.  The only
reason to log a message is when the port speed actually changes, and
this already occurs elsewhere.

Cc: <stable@vger.kernel.org> # v5.1+
Fixes: 4910b524ac9 ("scsi: qla2xxx: Add support for setting port speed")
Signed-off-by: Ewan D. Milne <emilne@redhat.com>
---
 drivers/scsi/qla2xxx/qla_attr.c | 3 ---
 1 file changed, 3 deletions(-)

Comments

Laurence Oberman May 4, 2020, 6 p.m. UTC | #1
On Mon, 2020-05-04 at 13:54 -0400, Ewan D. Milne wrote:
> Calling ql_log() inside qla2x00_port_speed_show() is causing messages
> to be output to the console for no particularly good reason.  The
> sysfs
> read routine should just return the information to userspace.  The
> only
> reason to log a message is when the port speed actually changes, and
> this already occurs elsewhere.
> 
> Cc: <stable@vger.kernel.org> # v5.1+
> Fixes: 4910b524ac9 ("scsi: qla2xxx: Add support for setting port
> speed")
> Signed-off-by: Ewan D. Milne <emilne@redhat.com>
> ---
>  drivers/scsi/qla2xxx/qla_attr.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/drivers/scsi/qla2xxx/qla_attr.c
> b/drivers/scsi/qla2xxx/qla_attr.c
> index 3325596..2c9e5ac 100644
> --- a/drivers/scsi/qla2xxx/qla_attr.c
> +++ b/drivers/scsi/qla2xxx/qla_attr.c
> @@ -1850,9 +1850,6 @@ qla2x00_port_speed_show(struct device *dev,
> struct device_attribute *attr,
>  		return -EINVAL;
>  	}
>  
> -	ql_log(ql_log_info, vha, 0x70d6,
> -	    "port speed:%d\n", ha->link_data_rate);
> -
>  	return scnprintf(buf, PAGE_SIZE, "%s\n", spd[ha-
> >link_data_rate]);
>  }
>  

Looks good for me, and fixes an issue we dealt with last week. 
In other words confusing log noise for customers.

Reviewed-by: Laurence Oberman <loberman@redhat.com>
Himanshu Madhani May 4, 2020, 7:07 p.m. UTC | #2
On 5/4/20 12:54 PM, Ewan D. Milne wrote:
> Calling ql_log() inside qla2x00_port_speed_show() is causing messages
> to be output to the console for no particularly good reason.  The sysfs
> read routine should just return the information to userspace.  The only
> reason to log a message is when the port speed actually changes, and
> this already occurs elsewhere.
> 
> Cc: <stable@vger.kernel.org> # v5.1+
> Fixes: 4910b524ac9 ("scsi: qla2xxx: Add support for setting port speed")
> Signed-off-by: Ewan D. Milne <emilne@redhat.com>
> ---
>   drivers/scsi/qla2xxx/qla_attr.c | 3 ---
>   1 file changed, 3 deletions(-)
> 
> diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c
> index 3325596..2c9e5ac 100644
> --- a/drivers/scsi/qla2xxx/qla_attr.c
> +++ b/drivers/scsi/qla2xxx/qla_attr.c
> @@ -1850,9 +1850,6 @@ qla2x00_port_speed_show(struct device *dev, struct device_attribute *attr,
>   		return -EINVAL;
>   	}
>   
> -	ql_log(ql_log_info, vha, 0x70d6,
> -	    "port speed:%d\n", ha->link_data_rate);
> -
>   	return scnprintf(buf, PAGE_SIZE, "%s\n", spd[ha->link_data_rate]);
>   }
>   
> 
Looks Good.

Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Lee Duncan May 5, 2020, 3:30 p.m. UTC | #3
On 5/4/20 10:54 AM, Ewan D. Milne wrote:
> Calling ql_log() inside qla2x00_port_speed_show() is causing messages
> to be output to the console for no particularly good reason.  The sysfs
> read routine should just return the information to userspace.  The only
> reason to log a message is when the port speed actually changes, and
> this already occurs elsewhere.
> 
> Cc: <stable@vger.kernel.org> # v5.1+
> Fixes: 4910b524ac9 ("scsi: qla2xxx: Add support for setting port speed")
> Signed-off-by: Ewan D. Milne <emilne@redhat.com>
> ---
>  drivers/scsi/qla2xxx/qla_attr.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c
> index 3325596..2c9e5ac 100644
> --- a/drivers/scsi/qla2xxx/qla_attr.c
> +++ b/drivers/scsi/qla2xxx/qla_attr.c
> @@ -1850,9 +1850,6 @@ qla2x00_port_speed_show(struct device *dev, struct device_attribute *attr,
>  		return -EINVAL;
>  	}
>  
> -	ql_log(ql_log_info, vha, 0x70d6,
> -	    "port speed:%d\n", ha->link_data_rate);
> -
>  	return scnprintf(buf, PAGE_SIZE, "%s\n", spd[ha->link_data_rate]);
>  }
>  
> 

Reviewed-by: Lee Duncan <lduncan@suse.com>
Martin K. Petersen May 8, 2020, 1:16 a.m. UTC | #4
On Mon, 4 May 2020 13:54:16 -0400, Ewan D. Milne wrote:

> Calling ql_log() inside qla2x00_port_speed_show() is causing messages
> to be output to the console for no particularly good reason.  The sysfs
> read routine should just return the information to userspace.  The only
> reason to log a message is when the port speed actually changes, and
> this already occurs elsewhere.

Applied to 5.7/scsi-queue, thanks!

[1/1] scsi: qla2xxx: Do not log message when reading port speed via sysfs
      https://git.kernel.org/mkp/scsi/c/0f3b2f3fb5dc
diff mbox series

Patch

diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c
index 3325596..2c9e5ac 100644
--- a/drivers/scsi/qla2xxx/qla_attr.c
+++ b/drivers/scsi/qla2xxx/qla_attr.c
@@ -1850,9 +1850,6 @@  qla2x00_port_speed_show(struct device *dev, struct device_attribute *attr,
 		return -EINVAL;
 	}
 
-	ql_log(ql_log_info, vha, 0x70d6,
-	    "port speed:%d\n", ha->link_data_rate);
-
 	return scnprintf(buf, PAGE_SIZE, "%s\n", spd[ha->link_data_rate]);
 }