From patchwork Tue May 16 19:45:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 94900 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp671633vqo; Tue, 16 May 2023 13:05:02 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4a/PHuSnQnQRgwkYgeFy+5GRPAysotzp+xQu5sLf3aobvYOYJIQ6AdhT1RbSBOSy3ULlTI X-Received: by 2002:a17:90a:6a8e:b0:234:ba34:71bf with SMTP id u14-20020a17090a6a8e00b00234ba3471bfmr39081527pjj.1.1684267501837; Tue, 16 May 2023 13:05:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684267501; cv=none; d=google.com; s=arc-20160816; b=hjt2ev0rWswGyYNbPK+VQA8i0GTi1ifw0rbgvvA8ZJlMnRaHMTHDcsfUqq2RcRvw37 WTAh66R2t5t62AHKnak1Wwe2/fLRma7hyBcYfP+jdkLg5vRZSTnW2Givi9OqoM5KYazK eQCaDmwlfv3grqTNMWhhrhcSPTAmfcBiNzgfa5abNBKN24FR9DGbA97UNqL+Bqc8GDrC 4I7AwGVFAggIdZSB7qUfF/SVmN30FbLMw5RW5OzPrq23lv3Dy+0GvC9BgSc8hAEjoJ/G eXMVdJftOVAcL9Ks8fpFemT/phoxnlpHWIlrwU1k2mQSbpGTvz3fYAIquNEin2nE6vSx wE9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=gFXbfEXdTaR1+1v/q0b5kY93yApHEhjhScmgB/Sis/E=; b=awjh4E+Yn8vofBwkbYkpehHJbi3IHQxrt36ynxS8qwKq304ECP13XtJHfYevqroah1 R8BfRv+zC/TgZ5xpUksQu2avzlHn3CubdsU6cbIcroe4tetZReYwMVg9T1m+qfNY5MYX FfEs3jKNpuUkg/ZWhm3zzOsfZ9Wm5GoBK2axtKjFDXnJZ/7cw7kD9rqZeu1hD7R9TvVu 80kR5ZO1AWO753dqwI0PtCJY2esG6nzXvFj6huEG8G5Un2+s383t1q3d3CAZhcVd1y46 YvqO/a0hRGTwjPd0xIE2iXtaQsKifu28JQ4FH+qABNsoV17kdu/wYzKBKdYq/0fr1I+6 W2Sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CYoYaBX+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id em22-20020a17090b015600b0024df18639fasi160241pjb.154.2023.05.16.13.04.29; Tue, 16 May 2023 13:05:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CYoYaBX+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229938AbjEPTq6 (ORCPT + 99 others); Tue, 16 May 2023 15:46:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41358 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229491AbjEPTq5 (ORCPT ); Tue, 16 May 2023 15:46:57 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C0A24468B for ; Tue, 16 May 2023 12:46:53 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4F7B563D0B for ; Tue, 16 May 2023 19:46:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 832C2C433D2; Tue, 16 May 2023 19:46:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684266412; bh=Retqq5JfF+1v3Y0juT8ukUupAtMcuR+tzDBH2kPz0nA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CYoYaBX+m/LPk4VBRp8JNpVscrno+XDoOxsbtT049WnQxI9/kSv1bR5kiaTmgxUUy yyC7zNWfHk1n1+Bj8Et1dY92a6p0p51q4zMvCDb9u/iIFhC965iehJ9+OHPWqp9bok 8fR9wBQWSjY95WV68eJL+MIsjiuxWDC3uu+Jjzd0BE4+In115Zc1eGavYGPScFq5OB 6WFmKjetm6poZK2aA6o+B7/MSKLwV/Sim4gAPGVazWEZDClKW9/9Ibhr3Xv7uzOEp1 5qU0+8VwZdehpR7d99IB8cS41Y3EeSlnta9+f3e9RwtJ+zwAvcGzKZJEpKMztEPuVn DkgRIf/FWV1mw== From: Arnd Bergmann To: netdev@vger.kernel.org, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: Arnd Bergmann , Roopa Prabhu , Nikolay Aleksandrov , bridge@lists.linux-foundation.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/4] bridge: always declare tunnel functions Date: Tue, 16 May 2023 21:45:35 +0200 Message-Id: <20230516194625.549249-3-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230516194625.549249-1-arnd@kernel.org> References: <20230516194625.549249-1-arnd@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766082480024766607?= X-GMAIL-MSGID: =?utf-8?q?1766082480024766607?= From: Arnd Bergmann When CONFIG_BRIDGE_VLAN_FILTERING is disabled, two functions are still defined but have no prototype or caller. This causes a W=1 warning for the missing prototypes: net/bridge/br_netlink_tunnel.c:29:6: error: no previous prototype for 'vlan_tunid_inrange' [-Werror=missing-prototypes] net/bridge/br_netlink_tunnel.c:199:5: error: no previous prototype for 'br_vlan_tunnel_info' [-Werror=missing-prototypes] The functions are already contitional on CONFIG_BRIDGE_VLAN_FILTERING, and I coulnd't easily figure out the right set of #ifdefs, so just move the declarations out of the #ifdef to avoid the warning, at a small cost in code size over a more elaborate fix. Signed-off-by: Arnd Bergmann Acked-by: Nikolay Aleksandrov --- net/bridge/br_private_tunnel.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/net/bridge/br_private_tunnel.h b/net/bridge/br_private_tunnel.h index 2b053289f016..efb096025151 100644 --- a/net/bridge/br_private_tunnel.h +++ b/net/bridge/br_private_tunnel.h @@ -27,6 +27,10 @@ int br_process_vlan_tunnel_info(const struct net_bridge *br, int br_get_vlan_tunnel_info_size(struct net_bridge_vlan_group *vg); int br_fill_vlan_tunnel_info(struct sk_buff *skb, struct net_bridge_vlan_group *vg); +bool vlan_tunid_inrange(const struct net_bridge_vlan *v_curr, + const struct net_bridge_vlan *v_last); +int br_vlan_tunnel_info(const struct net_bridge_port *p, int cmd, + u16 vid, u32 tun_id, bool *changed); #ifdef CONFIG_BRIDGE_VLAN_FILTERING /* br_vlan_tunnel.c */ @@ -43,10 +47,6 @@ void br_handle_ingress_vlan_tunnel(struct sk_buff *skb, struct net_bridge_vlan_group *vg); int br_handle_egress_vlan_tunnel(struct sk_buff *skb, struct net_bridge_vlan *vlan); -bool vlan_tunid_inrange(const struct net_bridge_vlan *v_curr, - const struct net_bridge_vlan *v_last); -int br_vlan_tunnel_info(const struct net_bridge_port *p, int cmd, - u16 vid, u32 tun_id, bool *changed); #else static inline int vlan_tunnel_init(struct net_bridge_vlan_group *vg) {