Re: [RESEND PATCH] nvdimm: fix some compilation warnings

From: Qian Cai
Date: Wed May 15 2019 - 21:48:44 EST




> On May 15, 2019, at 7:25 PM, Dan Williams <dan.j.williams@xxxxxxxxx> wrote:
>
> On Tue, May 14, 2019 at 8:08 AM Qian Cai <cai@xxxxxx> wrote:
>>
>> Several places (dimm_devs.c, core.c etc) include label.h but only
>> label.c uses NSINDEX_SIGNATURE, so move its definition to label.c
>> instead.
>> In file included from drivers/nvdimm/dimm_devs.c:23:
>> drivers/nvdimm/label.h:41:19: warning: 'NSINDEX_SIGNATURE' defined but
>> not used [-Wunused-const-variable=]
>>
>> The commit d9b83c756953 ("libnvdimm, btt: rework error clearing") left
>> an unused variable.
>> drivers/nvdimm/btt.c: In function 'btt_read_pg':
>> drivers/nvdimm/btt.c:1272:8: warning: variable 'rc' set but not used
>> [-Wunused-but-set-variable]
>>
>> Last, some places abuse "/**" which is only reserved for the kernel-doc.
>> drivers/nvdimm/bus.c:648: warning: cannot understand function prototype:
>> 'struct attribute_group nd_device_attribute_group = '
>> drivers/nvdimm/bus.c:677: warning: cannot understand function prototype:
>> 'struct attribute_group nd_numa_attribute_group = '
>
> Can you include the compiler where these errors start appearing, since
> I don't see these warnings with gcc-8.3.1

This can be reproduced by performing extra compiler checks, i.e, "make W=nâ.