diff mbox series

cxl: Fix comment regarding cxl_query_cmd() return data

Message ID 20240913223216.3234173-1-dave.jiang@intel.com
State Accepted
Commit 423c9baae4c7fe73d5812e28610418fd2e8050bd
Headers show
Series cxl: Fix comment regarding cxl_query_cmd() return data | expand

Commit Message

Dave Jiang Sept. 13, 2024, 10:32 p.m. UTC
The code indicates that the min of n_commands and total commands
is returned. The comment incorrectly says it's the max(). Correct
comment to min().

Signed-off-by: Dave Jiang <dave.jiang@intel.com>
---
 drivers/cxl/core/mbox.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Alison Schofield Sept. 17, 2024, 9:58 p.m. UTC | #1
On Fri, Sep 13, 2024 at 03:32:16PM -0700, Dave Jiang wrote:
> The code indicates that the min of n_commands and total commands
> is returned. The comment incorrectly says it's the max(). Correct
> comment to min().

Reviewed-by: Alison Schofield <alison.schofield@intel.com>

> 
> Signed-off-by: Dave Jiang <dave.jiang@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 2626f3fff201..8598199efa09 100644
> --- a/drivers/cxl/core/mbox.c
> +++ b/drivers/cxl/core/mbox.c
> @@ -542,7 +542,7 @@ int cxl_query_cmd(struct cxl_memdev *cxlmd,
>  		return put_user(ARRAY_SIZE(cxl_mem_commands), &q->n_commands);
>  
>  	/*
> -	 * otherwise, return max(n_commands, total commands) cxl_command_info
> +	 * otherwise, return min(n_commands, total commands) cxl_command_info
>  	 * structures.
>  	 */
>  	cxl_for_each_cmd(cmd) {
> -- 
> 2.46.0
> 
>
diff mbox series

Patch

diff --git a/drivers/cxl/core/mbox.c b/drivers/cxl/core/mbox.c
index 2626f3fff201..8598199efa09 100644
--- a/drivers/cxl/core/mbox.c
+++ b/drivers/cxl/core/mbox.c
@@ -542,7 +542,7 @@  int cxl_query_cmd(struct cxl_memdev *cxlmd,
 		return put_user(ARRAY_SIZE(cxl_mem_commands), &q->n_commands);
 
 	/*
-	 * otherwise, return max(n_commands, total commands) cxl_command_info
+	 * otherwise, return min(n_commands, total commands) cxl_command_info
 	 * structures.
 	 */
 	cxl_for_each_cmd(cmd) {