{"id":809439,"url":"http://patchwork.ozlabs.org/api/1.2/patches/809439/?format=json","web_url":"http://patchwork.ozlabs.org/project/netdev/patch/1504478574-13281-5-git-send-email-pablo@netfilter.org/","project":{"id":7,"url":"http://patchwork.ozlabs.org/api/1.2/projects/7/?format=json","name":"Linux network development","link_name":"netdev","list_id":"netdev.vger.kernel.org","list_email":"netdev@vger.kernel.org","web_url":null,"scm_url":null,"webscm_url":null,"list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<1504478574-13281-5-git-send-email-pablo@netfilter.org>","list_archive_url":null,"date":"2017-09-03T22:42:47","name":"[40/47] netfilter: fix a few (harmless) sparse warnings","commit_ref":null,"pull_url":null,"state":"accepted","archived":true,"hash":"4e05af83ff7bf46ceda274528ba839095fd101bc","submitter":{"id":1315,"url":"http://patchwork.ozlabs.org/api/1.2/people/1315/?format=json","name":"Pablo Neira Ayuso","email":"pablo@netfilter.org"},"delegate":{"id":34,"url":"http://patchwork.ozlabs.org/api/1.2/users/34/?format=json","username":"davem","first_name":"David","last_name":"Miller","email":"davem@davemloft.net"},"mbox":"http://patchwork.ozlabs.org/project/netdev/patch/1504478574-13281-5-git-send-email-pablo@netfilter.org/mbox/","series":[{"id":1283,"url":"http://patchwork.ozlabs.org/api/1.2/series/1283/?format=json","web_url":"http://patchwork.ozlabs.org/project/netdev/list/?series=1283","date":"2017-09-03T22:40:11","name":null,"version":1,"mbox":"http://patchwork.ozlabs.org/series/1283/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/809439/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/809439/checks/","tags":{},"related":[],"headers":{"Return-Path":"<netdev-owner@vger.kernel.org>","X-Original-To":"patchwork-incoming@ozlabs.org","Delivered-To":"patchwork-incoming@ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xlp0h4ZRCz9s06\n\tfor <patchwork-incoming@ozlabs.org>;\n\tMon,  4 Sep 2017 08:43:16 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1753512AbdICWnO (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tSun, 3 Sep 2017 18:43:14 -0400","from mail.us.es ([193.147.175.20]:53066 \"EHLO mail.us.es\"\n\trhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP\n\tid S1753497AbdICWnL (ORCPT <rfc822;netdev@vger.kernel.org>);\n\tSun, 3 Sep 2017 18:43:11 -0400","from antivirus1-rhel7.int (unknown [192.168.2.11])\n\tby mail.us.es (Postfix) with ESMTP id 67811190F65\n\tfor <netdev@vger.kernel.org>; Mon,  4 Sep 2017 00:42:44 +0200 (CEST)","from antivirus1-rhel7.int (localhost [127.0.0.1])\n\tby antivirus1-rhel7.int (Postfix) with ESMTP id 57329B502C\n\tfor <netdev@vger.kernel.org>; Mon,  4 Sep 2017 00:42:44 +0200 (CEST)","by antivirus1-rhel7.int (Postfix, from userid 99)\n\tid 4CEEEB5028; Mon,  4 Sep 2017 00:42:44 +0200 (CEST)","from antivirus1-rhel7.int (localhost [127.0.0.1])\n\tby antivirus1-rhel7.int (Postfix) with ESMTP id 46DDCB5024;\n\tMon,  4 Sep 2017 00:42:42 +0200 (CEST)","from 192.168.1.97 (192.168.1.97) by antivirus1-rhel7.int\n\t(F-Secure/fsigk_smtp/550/antivirus1-rhel7.int); \n\tMon, 04 Sep 2017 00:42:42 +0200 (CEST)","from salvia.here (unknown [31.4.193.113])\n\t(Authenticated sender: pneira@us.es)\n\tby entrada.int (Postfix) with ESMTPA id E64EE4265A20;\n\tMon,  4 Sep 2017 00:42:41 +0200 (CEST)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.1 (2015-04-28) on\n\tantivirus1-rhel7.int","X-Spam-Level":"","X-Spam-Status":"No, score=-108.2 required=7.5 tests=ALL_TRUSTED,BAYES_50,\n\tSMTPAUTH_US2,USER_IN_WHITELIST autolearn=disabled version=3.4.1","X-Virus-Status":"clean(F-Secure/fsigk_smtp/550/antivirus1-rhel7.int)","X-SMTPAUTHUS":"auth mail.us.es","From":"Pablo Neira Ayuso <pablo@netfilter.org>","To":"netfilter-devel@vger.kernel.org","Cc":"davem@davemloft.net, netdev@vger.kernel.org","Subject":"[PATCH 40/47] netfilter: fix a few (harmless) sparse warnings","Date":"Mon,  4 Sep 2017 00:42:47 +0200","Message-Id":"<1504478574-13281-5-git-send-email-pablo@netfilter.org>","X-Mailer":"git-send-email 2.1.4","In-Reply-To":"<1504478574-13281-1-git-send-email-pablo@netfilter.org>","References":"<1504478574-13281-1-git-send-email-pablo@netfilter.org>","X-Virus-Scanned":"ClamAV using ClamSMTP","Sender":"netdev-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<netdev.vger.kernel.org>","X-Mailing-List":"netdev@vger.kernel.org"},"content":"From: Florian Westphal <fw@strlen.de>\n\nnet/netfilter/nft_payload.c:187:18: warning: incorrect type in return expression (expected bool got restricted __sum16 [usertype] check)\nnet/netfilter/nft_exthdr.c:222:14: warning: cast to restricted __be32\nnet/netfilter/nft_rt.c:49:23: warning: incorrect type in assignment (different base types expected unsigned int got restricted __be32)\nnet/netfilter/nft_rt.c:70:25: warning: symbol 'nft_rt_policy' was not declared. Should it be static?\n\nSigned-off-by: Florian Westphal <fw@strlen.de>\nSigned-off-by: Pablo Neira Ayuso <pablo@netfilter.org>\n---\n net/netfilter/nft_exthdr.c  | 2 +-\n net/netfilter/nft_payload.c | 2 +-\n net/netfilter/nft_rt.c      | 6 +++---\n 3 files changed, 5 insertions(+), 5 deletions(-)","diff":"diff --git a/net/netfilter/nft_exthdr.c b/net/netfilter/nft_exthdr.c\nindex f5a0bf5e3bdd..a0a93d987a3b 100644\n--- a/net/netfilter/nft_exthdr.c\n+++ b/net/netfilter/nft_exthdr.c\n@@ -388,7 +388,7 @@ nft_exthdr_select_ops(const struct nft_ctx *ctx,\n \tif (tb[NFTA_EXTHDR_SREG] && tb[NFTA_EXTHDR_DREG])\n \t\treturn ERR_PTR(-EOPNOTSUPP);\n \n-\top = ntohl(nla_get_u32(tb[NFTA_EXTHDR_OP]));\n+\top = ntohl(nla_get_be32(tb[NFTA_EXTHDR_OP]));\n \tswitch (op) {\n \tcase NFT_EXTHDR_OP_TCPOPT:\n \t\tif (tb[NFTA_EXTHDR_SREG])\ndiff --git a/net/netfilter/nft_payload.c b/net/netfilter/nft_payload.c\nindex 7d699bbd45b0..e110b0ebbf58 100644\n--- a/net/netfilter/nft_payload.c\n+++ b/net/netfilter/nft_payload.c\n@@ -184,7 +184,7 @@ static bool nft_payload_udp_checksum(struct sk_buff *skb, unsigned int thoff)\n \tif (!uh)\n \t\treturn false;\n \n-\treturn uh->check;\n+\treturn (__force bool)uh->check;\n }\n \n static int nft_payload_l4csum_offset(const struct nft_pktinfo *pkt,\ndiff --git a/net/netfilter/nft_rt.c b/net/netfilter/nft_rt.c\nindex e142e65d3176..61fd3acaa3c9 100644\n--- a/net/netfilter/nft_rt.c\n+++ b/net/netfilter/nft_rt.c\n@@ -82,8 +82,8 @@ static void nft_rt_get_eval(const struct nft_expr *expr,\n \t\tif (nft_pf(pkt) != NFPROTO_IPV4)\n \t\t\tgoto err;\n \n-\t\t*dest = rt_nexthop((const struct rtable *)dst,\n-\t\t\t\t   ip_hdr(skb)->daddr);\n+\t\t*dest = (__force u32)rt_nexthop((const struct rtable *)dst,\n+\t\t\t\t\t\tip_hdr(skb)->daddr);\n \t\tbreak;\n \tcase NFT_RT_NEXTHOP6:\n \t\tif (nft_pf(pkt) != NFPROTO_IPV6)\n@@ -106,7 +106,7 @@ static void nft_rt_get_eval(const struct nft_expr *expr,\n \tregs->verdict.code = NFT_BREAK;\n }\n \n-const struct nla_policy nft_rt_policy[NFTA_RT_MAX + 1] = {\n+static const struct nla_policy nft_rt_policy[NFTA_RT_MAX + 1] = {\n \t[NFTA_RT_DREG]\t\t= { .type = NLA_U32 },\n \t[NFTA_RT_KEY]\t\t= { .type = NLA_U32 },\n };\n","prefixes":["40/47"]}