Skip to content

Commit c01dafa

Browse files
Qian Caidjbw
Qian Cai
authored andcommitted
libnvdimm: Fix compilation warnings with W=1
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=] Also, 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 = ' Those are just some member assignments for the "struct attribute_group" instances and it can't be expressed in the kernel-doc. Reviewed-by: Vishal Verma <[email protected]> Signed-off-by: Qian Cai <[email protected]> Signed-off-by: Dan Williams <[email protected]>
1 parent a188339 commit c01dafa

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

drivers/nvdimm/bus.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ static struct attribute *nd_device_attributes[] = {
642642
NULL,
643643
};
644644

645-
/**
645+
/*
646646
* nd_device_attribute_group - generic attributes for all devices on an nd bus
647647
*/
648648
struct attribute_group nd_device_attribute_group = {
@@ -671,7 +671,7 @@ static umode_t nd_numa_attr_visible(struct kobject *kobj, struct attribute *a,
671671
return a->mode;
672672
}
673673

674-
/**
674+
/*
675675
* nd_numa_attribute_group - NUMA attributes for all devices on an nd bus
676676
*/
677677
struct attribute_group nd_numa_attribute_group = {

drivers/nvdimm/label.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ static guid_t nvdimm_btt2_guid;
2525
static guid_t nvdimm_pfn_guid;
2626
static guid_t nvdimm_dax_guid;
2727

28+
static const char NSINDEX_SIGNATURE[] = "NAMESPACE_INDEX\0";
29+
2830
static u32 best_seq(u32 a, u32 b)
2931
{
3032
a &= NSINDEX_SEQ_MASK;

drivers/nvdimm/label.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ enum {
3838
ND_NSINDEX_INIT = 0x1,
3939
};
4040

41-
static const char NSINDEX_SIGNATURE[] = "NAMESPACE_INDEX\0";
42-
4341
/**
4442
* struct nd_namespace_index - label set superblock
4543
* @sig: NAMESPACE_INDEX\0

0 commit comments

Comments
 (0)