Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp752031pxv; Thu, 22 Jul 2021 11:15:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxiPeYuli99Gc7XfYpO0w6JmBQBLHWd/JZbp6Pse28K08FJIj5Ej1kO/ozwNyGbRadNq9M+ X-Received: by 2002:a05:6638:14c1:: with SMTP id l1mr674783jak.97.1626977725109; Thu, 22 Jul 2021 11:15:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626977725; cv=none; d=google.com; s=arc-20160816; b=HW3+TI7/bddPAjTmxtdYtjuqtdQjKF83TWmBQoz7uX7YbPcoXNWL+QLKudvCYAK8yj blQnv46Qx8Tl6xNn7iw+JZ2Px3Ya3VTNm0pX5tybduO3NKf5W+qqLVPetES6FvCvHg8Z A+BzsNRLNW+6BR/jAQgx4boRACCRQLYMqxlILq7fzcO0YNDpTOelq88lcmYOuET/NJqY Jxori9t9vP0bXBwxguGG3409T2VNknempdB9i4rqQxioQt1vf8KPki2blMBRdIqbb4ri +wjRSPXYqbrdd3uOadxqMuKgPvRLVjW2xZtprhgUqJDJoBO/oFHS3mDwgubxtuu717KI L4kw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:thread-index:thread-topic :content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:reply-to:from:date:dkim-signature :dkim-filter; bh=r1mr54/S9UFs8uw+5huhvI99uEwPWKeXcD+MX/szleE=; b=xB45HXnvklTq0MLZl2Eb1VtTQa8IDPbaXUoUp72DSXX8+QJyydWoSAsdj870d4lRxL xt5ZUckRJG5vRoJnZtL18tP2aTc/KPOpWV1LVdJ2kLx2dUspEhWuVbK669HR2ceSLVEX D5SL13fBjvAvG8FBT5pxifHUDrBBbvvRAS2Snji2y75VCH8HmpknBzAbql7nPkqCMxcx JI/jfQNh1DGLX9plzwuoOqBBY7xzAnEKwIMKyYby0+DRuXreCs8tmn8SNg2yagBe1ggn K/xM0VukUFfWmBLlxawtFOUgQMo95oKnk8IUc9XHrjfJCofoFxfiJ+6U+GgyrdA2C1tI p1CA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@uliege.be header.s=ulg20190529 header.b=evRQ7klh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=uliege.be Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t15si29047211ilg.47.2021.07.22.11.15.13; Thu, 22 Jul 2021 11:15:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@uliege.be header.s=ulg20190529 header.b=evRQ7klh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=uliege.be Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230169AbhGVRdG (ORCPT + 99 others); Thu, 22 Jul 2021 13:33:06 -0400 Received: from serv108.segi.ulg.ac.be ([139.165.32.111]:41411 "EHLO serv108.segi.ulg.ac.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229976AbhGVRdG (ORCPT ); Thu, 22 Jul 2021 13:33:06 -0400 X-Greylist: delayed 371 seconds by postgrey-1.27 at vger.kernel.org; Thu, 22 Jul 2021 13:33:05 EDT Received: from mbx12-zne.ulg.ac.be (serv470.segi.ulg.ac.be [139.165.32.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by serv108.segi.ulg.ac.be (Postfix) with ESMTPS id CE3E1200E7A8; Thu, 22 Jul 2021 20:07:28 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 serv108.segi.ulg.ac.be CE3E1200E7A8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=uliege.be; s=ulg20190529; t=1626977248; bh=r1mr54/S9UFs8uw+5huhvI99uEwPWKeXcD+MX/szleE=; h=Date:From:Reply-To:To:Cc:In-Reply-To:References:Subject:From; b=evRQ7klhScexRxBPH2Yj/zmBRQo0NRsEQYre9tGTg381y4fKr3lEAyLokw3EO5ixn /1daTfVOtkQRBwN7T93QO4aSmhPxPDyXgLw2LuK/vw1Z+p+e6BY5ydnQmVNBHZr/lY OqiQ9AwDVhDfO49CjxuS3mhBdeYVif3W5ubC3Scc0HQamIkz6aU37scJZkyjFSAva5 Uj4SoMl67jmoxXS/0U30M/kXrufygAHoy/eDaIYjlseK5+q5veGrsyizxRRYIpvT10 prv28HmdqWkklTKNfg/gc9Bduy9mfV69CCLsFOVXaZSy8nhGpv+vZZ7Vwco41IWOjz yY17pOe1PyCXw== Received: from localhost (localhost [127.0.0.1]) by mbx12-zne.ulg.ac.be (Postfix) with ESMTP id C3ECD602255BB; Thu, 22 Jul 2021 20:07:28 +0200 (CEST) Received: from mbx12-zne.ulg.ac.be ([127.0.0.1]) by localhost (mbx12-zne.ulg.ac.be [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id R8vU5vEgwInA; Thu, 22 Jul 2021 20:07:28 +0200 (CEST) Received: from mbx12-zne.ulg.ac.be (mbx12-zne.ulg.ac.be [139.165.32.199]) by mbx12-zne.ulg.ac.be (Postfix) with ESMTP id AE48E6008D842; Thu, 22 Jul 2021 20:07:28 +0200 (CEST) Date: Thu, 22 Jul 2021 20:07:28 +0200 (CEST) From: Justin Iurman Reply-To: Justin Iurman To: Matthieu Baerts Cc: "David S. Miller" , Hideaki YOSHIFUJI , David Ahern , Jakub Kicinski , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Message-ID: <651934762.25015210.1626977248685.JavaMail.zimbra@uliege.be> In-Reply-To: <20210722075504.1793321-1-matthieu.baerts@tessares.net> References: <20210722075504.1793321-1-matthieu.baerts@tessares.net> Subject: Re: [PATCH net-next] ipv6: fix "'ioam6_if_id_max' defined but not used" warn MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [81.240.24.148] X-Mailer: Zimbra 8.8.15_GA_4018 (ZimbraWebClient - FF90 (Linux)/8.8.15_GA_4026) Thread-Topic: ipv6: fix "'ioam6_if_id_max' defined but not used" warn Thread-Index: CGhQJN0HUiWTUsG/AVTlpMGjMqBoIw== Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > When compiling without CONFIG_SYSCTL, this warning appears: > > net/ipv6/addrconf.c:99:12: error: 'ioam6_if_id_max' defined but not used > [-Werror=unused-variable] > 99 | static u32 ioam6_if_id_max = U16_MAX; > | ^~~~~~~~~~~~~~~ > cc1: all warnings being treated as errors > > Simply moving the declaration of this variable under ... > > #ifdef CONFIG_SYSCTL > > ... with other similar variables fixes the issue. > > Fixes: 9ee11f0fff20 ("ipv6: ioam: Data plane support for Pre-allocated Trace") > Signed-off-by: Matthieu Baerts > --- > > Notes: > Please note that this 'ioam6_if_id_max' variable could certainly be > declared as 'const' like some others used as limits for sysctl knobs. > But here, this patch focuses on fixing the warning reported by GCC. > > net/ipv6/addrconf.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c > index 1802287977f1..db0a89810f28 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; > @@ -6550,6 +6548,7 @@ 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[] = { > { > -- > 2.31.1 Good catch, thanks for the patch.