From: Quanquan Cao <caoqq@fujitsu.com>
To: dave.jiang@intel.com, vishal.l.verma@intel.com
Cc: linux-cxl@vger.kernel.org, Quanquan Cao <caoqq@fujitsu.com>
Subject: [PATCH] cxl/mbox: Code readability improvement
Date: Tue, 30 Jan 2024 13:58:44 +0800 [thread overview]
Message-ID: <20240130055844.19811-1-caoqq@fujitsu.com> (raw)
"send_cmd->id == 0" indicates an invalid command, so replace 0
to CXL_MEM_COMMAND_ID_INVALID to make it easy for reading/understanding.
Signed-off-by: Quanquan Cao <caoqq@fujitsu.com>
---
drivers/cxl/core/mbox.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/cxl/core/mbox.c b/drivers/cxl/core/mbox.c
index 27166a411705..2e5ee05011d6 100644
--- a/drivers/cxl/core/mbox.c
+++ b/drivers/cxl/core/mbox.c
@@ -485,7 +485,8 @@ static int cxl_validate_cmd_from_user(struct cxl_mbox_cmd *mbox_cmd,
struct cxl_mem_command mem_cmd;
int rc;
- if (send_cmd->id == 0 || send_cmd->id >= CXL_MEM_COMMAND_ID_MAX)
+ if (send_cmd->id == CXL_MEM_COMMAND_ID_INVALID ||
+ send_cmd->id >= CXL_MEM_COMMAND_ID_MAX)
return -ENOTTY;
/*
--
2.43.0
next reply other threads:[~2024-01-30 5:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-30 5:58 Quanquan Cao [this message]
2024-01-30 6:59 ` [PATCH] cxl/mbox: Code readability improvement Dan Williams
2024-01-30 8:28 ` Cao, Quanquan/曹 全全
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240130055844.19811-1-caoqq@fujitsu.com \
--to=caoqq@fujitsu.com \
--cc=dave.jiang@intel.com \
--cc=linux-cxl@vger.kernel.org \
--cc=vishal.l.verma@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox