diff mbox series

[net-next,11/11] ipv6: fix type mismatch warning

Message ID 20201026213040.3889546-11-arnd@kernel.org
State New
Headers show
Series [net-next,01/11] atm: horizon: shut up clang null pointer arithmetic warning | expand

Commit Message

Arnd Bergmann Oct. 26, 2020, 9:29 p.m. UTC
From: Arnd Bergmann <arnd@arndb.de>

Building with 'make W=2' shows a warning for every time this header
gets included because of a pointer type mismatch:

net/addrconf.h:163:32: warning: passing 'unsigned char *' to parameter of type 'const char *' converts between pointers to integer
types with different sign [-Wpointer-sign]
        addrconf_addr_eui48_base(eui, dev->dev_addr);

Change the type to unsigned according to the input argument.

Fixes: 4d6f28591fe4 ("{net,IB}/{rxe,usnic}: Utilize generic mac to eui32 function")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 include/net/addrconf.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/include/net/addrconf.h b/include/net/addrconf.h
index 18f783dcd55f..074ce761e482 100644
--- a/include/net/addrconf.h
+++ b/include/net/addrconf.h
@@ -127,7 +127,8 @@  int addrconf_prefix_rcv_add_addr(struct net *net, struct net_device *dev,
 				 u32 addr_flags, bool sllao, bool tokenized,
 				 __u32 valid_lft, u32 prefered_lft);
 
-static inline void addrconf_addr_eui48_base(u8 *eui, const char *const addr)
+static inline void addrconf_addr_eui48_base(u8 *eui,
+					    const unsigned char *const addr)
 {
 	memcpy(eui, addr, 3);
 	eui[3] = 0xFF;
@@ -135,7 +136,7 @@  static inline void addrconf_addr_eui48_base(u8 *eui, const char *const addr)
 	memcpy(eui + 5, addr + 3, 3);
 }
 
-static inline void addrconf_addr_eui48(u8 *eui, const char *const addr)
+static inline void addrconf_addr_eui48(u8 *eui, const unsigned char *const addr)
 {
 	addrconf_addr_eui48_base(eui, addr);
 	eui[0] ^= 2;