diff mbox

rtnetlink: fix gcc -Wconversion warning

Message ID 1444412147-21589-1-git-send-email-ronen.arad@intel.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Arad, Ronen Oct. 9, 2015, 5:35 p.m. UTC
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>.

Signed-off-by: Ronen Arad <ronen.arad@intel.com>
---
 include/uapi/linux/rtnetlink.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

David Miller Oct. 13, 2015, 2:41 a.m. UTC | #1
From: Ronen Arad <ronen.arad@intel.com>
Date: Fri,  9 Oct 2015 10:35:47 -0700

> 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>.
> 
> Signed-off-by: Ronen Arad <ronen.arad@intel.com>

Applied, thank you.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/include/uapi/linux/rtnetlink.h b/include/uapi/linux/rtnetlink.h
index 4db0b3c..123a5af 100644
--- a/include/uapi/linux/rtnetlink.h
+++ b/include/uapi/linux/rtnetlink.h
@@ -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) && \