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>
}
if (devicename) {
- char *n, *eptr = NULL;
+ const char *n;
+ char *eptr = NULL;
n = strrchr(devicename, 'n');
if (!n) {