]> www.infradead.org Git - users/sagi/nvme-cli.git/commit
nvme: constify variable in list_subsys v2.0-rc6
authorDaniel Wagner <dwagner@suse.de>
Fri, 11 Mar 2022 16:46:46 +0000 (17:46 +0100)
committerDaniel Wagner <dwagner@suse.de>
Fri, 11 Mar 2022 16:46:46 +0000 (17:46 +0100)
commit6d3ca33c721d4481bababdd8280a90b1ea47a1a5
treee10ed06c30ed3367f981a43ddbc9f2e5f1b2a2e0
parentc506657cb62d99cab9dd4d4779d1666250ea2159
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>
nvme.c