nvdimm: fix some compilation warnings
PATCH 1/1 nvdimm: fix some compilation warnings
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 = '
--- drivers/nvdimm/btt.c | 6 ++---- drivers/nvdimm/bus.c | 4 ++-- drivers/nvdimm/label.c | 2 ++ drivers/nvdimm/label.h | 2 -- 4 files changed, 6 insertions(+), 8 deletions(-)
drivers/nvdimm/btt.c +2 -4
@@ -1269,11 +1269,9 @@ static int btt_read_pg(struct btt *btt, struct bio_integrity_payload *bip, ret =btt_data_read (arena, page, off, postmap, cur_len);if (ret) { -int rc; -/* Media error - set the e_flag */ - rc =btt_map_write (arena, premap, postmap,0 ,1 , -NVDIMM_IO_ATOMIC ); +btt_map_write (arena, premap, postmap,0 ,1 , +NVDIMM_IO_ATOMIC ); goto out_rtt; }
drivers/nvdimm/bus.c +2 -2
@@ -642,7 +642,7 @@ static struct attribute *nd_device_attributes[] = { NULL, }; -/** +/* * nd_device_attribute_group - generic attributes for all devices on an nd bus */ struct attribute_group nd_device_attribute_group = {
@@ -671,7 +671,7 @@ static umode_t nd_numa_attr_visible(struct kobject *kobj, struct attribute *a,return a->mode; } -/** +/* * nd_numa_attribute_group - NUMA attributes for all devices on an nd bus */ struct attribute_group nd_numa_attribute_group = {
drivers/nvdimm/label.c +2 -0
@@ -25,6 +25,8 @@ static guid_t nvdimm_btt2_guid;static guid_t nvdimm_pfn_guid;static guid_t nvdimm_dax_guid; +static const char NSINDEX_SIGNATURE [] ="NAMESPACE_INDEX\0" ; +static u32 best_seq (u32 a,u32 b) { a &=NSINDEX_SEQ_MASK ;
drivers/nvdimm/label.h +0 -2
@@ -38,8 +38,6 @@ enum { ND_NSINDEX_INIT = 0x1, }; -static const char NSINDEX_SIGNATURE [] ="NAMESPACE_INDEX\0" ; -/** * struct nd_namespace_index - label set superblock * @sig: NAMESPACE_INDEX\0
Signature · 6 lines
2.20.1 (Apple Git-117) _______________________________________________ Linux-nvdimm mailing list [email protected] https://lists.01.org/mailman/listinfo/linux-nvdimm
Quoted 19 lines · Qian Cai
Several places (
dimm_devs.c,core.cetc) includelabel.hbut onlylabel.cusesNSINDEX_SIGNATURE, so move its definition tolabel.cinstead.
In file included fromdrivers/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:
'structattribute_groupnd_device_attribute_group= 'drivers/nvdimm/bus.c:677: warning: cannot understand function prototype:
'structattribute_groupnd_numa_attribute_group= '
Quoted 7 lines
Signed-off-by Qian Cai <[email protected]>--- drivers/nvdimm/btt.c | 6 ++---- drivers/nvdimm/bus.c | 4 ++-- drivers/nvdimm/label.c | 2 ++ drivers/nvdimm/label.h | 2 -- 4 files changed, 6 insertions(+), 8 deletions(-)
These look good to me,
Quoted 59 lines
drivers/nvdimm/btt.c +2
-4@@ -1269,11 +1269,9 @@ static int btt_read_pg(struct btt *btt, struct bio_integrity_payload *bip, ret =btt_data_read (arena, page, off, postmap, cur_len);if (ret) { -int rc; -/* Media error - set the e_flag */ - rc =btt_map_write (arena, premap, postmap,0 ,1 , -NVDIMM_IO_ATOMIC ); +btt_map_write (arena, premap, postmap,0 ,1 , +NVDIMM_IO_ATOMIC ); goto out_rtt; }drivers/nvdimm/bus.c +2
-2@@ -642,7 +642,7 @@ static struct attribute *nd_device_attributes[] = { NULL, }; -/** +/* * nd_device_attribute_group - generic attributes for all devices on an nd bus */ struct attribute_group nd_device_attribute_group = {@@ -671,7 +671,7 @@ static umode_t nd_numa_attr_visible(struct kobject *kobj, struct attribute *a,return a->mode; } -/** +/* * nd_numa_attribute_group - NUMA attributes for all devices on an nd bus */ struct attribute_group nd_numa_attribute_group = {drivers/nvdimm/label.c +2
-0@@ -25,6 +25,8 @@ static guid_t nvdimm_btt2_guid;static guid_t nvdimm_pfn_guid;static guid_t nvdimm_dax_guid; +static const char NSINDEX_SIGNATURE [] ="NAMESPACE_INDEX\0" ; +static u32 best_seq (u32 a,u32 b) { a &=NSINDEX_SEQ_MASK ;drivers/nvdimm/label.h +0
-0
drivers/nvdimm/label.h enum { · line 43
Quoted 8 lines
drivers/nvdimm/label.h +0
-2@@ -38,8 +38,6 @@ enum { ND_NSINDEX_INIT = 0x1, }; -static const char NSINDEX_SIGNATURE [] ="NAMESPACE_INDEX\0" ; -/** * struct nd_namespace_index - label set superblock * @sig: NAMESPACE_INDEX\0
_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm