From patchwork Fri Jul 23 09:15:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 12395705 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-20.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D4B2CC4338F for ; Fri, 23 Jul 2021 09:16:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BD89760F23 for ; Fri, 23 Jul 2021 09:16:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234594AbhGWIfa (ORCPT ); Fri, 23 Jul 2021 04:35:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:53902 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232370AbhGWIf2 (ORCPT ); Fri, 23 Jul 2021 04:35:28 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2281A60EC0; Fri, 23 Jul 2021 09:15:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1627031761; bh=R/tUNmGg+pjjdMkzRzL/1GJuqdzUtLr2Uhdivnec1/o=; h=From:To:Cc:Subject:Date:From; b=VxOKFweETR1//8RQLzgJ0MrOo3M0d67tmtbJGVUk0n5DwPbgWeEXngZeYczNF5mME Z6Z87jumcJ7rcDk3gYqQjpkcRpzVGHPl4eaD1gz9ooLRFGMKbD3n6cCo40qEvwIHqK D+UdUnV61g84F5GpDJl9XiZ2zxVhxXKfuQ0CanEab8lYFVMyB7huNq97mft1MwOwJx Fn8SpMjuPPrUQZmhSnqv4X8P4EEfXg+clkd4IYJYROzctdDEe/B9j5Pzyd+tghfizS ADTHeVs7FVYvXm+yVU1KIKaJ+mqG4OBa44VeGW+ho1c5M64AJDXNcPdhmxcSZ+K4Wy 6cWyKh/OGD+gQ== From: Arnd Bergmann To: "David S. Miller" , Hideaki YOSHIFUJI , David Ahern , Jakub Kicinski , Justin Iurman Cc: Arnd Bergmann , Xin Long , Matteo Croce , Florent Fourcot , Taehee Yoo , Rocco Yue , Stephen Hemminger , Praveen Chaudhary , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] ipv6: ioam: fix unused function warning Date: Fri, 23 Jul 2021 11:15:52 +0200 Message-Id: <20210723091556.1740686-1-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Arnd Bergmann ioam6_if_id_max is defined globally but used only when CONFIG_SYSCTL is enabled: net/ipv6/addrconf.c:99:12: error: 'ioam6_if_id_max' defined but not used [-Werror=unused-variable] Move the variable definition closer to the usage inside of the same #ifdef. Fixes: 9ee11f0fff20 ("ipv6: ioam: Data plane support for Pre-allocated Trace") Signed-off-by: Arnd Bergmann --- net/ipv6/addrconf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 1802287977f1..cd3171749622 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c @@ -96,8 +96,6 @@ #define IPV6_MAX_STRLEN \ sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255") -static u32 ioam6_if_id_max = U16_MAX; - static inline u32 cstamp_delta(unsigned long cstamp) { return (cstamp - INITIAL_JIFFIES) * 100UL / HZ; @@ -6551,6 +6549,8 @@ static int addrconf_sysctl_disable_policy(struct ctl_table *ctl, int write, static int minus_one = -1; static const int two_five_five = 255; +static u32 ioam6_if_id_max = U16_MAX; + static const struct ctl_table addrconf_sysctl[] = { { .procname = "forwarding",