diff mbox series

[ethtool,01/21] netlink: fix build warnings

Message ID bb60cbfe99071fca4b0ea9e62d67a2341d8dd652.1590707335.git.mkubecek@suse.cz
State Accepted
Delegated to: John Linville
Headers show
Series netlink interface update for 5.7 release | expand

Commit Message

Michal Kubecek May 28, 2020, 11:21 p.m. UTC
Depending on compiler version and options, some of these warnings may
result in build failure.

- gcc 4.8 wants __KERNEL_DIV_ROUND_UP defined before including ethtool.h
- avoid pointer arithmetic on void *

Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
---
 netlink/desc-ethtool.c | 2 +-
 netlink/parser.c       | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Heiko Thiery June 6, 2020, 6:47 p.m. UTC | #1
Hi Michal,

On 29.05.20 01:21, Michal Kubecek wrote:
> Depending on compiler version and options, some of these warnings may
> result in build failure.
> 
> - gcc 4.8 wants __KERNEL_DIV_ROUND_UP defined before including ethtool.h
> - avoid pointer arithmetic on void *
> 
> Signed-off-by: Michal Kubecek <mkubecek@suse.cz>

Tested-by: Heiko Thiery <heiko.thiery@gmail.com>
diff mbox series

Patch

diff --git a/netlink/desc-ethtool.c b/netlink/desc-ethtool.c
index 76c6f13e4648..423479dfc6a9 100644
--- a/netlink/desc-ethtool.c
+++ b/netlink/desc-ethtool.c
@@ -4,9 +4,9 @@ 
  * Descriptions of ethtool netlink messages and attributes for pretty print.
  */
 
+#include "../internal.h"
 #include <linux/ethtool_netlink.h>
 
-#include "../internal.h"
 #include "prettymsg.h"
 
 static const struct pretty_nla_desc __header_desc[] = {
diff --git a/netlink/parser.c b/netlink/parser.c
index fff23f2425e9..d790abedd482 100644
--- a/netlink/parser.c
+++ b/netlink/parser.c
@@ -1016,7 +1016,7 @@  int nl_parser(struct nl_context *nlctx, const struct param_parser *params,
 			buff = tmp_buff_find(buffs, parser->group);
 		msgbuff = buff ? &buff->msgbuff : &nlsk->msgbuff;
 
-		param_dest = dest ? (dest + parser->dest_offset) : NULL;
+		param_dest = dest ? ((char *)dest + parser->dest_offset) : NULL;
 		ret = parser->handler(nlctx, parser->type, parser->handler_data,
 				      msgbuff, param_dest);
 		if (ret < 0)