Skip to contentSkip to conversation

rtnetlink: fix gcc -Wconversion warning

PATCH Applied Ronen Arad 2 participants 2 messages Oct 9, 2015 – Oct 13, 2015

Subsystems (2)
lore
Share & tools
lore

Ronen Arad

author
#0 lore raw

PATCH 1/1 rtnetlink: fix gcc -Wconversion warning

RTA_ALIGNTO is currently define as 4. It has to be 4U to prevent warning for RTA_ALIGN and RTA_DATA expansions when -Wconversion gcc option is enabled.
This follows NLMSG_ALIGNTO definition in <include/uapi/linux/netlink.h>.

---
 include/uapi/linux/rtnetlink.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/uapi/linux/rtnetlink.h +1 -1
index 4db0b3c..123a5af 100644
@@ -160,7 +160,7 @@ struct rtattr {
 
 /* Macros to handle rtattributes */
 
-#define RTA_ALIGNTO	4
+#define RTA_ALIGNTO	4U
 #define RTA_ALIGN(len) ( ((len)+RTA_ALIGNTO-1) & ~(RTA_ALIGNTO-1) )
 #define RTA_OK(rta,len) ((len) >= (int)sizeof(struct rtattr) && \
 			 (rta)->rta_len >= sizeof(struct rtattr) && \
Signature · 1 line
2.1.0
maintainer Applied
#1 lore raw

From: Ronen Arad <[email protected]>
Date: Fri, 9 Oct 2015 10:35:47 -0700

Quoted 6 lines

RTA_ALIGNTO is currently define as 4. It has to be 4U to prevent warning for RTA_ALIGN and RTA_DATA expansions when -Wconversion gcc option is enabled.
This follows NLMSG_ALIGNTO definition in <include/uapi/linux/netlink.h>.

Applied, thank you.