cxl: Fixed defined but not used warnings
Subsystems (2)
PATCH 1/3 cxl: Fixed defined but not used warnings
This fixes unused-const-variable warnings emitted by gcc when cxlmem.h is used by pretty much all files except pci.c
--- include/uapi/linux/cxl_mem.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/uapi/linux/cxl_mem.h +1 -1
@@ -50,7 +50,7 @@ enum { CXL_CMDS };#define ___C (a, b) { b }static const struct {const char *name; -} cxl_command_names[] = {CXL_CMDS }; +} cxl_command_names[]__maybe_unused = {CXL_CMDS };/* * Here's how this actually breaks out:
Signature · 1 line
2.33.0
PATCH 2/3 cxl/core/mbox: Remove extra parameter docs
Fixed "Excess function parameter" warnings generated by the CHECK stage of build.
--- drivers/cxl/core/mbox.c | 4 ---- 1 file changed, 4 deletions(-)
drivers/cxl/core/mbox.c +0 -4
@@ -640,10 +640,6 @@ EXPORT_SYMBOL_GPL(cxl_mem_enumerate_cmds);/** * cxl_mem_get_partition_info - Get partition info * @cxlm: The device to act on -* @active_volatile_bytes: returned active volatile capacity; in bytes -* @active_persistent_bytes: returned active persistent capacity; in bytes -* @next_volatile_bytes: return next volatile capacity; in bytes -* @next_persistent_bytes: return next persistent capacity; in bytes * * Retrieve the current partition info for the device specified. The active * values are the current capacity in bytes. If not 0, the 'next' values are
Signature · 1 line
2.33.0
Re: [PATCH 2/3] cxl/core/mbox: Remove extra parameter docs
Quoted 4 lines · Ben Widawsky
Fixed "Excess function parameter" warnings generated by the CHECK stage of build.
I'll add the:
specific infrastructure to the core")
...but otherwise looks good.
Quoted 23 lines
Signed-off-by Ben Widawsky <[email protected]>--- drivers/cxl/core/mbox.c | 4 ---- 1 file changed, 4 deletions(-)drivers/cxl/core/mbox.c +0
-5@@ -640,10 +640,6 @@ EXPORT_SYMBOL_GPL(cxl_mem_enumerate_cmds);/** * cxl_mem_get_partition_info - Get partition info * @cxlm: The device to act on -* @active_volatile_bytes: returned active volatile capacity; in bytes -* @active_persistent_bytes: returned active persistent capacity; in bytes -* @next_volatile_bytes: return next volatile capacity; in bytes -* @next_persistent_bytes: return next persistent capacity; in bytes * * Retrieve the current partition info for the device specified. The active * values are the current capacity in bytes. If not 0, the 'next' values are -- 2.33.0
Re: [PATCH 2/3] cxl/core/mbox: Remove extra parameter docs
Quoted 7 lines · Dan Williams
Quoted 4 lines · Ben Widawsky
Fixed "Excess function parameter" warnings generated by the CHECK stage of build.
Quoted 6 lines
I'll add the:
Fixes bd0964c858ec ("cxl/mbox: Move mailbox and other non-PCIspecific infrastructure to the core")
...but otherwise looks good.
So this collided with Jonathan's wider comment to split out some of the changes from the "cxl/mbox: Move mailbox and other non-PCI specific infrastructure to the core" into precursor patches. So I ended up folding this change into a bigger cleanup of cxl_mem_get_partition_info(), but I'll add a Reported-by tag for my miss on the doc warning.
PATCH 3/3 cxl/docs: Remove undocumented references
In reply to Ben WidawskyWhen the core pmem and regs implementation was added, there were no structured comments added. This change allows docs to be generated without warnings.
--- Documentation/driver-api/cxl/memory-devices.rst | 6 ------ 1 file changed, 6 deletions(-)
Documentation/driver-api/cxl/memory-devices.rst +0 -6
@@ -39,12 +39,6 @@ CXL Core .. kernel-doc:: drivers/cxl/core/bus.c :doc: cxl core -.. kernel-doc:: drivers/cxl/core/pmem.c - :internal: - -.. kernel-doc:: drivers/cxl/core/regs.c - :internal: - .. kernel-doc:: drivers/cxl/core/mbox.c :doc: cxl mbox
Signature · 1 line
2.33.0
Re: [PATCH 3/3] cxl/docs: Remove undocumented references
Quoted 5 lines · Ben Widawsky
When the core pmem and regs implementation was added, there were no structured comments added. This change allows docs to be generated without warnings.
Hmm, might be better to go the other and fix this with patches to add documentation. At least devm_cxl_add_nvdimm_bridge() would benefit and regs.c has some kernel-doc annotations, just needs the header section added.
Re: [PATCH 3/3] cxl/docs: Remove undocumented references
Quoted 11 lines · Dan Williams
Quoted 5 lines · Ben Widawsky
When the core pmem and regs implementation was added, there were no structured comments added. This change allows docs to be generated without warnings.
Hmm, might be better to go the other and fix this with patches to add documentation. At least
devm_cxl_add_nvdimm_bridge()would benefit andregs.chas some kernel-doc annotations, just needs the header section added.
That'd be my preference, but I'll leave that to you if that's okay.
Quoted 14 lines · Ben Widawsky
This fixes unused-const-variable warnings emitted by gcc when
cxlmem.his used by pretty much all files exceptpci.cSigned-off-by Ben Widawsky <[email protected]>--- include/uapi/linux/cxl_mem.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)include/uapi/linux/cxl_mem.h +0
-0
include/uapi/linux/cxl_mem.h enum { CXL_CMDS }; · line 53
Quoted 5 lines
include/uapi/linux/cxl_mem.h +1
-1@@ -50,7 +50,7 @@ enum { CXL_CMDS };#define ___C (a, b) { b }static const struct {const char *name; -} cxl_command_names[] = {CXL_CMDS }; +} cxl_command_names[]__maybe_unused = {CXL_CMDS };
Since this is a uapi header does this need to be the raw "__attribute__((__unused__))"?
Quoted 10 lines · Dan Williams
Quoted 9 lines · Ben Widawsky
This fixes unused-const-variable warnings emitted by gcc when
cxlmem.his used by pretty much all files exceptpci.cSigned-off-by Ben Widawsky <[email protected]>--- include/uapi/linux/cxl_mem.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 13 lines
include/uapi/linux/cxl_mem.h enum { CXL_CMDS }; · line 53
Quoted 10 lines
include/uapi/linux/cxl_mem.h +1
-1@@ -50,7 +50,7 @@ enum { CXL_CMDS };#define ___C (a, b) { b }static const struct {const char *name; -} cxl_command_names[] = {CXL_CMDS }; +} cxl_command_names[]__maybe_unused = {CXL_CMDS };Since this is a uapi header does this need to be the raw "__attribute__((__unused__))"?
Good catch. I grepped uapi dir and interestingly didn't find other examples of unused... Feeling a bit special snowflake now.
PATCH v2 1/1 cxl: Fixed defined but not used warnings
In reply to Ben WidawskyThis fixes unused-const-variable warnings emitted by gcc when cxlmem.h is used by pretty much all files except pci.c
---
v2: Replace __maybe_unused with __attribute__((__unused__)) (Dan)
--- include/uapi/linux/cxl_mem.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/uapi/linux/cxl_mem.h +1 -1
@@ -50,7 +50,7 @@ enum { CXL_CMDS };#define ___C (a, b) { b }static const struct {const char *name; -} cxl_command_names[] = {CXL_CMDS }; +} cxl_command_names[] __attribute__((__unused__)) = { CXL_CMDS };/* * Here's how this actually breaks out:
Signature · 1 line
2.33.0