Skip to contentSkip to conversation

nvmem: Declare nvmem_cell_read() consistently

PATCH New Guenter Roeck 1 participant 1 message Jun 1, 2016 NVMEM framework

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nvmem: Declare nvmem_cell_read() consistently

nvmem_cell_read() is declared as void * if CONFIG_NVMEM is enabled, and as char * otherwise. This can result in a build warning if CONFIG_NVMEM is not enabled and a caller asigns the result to a type other than char * without using a typecast. Use a consistent declaration to avoid the problem.

Fixes e2a5402ec7c6 ("nvmem: Add nvmem_device based consumer apis.")
Cc Srinivas Kandagatla <[email protected]>
---
 include/linux/nvmem-consumer.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/nvmem-consumer.h +1 -1
index 9bb77d3ed6e0..c2256d746543 100644
@@ -74,7 +74,7 @@ static inline void nvmem_cell_put(struct nvmem_cell *cell)
 {
 }
 
-static inline char *nvmem_cell_read(struct nvmem_cell *cell, size_t *len)
+static inline void *nvmem_cell_read(struct nvmem_cell *cell, size_t *len)
 {
 	return ERR_PTR(-ENOSYS);
 }
Signature · 1 line
2.5.0