diff mbox series

[RFC,v2,1/4] cxl/mbox: Use local cxl_device_state variable

Message ID 20221025104243.20836-2-Jonathan.Cameron@huawei.com
State New, archived
Headers show
Series CXL: Standalone switch CCI driver | expand

Commit Message

Jonathan Cameron Oct. 25, 2022, 10:42 a.m. UTC
Given we have cxlds as a local variable, use that rather than
getting it again from cxlmd.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
 drivers/cxl/core/mbox.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Dave Jiang Nov. 4, 2022, 11:25 p.m. UTC | #1
On 10/25/2022 3:42 AM, Jonathan Cameron wrote:
> Given we have cxlds as a local variable, use that rather than
> getting it again from cxlmd.
> 
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

Reviewed-by: Dave Jiang <dave.jiang@intel.com>

This patch can be split out and go upstream as a cleanup now right?

> ---
>   drivers/cxl/core/mbox.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/cxl/core/mbox.c b/drivers/cxl/core/mbox.c
> index 0c90f13870a4..dd9e0aac37ae 100644
> --- a/drivers/cxl/core/mbox.c
> +++ b/drivers/cxl/core/mbox.c
> @@ -539,7 +539,7 @@ int cxl_send_cmd(struct cxl_memdev *cxlmd, struct cxl_send_command __user *s)
>   	if (copy_from_user(&send, s, sizeof(send)))
>   		return -EFAULT;
>   
> -	rc = cxl_validate_cmd_from_user(&mbox_cmd, cxlmd->cxlds, &send);
> +	rc = cxl_validate_cmd_from_user(&mbox_cmd, cxlds, &send);
>   	if (rc)
>   		return rc;
>
Ira Weiny Feb. 15, 2023, 4:17 a.m. UTC | #2
Jonathan Cameron wrote:
> Given we have cxlds as a local variable, use that rather than
> getting it again from cxlmd.
> 
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

Not sure if this ever got sent for real inclusion but it does not look
like it landed.  So FWIW:

Reviewed-by: Ira Weiny <ira.weiny@intel.com>

> ---
>  drivers/cxl/core/mbox.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/cxl/core/mbox.c b/drivers/cxl/core/mbox.c
> index 0c90f13870a4..dd9e0aac37ae 100644
> --- a/drivers/cxl/core/mbox.c
> +++ b/drivers/cxl/core/mbox.c
> @@ -539,7 +539,7 @@ int cxl_send_cmd(struct cxl_memdev *cxlmd, struct cxl_send_command __user *s)
>  	if (copy_from_user(&send, s, sizeof(send)))
>  		return -EFAULT;
>  
> -	rc = cxl_validate_cmd_from_user(&mbox_cmd, cxlmd->cxlds, &send);
> +	rc = cxl_validate_cmd_from_user(&mbox_cmd, cxlds, &send);
>  	if (rc)
>  		return rc;
>  
> -- 
> 2.37.2
>
diff mbox series

Patch

diff --git a/drivers/cxl/core/mbox.c b/drivers/cxl/core/mbox.c
index 0c90f13870a4..dd9e0aac37ae 100644
--- a/drivers/cxl/core/mbox.c
+++ b/drivers/cxl/core/mbox.c
@@ -539,7 +539,7 @@  int cxl_send_cmd(struct cxl_memdev *cxlmd, struct cxl_send_command __user *s)
 	if (copy_from_user(&send, s, sizeof(send)))
 		return -EFAULT;
 
-	rc = cxl_validate_cmd_from_user(&mbox_cmd, cxlmd->cxlds, &send);
+	rc = cxl_validate_cmd_from_user(&mbox_cmd, cxlds, &send);
 	if (rc)
 		return rc;