Skip to contentSkip to conversation

fixup-next: linux/nvmem-consumer.h: fix warning

PATCH Applied Antony Pavlov 3 participants 3 messages Aug 31, 2022 – Sep 1, 2022 NVMEM framework

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fixup-next: linux/nvmem-consumer.h: fix warning

This fixes the commit 06825a0ec35343a1 ("nvmem: import Linux nvmem_cell_read_variable_le_u32") from the next branch.

The warning is:

include/linux/nvmem-consumer.h:84:9: warning: returning 'void *' from a function with return type 'int' makes integer from pointer without a cast [-Wint-conversion]

   84 |  return ERR_PTR(-EOPNOTSUPP);
      |         ^~~~~~~~~~~~~~~~~~~~
---
 include/linux/nvmem-consumer.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/nvmem-consumer.h +1 -1
index b461f840957..1fce7e1ae09 100644
@@ -81,7 +81,7 @@ static inline int nvmem_cell_read_variable_le_u32(struct device_d *dev,
 						  const char *cell_id,
 						  u32 *val)
 {
-	return ERR_PTR(-EOPNOTSUPP);
+	return -EOPNOTSUPP;
 }
 
 static inline int nvmem_cell_write(struct nvmem_cell *cell,
Signature · 1 line
2.37.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 3 lines · Antony Pavlov

This fixes the commit 06825a0ec35343a1 ("nvmem: import Linux nvmem_cell_read_variable_le_u32") from the next branch.

Thanks!

Quoted 27 lines

The warning is:

include/linux/nvmem-consumer.h:84:9: warning: returning 'void *' from a function with return type 'int' makes integer from pointer without a cast [-Wint-conversion]

   84 |  return ERR_PTR(-EOPNOTSUPP);
      |         ^~~~~~~~~~~~~~~~~~~~
---
 include/linux/nvmem-consumer.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/nvmem-consumer.h +1 -1
index b461f840957..1fce7e1ae09 100644
@@ -81,7 +81,7 @@ static inline int nvmem_cell_read_variable_le_u32(struct device_d *dev,
 						  const char *cell_id,
 						  u32 *val)
 {
-	return ERR_PTR(-EOPNOTSUPP);
+	return -EOPNOTSUPP;
 }
 
 static inline int nvmem_cell_write(struct nvmem_cell *cell,
Signature · 4 lines
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
Applied
#2 lore raw
In reply to Antony Pavlov
Quoted 9 lines · Antony Pavlov

This fixes the commit 06825a0ec35343a1 ("nvmem: import Linux nvmem_cell_read_variable_le_u32") from the next branch.

The warning is:

include/linux/nvmem-consumer.h:84:9: warning: returning 'void *' from a function with return type 'int' makes integer from pointer without a cast [-Wint-conversion]

Quoted 7 lines
   84 |  return ERR_PTR(-EOPNOTSUPP);
      |         ^~~~~~~~~~~~~~~~~~~~
---
 include/linux/nvmem-consumer.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks

Sascha

Quoted 18 lines
include/linux/nvmem-consumer.h +1 -1
index b461f840957..1fce7e1ae09 100644
@@ -81,7 +81,7 @@ static inline int nvmem_cell_read_variable_le_u32(struct device_d *dev,
 						  const char *cell_id,
 						  u32 *val)
 {
-	return ERR_PTR(-EOPNOTSUPP);
+	return -EOPNOTSUPP;
 }
 
 static inline int nvmem_cell_write(struct nvmem_cell *cell,
Signature · 1 line
2.37.2
Signature · 4 lines
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |