From patchwork Sat Nov 7 07:55:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Desaulniers X-Patchwork-Id: 320892 Delivered-To: patch@linaro.org Received: by 2002:a17:906:d156:0:0:0:0 with SMTP id br22csp1092935ejb; Fri, 6 Nov 2020 23:56:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJyBzP8IEgoNdbnv83MJ2LUIFfpx53zeX7/l74dDeohULEwbhn8E1nhXIig+AOH/IAG7H4AI X-Received: by 2002:a17:906:7844:: with SMTP id p4mr5787428ejm.26.1604735777729; Fri, 06 Nov 2020 23:56:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604735777; cv=none; d=google.com; s=arc-20160816; b=k9dmWcx5LBd/uLF80FNgqYK1oRee1vR7vpomggoR12Rbfd9NV5dsxbPLJHzgz7rj4P x4LKqvLKjPcWlw+7i/z8bdCPLNFocz92zj6Spn7/dhyW1gq3CxQ/XP0A1OwD1wRvGbnT 01F0wsDtymCNAlrYkJELsjzsMdn2FfQmPZW/yqKYKh7roGNJZm9qN0+5S/2byZ1aYPqY Vsuhw1HT1H0/PMyXm61D2FI72tfzOwltC5IkS9Xq2tPWJrhK514grEYO8gxgblVBHdvL la1I4e4RL6QExouKLdl0akI6LAxqKquAr2lxcSijh/v6CWtW2C2nAe3Rz9Em/ZEsE8zn r3Rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:mime-version:message-id:date :sender:dkim-signature; bh=jIeEqn8DjifdijUbE9P+939DFnPxPOakX6eDafn0MtI=; b=SXDtMQfmS5e5b1O246N9OeOQV1Xwu/FW6Ohphc8x2G1f01Fo1KQPcPRf1gBp9AB/58 5d4JEm9906DZkdsIwHAb8n8jghKkiw3TI47bJKUz24qPzIewU1YFWzmS2q+B8e6Y16YE p51gF9A/hsc4blGlrj7dpqRXq8+PlO2ZCbRzu53cBnTfl0Ct1UUVAKtc6UzkXWHECXFR ettJYu2JaFDzcU+/kGdH3nVTA4xM0h7QzWXOxs3+8W+UIJReAYzsQrRhxr/33UJpsApO JPUAnnuBdUnEJvuACCy3u+8K++naIs5QOsDKpneOw1L0dPKn7JOCC9kWewO3oRwk8n8A WY+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=u1aTvZxA; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y24si2880858edl.307.2020.11.06.23.56.17; Fri, 06 Nov 2020 23:56:17 -0800 (PST) Received-SPF: pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=u1aTvZxA; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727861AbgKGH4C (ORCPT + 8 others); Sat, 7 Nov 2020 02:56:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37444 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725985AbgKGH4B (ORCPT ); Sat, 7 Nov 2020 02:56:01 -0500 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 725F0C0613CF for ; Fri, 6 Nov 2020 23:56:01 -0800 (PST) Received: by mail-yb1-xb4a.google.com with SMTP id h6so4543184ybk.4 for ; Fri, 06 Nov 2020 23:56:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:message-id:mime-version:subject:from:to:cc; bh=jIeEqn8DjifdijUbE9P+939DFnPxPOakX6eDafn0MtI=; b=u1aTvZxAXwdIq/SraXXzIVM2gSKJda052aDlbK0HJEZRPF9zOaOKy2HO0eJkSflTgM 92EHWfBwgrgouazSyT95zgWQczY27gtgrYpJV/Pr47LxGGv/AQTNKP8AYMD9+Kk/MxuZ aj2Ijivy27FKXMw9/eY5/LjsubIRHLpTjiSWoTFOHIR32T3DVO+V1LtedCzkokbzV978 QSf2hkWbHJr/yQsdpRqsNXaCkolRgWNe5FFNA1ss83DJpOla3DETCMQqRRu9YR6Jkmeg /gRcmFpjaS+ROnP8LQ11ese5jpHmvFdicRhjDdTD5AUaqevkV8w6jkKWhFgA28FN+pjd kzFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:message-id:mime-version:subject:from :to:cc; bh=jIeEqn8DjifdijUbE9P+939DFnPxPOakX6eDafn0MtI=; b=UT15aPw21Z5cIiB8LQOyOeL+hz2WklqIcFzWwQIx9vPWTML/B5qSgonI2DI9MO4DPq C5VICpWTuD9Z4sg2L4fywYBNJmh0KxzXu6tGNIHXiNxf6V3JrFpmTARC0Yk7ZvvJlnch 6RrnWSW+BpTf97f3y4gOuNsOF7kkwT0I0+3+7Q1s8uNPJSwci23rAVVTnILdYffyqBAM lt/MsZATbzaM8NAaj4DGI3MENBpaeyZyRpSAR2vlgcHtSsN/Aj3YOa8zjM1m7xrM1YhN H7zsBD2gwCMfOSklYN+4OXJqzC2VjLj0RsSdZmdNg8szXXrFv7EiOjVkZB2pm7Cj5CJ4 /NAg== X-Gm-Message-State: AOAM530dxB4zJrrjQEH/QCTfyYK41XkvhtvtpkUICQSUFE43mMlR9Eg5 o9IT0m0cGznyjwOHcFXM4/xDAXAMdo7B7P/vSmM= Sender: "ndesaulniers via sendgmr" X-Received: from ndesaulniers1.mtv.corp.google.com ([2620:15c:211:202:f693:9fff:fef4:4d25]) (user=ndesaulniers job=sendgmr) by 2002:a25:7811:: with SMTP id t17mr7217154ybc.450.1604735760577; Fri, 06 Nov 2020 23:56:00 -0800 (PST) Date: Fri, 6 Nov 2020 23:55:50 -0800 Message-Id: <20201107075550.2244055-1-ndesaulniers@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.29.2.222.g5d2a92d10f8-goog Subject: [PATCH] netfilter: conntrack: fix -Wformat From: Nick Desaulniers To: Pablo Neira Ayuso , Jozsef Kadlecsik , Florian Westphal Cc: Nick Desaulniers , "David S. Miller" , Jakub Kicinski , Nathan Chancellor , netfilter-devel@vger.kernel.org, coreteam@netfilter.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Clang is more aggressive about -Wformat warnings when the format flag specifies a type smaller than the parameter. Fixes 8 instances of: warning: format specifies type 'unsigned short' but the argument has type 'int' [-Wformat] Link: https://github.com/ClangBuiltLinux/linux/issues/378 Signed-off-by: Nick Desaulniers --- net/netfilter/nf_conntrack_standalone.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) -- 2.29.2.222.g5d2a92d10f8-goog Reported-by: kernel test robot diff --git a/net/netfilter/nf_conntrack_standalone.c b/net/netfilter/nf_conntrack_standalone.c index 46c5557c1fec..c5aa45c38eb2 100644 --- a/net/netfilter/nf_conntrack_standalone.c +++ b/net/netfilter/nf_conntrack_standalone.c @@ -50,38 +50,38 @@ print_tuple(struct seq_file *s, const struct nf_conntrack_tuple *tuple, switch (l4proto->l4proto) { case IPPROTO_ICMP: - seq_printf(s, "type=%u code=%u id=%u ", + seq_printf(s, "type=%u code=%u id=%hu ", tuple->dst.u.icmp.type, tuple->dst.u.icmp.code, - ntohs(tuple->src.u.icmp.id)); + (__be16)ntohs(tuple->src.u.icmp.id)); break; case IPPROTO_TCP: seq_printf(s, "sport=%hu dport=%hu ", - ntohs(tuple->src.u.tcp.port), - ntohs(tuple->dst.u.tcp.port)); + (__be16)ntohs(tuple->src.u.tcp.port), + (__be16)ntohs(tuple->dst.u.tcp.port)); break; case IPPROTO_UDPLITE: case IPPROTO_UDP: seq_printf(s, "sport=%hu dport=%hu ", - ntohs(tuple->src.u.udp.port), - ntohs(tuple->dst.u.udp.port)); + (__be16)ntohs(tuple->src.u.udp.port), + (__be16)ntohs(tuple->dst.u.udp.port)); break; case IPPROTO_DCCP: seq_printf(s, "sport=%hu dport=%hu ", - ntohs(tuple->src.u.dccp.port), - ntohs(tuple->dst.u.dccp.port)); + (__be16)ntohs(tuple->src.u.dccp.port), + (__be16)ntohs(tuple->dst.u.dccp.port)); break; case IPPROTO_SCTP: seq_printf(s, "sport=%hu dport=%hu ", - ntohs(tuple->src.u.sctp.port), - ntohs(tuple->dst.u.sctp.port)); + (__be16)ntohs(tuple->src.u.sctp.port), + (__be16)ntohs(tuple->dst.u.sctp.port)); break; case IPPROTO_ICMPV6: - seq_printf(s, "type=%u code=%u id=%u ", + seq_printf(s, "type=%u code=%u id=%hu ", tuple->dst.u.icmp.type, tuple->dst.u.icmp.code, - ntohs(tuple->src.u.icmp.id)); + (__be16)ntohs(tuple->src.u.icmp.id)); break; case IPPROTO_GRE: seq_printf(s, "srckey=0x%x dstkey=0x%x ",