Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp334871pxv; Thu, 22 Jul 2021 00:57:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw4i6i7S+5HhaByjMvx5vcMZeKyfE3oWvYQlr6vLihbzZoC2oHINWtkcqOAzNgZUC8/irAy X-Received: by 2002:a17:906:f294:: with SMTP id gu20mr42591329ejb.292.1626940674124; Thu, 22 Jul 2021 00:57:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626940674; cv=none; d=google.com; s=arc-20160816; b=f8/FTWmDTsSkFlQel8PRI/KinTvjVNfwiLA0IL2K4Z7Fq2cUR8deazbHUu69QfbiDT 62ITopWq70P9Es12ZUBl3jXccMwlJZ+y+m8oKkw9XrFBM2SWErZv8XOD8F4igpUAXbMh GD+WC1OBTaPqCkYTfXp4v4geRIb32kGtJrPk2jKbUcNgGYS0sLkTjPMDX9V4Y62JNtLn jVB5nCAvGuNY0S0B5P2Jnfubev2m5SXx2DivWtd0IsArQVRpN6LEyS3iwNgOLel0oo6C T8IVudfJ2dOI+GcmNiNR1I8oQmhip6ZKjTgkG787N5wQjrOTIgI5Oq9rGhRa+XSw6/Is 0gPg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=v+DfCmABxdysmYgQH/qoOzyhuZQqudm8VScowG9ifJY=; b=GUCkNFsYtC0Ecx7jLR5W4smH8C3hmh/acU5TjmGdCNw5XPLFsWCsqOMhgfwWK1dxBT GqWN4xg5lvTBnn7k/EKgf2j6V/M9qScmCVCCVFYA8h9M7ZyPmTiOMp0gRBpnoOV1xPiW I1ywMjln8MEiVU0a6tFWC4kvVCo/AJcBYLOuXgCJJUTZxZNu/nFcBqPKwsx99/JZZCUM 7xjsneby75JS94zgIVVpkEqM83BkgRjqKAz0rpxDkLHlLVbDwznOIVAb99lS7nIku7CM ute1nLsYu3e8YwaaOeCaq1ix9s2jWArQTg5ovDqU5jwvPkINKSyReb+2tEIWH8d3X+VS YhDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tessares-net.20150623.gappssmtp.com header.s=20150623 header.b=zSULqyvM; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id eb21si18167320ejc.626.2021.07.22.00.57.31; Thu, 22 Jul 2021 00:57:54 -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=@tessares-net.20150623.gappssmtp.com header.s=20150623 header.b=zSULqyvM; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230504AbhGVHPB (ORCPT + 99 others); Thu, 22 Jul 2021 03:15:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39918 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229642AbhGVHPA (ORCPT ); Thu, 22 Jul 2021 03:15:00 -0400 Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [IPv6:2a00:1450:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 64B32C061575 for ; Thu, 22 Jul 2021 00:55:35 -0700 (PDT) Received: by mail-ej1-x636.google.com with SMTP id nd37so7086783ejc.3 for ; Thu, 22 Jul 2021 00:55:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tessares-net.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=v+DfCmABxdysmYgQH/qoOzyhuZQqudm8VScowG9ifJY=; b=zSULqyvMBoWxhRvpRPECzDUBPNja+yrLfBvyVs1qMway9XnAPiq+eG6/Dxy8gLnkcK swa6CGMR4l17Ju33YLdunWJD6bdAe7ZQS39D0BrJOXwWWCwkJHTx47W5T4nfpuRTI+85 eRxn7vAXwvaJ38BqX6kwKsOKmrSI8aEv1oP4yVv5WvuBE5B3uQQG/bC1KxsSkR/4YxN7 a2y5PyzJQwk5uZNWB4MV1F5tJzPT4nFwxANDQYaQfsFKusbAqSYfH1OGUVmw8edQE9jU lLFHtR4y2iRo2pQzZNVNPNFnB6OvYDkF2m74BQOxS5h3/Gy5u64nO7qRGYzqDJuXLsGk T4Sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=v+DfCmABxdysmYgQH/qoOzyhuZQqudm8VScowG9ifJY=; b=rpQD1fJXGk29PuKDhhk2N+oQxBVCYbpHQrYu00OAlQd08U9pymvIzsm4vQFcGOFrhY uVAMf4OnA6ogVQEeRP1pDvUJMHN2ye3gwQKpY9Y1oVgKczuy4y0omw0fGp/YuA9xfyVk 4/dj1SvQOFzwGbDtGjq9+osXdrK2jFB0Uzh2dAnpUPkWZoeeBVmlT+Yzvu7olNko5aBI /9QYl4A0avYKzM0qyZyIAJpStlezEOEkhh/ktcgGJHqDyTTMZtam84kKq1LnzXHxB39I NGtn5roVDvM8d0BpBH/xgJZK2NB+9wcsLIE+UoHE9WkPIZ3Uzm5miBkobxIiNPVX5rpv 5anA== X-Gm-Message-State: AOAM532QDEdBqk+WmcCIJD87LKv/CSDJUFZhqXAbD+FOY8AVuFxfZCEP l6lztk2E+C63st3IOAdwSb6VfQ== X-Received: by 2002:a17:906:a08d:: with SMTP id q13mr41518508ejy.465.1626940534015; Thu, 22 Jul 2021 00:55:34 -0700 (PDT) Received: from tsr-vdi-mbaerts.nix.tessares.net (static.23.216.130.94.clients.your-server.de. [94.130.216.23]) by smtp.gmail.com with ESMTPSA id a25sm11859212edr.21.2021.07.22.00.55.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Jul 2021 00:55:33 -0700 (PDT) From: Matthieu Baerts To: "David S. Miller" , Hideaki YOSHIFUJI , David Ahern , Jakub Kicinski , Justin Iurman Cc: Matthieu Baerts , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next] ipv6: fix "'ioam6_if_id_max' defined but not used" warn Date: Thu, 22 Jul 2021 09:55:04 +0200 Message-Id: <20210722075504.1793321-1-matthieu.baerts@tessares.net> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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