nvmem: core: fix nvmem_cell_write inline function
PATCH 1/1 nvmem: core: fix nvmem_cell_write inline function
From: Sebastian Reichel <[email protected]>
nvmem_cell_write's buf argument uses different types based on the configuration of CONFIG_NVMEM. The function prototype for enabled NVMEM uses 'void *' type, but the static dummy function for disabled NVMEM uses 'const char *' instead. Fix the different behaviour by always expecting a 'void *' typed buf argument.
--- include/linux/nvmem-consumer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/nvmem-consumer.h +1 -1
@@ -118,7 +118,7 @@ static inline void *nvmem_cell_read(struct nvmem_cell *cell, size_t *len) }static inline int nvmem_cell_write (struct nvmem_cell *cell, -const char *buf,size_t len) +void *buf,size_t len) {return -EOPNOTSUPP ; }
Signature · 1 line
2.23.0.rc1
Quoted 23 lines · Sebastian Reichel
From: Sebastian Reichel <[email protected]>
nvmem_cell_write's buf argument uses different types based on the configuration of
CONFIG_NVMEM. The function prototype for enabled NVMEM uses 'void *' type, but the static dummy function for disabled NVMEM uses 'const char *' instead. Fix the different behaviour by always expecting a 'void *' typed buf argument.Fixes 7a78a7f7695b ("power: reset: nvmem-reboot-mode: use NVMEM as reboot mode write interface")Reported-by kbuild test robot <[email protected]>Cc Han Nandor <[email protected]>Cc Srinivas Kandagatla <[email protected]>Signed-off-by Sebastian Reichel <[email protected]>--- include/linux/nvmem-consumer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)include/linux/nvmem-consumer.h +0
-0
include/linux/nvmem-consumer.h static inline void *nvmem_cell_read(struct nvmem_cell *cell, size_t *len) · line 121
Quoted 5 lines
include/linux/nvmem-consumer.h +1
-1@@ -118,7 +118,7 @@ static inline void *nvmem_cell_read(struct nvmem_cell *cell, size_t *len) }static inline int nvmem_cell_write (struct nvmem_cell *cell, -const char *buf,size_t len) +void *buf,size_t len)
nitpick: alignment issue?
Nandor
Hi,
Quoted 19 lines · Nandor Han
Quoted 18 lines · Sebastian Reichel
From: Sebastian Reichel <[email protected]>
nvmem_cell_write's buf argument uses different types based on the configuration of
CONFIG_NVMEM. The function prototype for enabled NVMEM uses 'void *' type, but the static dummy function for disabled NVMEM uses 'const char *' instead. Fix the different behaviour by always expecting a 'void *' typed buf argument.Fixes 7a78a7f7695b ("power: reset: nvmem-reboot-mode: use NVMEM as reboot mode write interface")Reported-by kbuild test robot <[email protected]>Cc Han Nandor <[email protected]>Cc Srinivas Kandagatla <[email protected]>Signed-off-by Sebastian Reichel <[email protected]>--- include/linux/nvmem-consumer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 11 lines
include/linux/nvmem-consumer.h static inline void *nvmem_cell_read(struct nvmem_cell *cell, size_t *len) · line 120
Quoted 9 lines
include/linux/nvmem-consumer.h +1
-1@@ -118,7 +118,7 @@ static inline void *nvmem_cell_read(struct nvmem_cell *cell, size_t *len) }static inline int nvmem_cell_write (struct nvmem_cell *cell, -const char *buf,size_t len) +void *buf,size_t len)nitpick: alignment issue?
This actually fixes the alignment issue as a side-effect. I guess I should have mentioned it in the changelog.
Quoted 1 line
Review-By Han Nandor <[email protected]>
I suppose you meant to write "Reviewed-by" instead of inventing your own tag?
-- Sebastian
Quoted 34 lines · Sebastian Reichel
Hi,
Quoted 19 lines · Nandor Han
Quoted 18 lines · Sebastian Reichel
From: Sebastian Reichel <[email protected]>
nvmem_cell_write's buf argument uses different types based on the configuration of
CONFIG_NVMEM. The function prototype for enabled NVMEM uses 'void *' type, but the static dummy function for disabled NVMEM uses 'const char *' instead. Fix the different behaviour by always expecting a 'void *' typed buf argument.Fixes 7a78a7f7695b ("power: reset: nvmem-reboot-mode: use NVMEM as reboot mode write interface")Reported-by kbuild test robot <[email protected]>Cc Han Nandor <[email protected]>Cc Srinivas Kandagatla <[email protected]>Signed-off-by Sebastian Reichel <[email protected]>--- include/linux/nvmem-consumer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Quoted 11 lines
include/linux/nvmem-consumer.h static inline void *nvmem_cell_read(struct nvmem_cell *cell, size_t *len) · line 120
Quoted 9 lines
include/linux/nvmem-consumer.h +1
-1@@ -118,7 +118,7 @@ static inline void *nvmem_cell_read(struct nvmem_cell *cell, size_t *len) }static inline int nvmem_cell_write (struct nvmem_cell *cell, -const char *buf,size_t len) +void *buf,size_t len)nitpick: alignment issue?
Quoted 8 lines
This actually fixes the alignment issue as a side-effect. I guess I should have mentioned it in the changelog.
Quoted 1 line
Review-By Han Nandor <[email protected]>I suppose you meant to write "Reviewed-by" instead of inventing your own tag?
Yes :)
Nandor
Quoted 9 lines · Sebastian Reichel
From: Sebastian Reichel <[email protected]>
nvmem_cell_write's buf argument uses different types based on the configuration of
CONFIG_NVMEM. The function prototype for enabled NVMEM uses 'void *' type, but the static dummy function for disabled NVMEM uses 'const char *' instead. Fix the different behaviour by always expecting a 'void *' typed buf argument.
Quoted 6 lines
Fixes 7a78a7f7695b ("power: reset: nvmem-reboot-mode: use NVMEM as reboot mode write interface")Reported-by kbuild test robot <[email protected]>Cc Han Nandor <[email protected]>Cc Srinivas Kandagatla <[email protected]>Signed-off-by Sebastian Reichel <[email protected]>
I still see the issue in linux-next, did this get dropped by accident?
Arnd
Quoted 10 lines · Arnd Bergmann
Quoted 9 lines · Sebastian Reichel
From: Sebastian Reichel <[email protected]>
nvmem_cell_write's buf argument uses different types based on the configuration of
CONFIG_NVMEM. The function prototype for enabled NVMEM uses 'void *' type, but the static dummy function for disabled NVMEM uses 'const char *' instead. Fix the different behaviour by always expecting a 'void *' typed buf argument.
Quoted 9 lines
Quoted 6 lines
Fixes 7a78a7f7695b ("power: reset: nvmem-reboot-mode: use NVMEM as reboot mode write interface")Reported-by kbuild test robot <[email protected]>Cc Han Nandor <[email protected]>Cc Srinivas Kandagatla <[email protected]>Signed-off-by Sebastian Reichel <[email protected]>I still see the issue in linux-next, did this get dropped by accident?
I just pushed it to nvmem tree, should be fixed in next soon!
--srini
Quoted 2 lines
Arnd