From 6d3ca33c721d4481bababdd8280a90b1ea47a1a5 Mon Sep 17 00:00:00 2001 From: Daniel Wagner Date: Fri, 11 Mar 2022 17:46:46 +0100 Subject: [PATCH] nvme: constify variable in list_subsys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The compiler complains with ../nvme.c: In function ‘list_subsys’: ../nvme.c:2478:19: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] 2478 | n = strrchr(devicename, 'n'); | ^ devicename is of type 'const char *' so the returning pointer is of the same type. Thus constify the n variable. Signed-off-by: Daniel Wagner --- nvme.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nvme.c b/nvme.c index 1ee9a062da..7615fb2ff4 100644 --- a/nvme.c +++ b/nvme.c @@ -2473,7 +2473,8 @@ static int list_subsys(int argc, char **argv, struct command *cmd, } if (devicename) { - char *n, *eptr = NULL; + const char *n; + char *eptr = NULL; n = strrchr(devicename, 'n'); if (!n) {