Skip to content

Commit 6d3ca33

Browse files
committed
nvme: constify variable in list_subsys
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 <dwagner@suse.de>
1 parent c506657 commit 6d3ca33

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

nvme.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2473,7 +2473,8 @@ static int list_subsys(int argc, char **argv, struct command *cmd,
24732473
}
24742474

24752475
if (devicename) {
2476-
char *n, *eptr = NULL;
2476+
const char *n;
2477+
char *eptr = NULL;
24772478

24782479
n = strrchr(devicename, 'n');
24792480
if (!n) {

0 commit comments

Comments
 (0)