Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp5589198rwb; Wed, 9 Aug 2023 06:31:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEg2xygQkWzNm18egGJENkfvxMIarUmRAwJ7StzCz6yLW3w6iOzYB/qn2wfbRiK+VjG/gO1 X-Received: by 2002:a17:906:9a:b0:99c:f966:9e9f with SMTP id 26-20020a170906009a00b0099cf9669e9fmr2176894ejc.64.1691587917991; Wed, 09 Aug 2023 06:31:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691587917; cv=none; d=google.com; s=arc-20160816; b=BkiX2/X+op3luu57Btamf9Go1VnFvdIVzmHw1y4ZwWcMYb5SRQpqpn6B4tI5gQxWjM Iur1i5ZXIi2vQ6p2Z4PRF8+ZZyhBw40D+Cxju43AOwuA1V4q1wYBiVWgZCRJe/QGC4Ua yqqaRQpLV81X38EzAkLTyqNYmxF6RpbLPQNux/6A3B4EAmfNiJecvoM1mwCkiXYlxOGM 1l6ye4hHAEA6wj2nLQjGhh5SlwuhzUzDWQJCBkOQT5Nh+y5ZwZ1qG2QQX0PHh15CaR21 FjoQ7YEwbKApLjCvVx1xZpbdQvs6k0sU8cwT8a5hnnuucXmFizXWDMG2oMaHzoS5zJSY 11Tw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=kPHUB/lvq8HFGiKY2S7f/wWxjVK7GZ9GKo/lrNGZghM=; fh=7Bym/7/apiWUt/GNT727HUdB8mll43+4//8WSjFW7f0=; b=M/rz/GIM/Umge4g7hronC1Id/bmNT4+xSQZfSd3A0RUUQfwhwNVIk9oIj6b4P22Q56 pcAU91L6YZgPUgq/V++0I6LRMzsFB4+U3nbNWMnArW4lRkL15Giyaqmv5UDOR8eaUrCk negFJISg0Wzfr3lpuoWBFFmlgFMsXxDjTpeOmEbWwjxZlNVyIb/l38OrP4mO4x7dKTV6 xC+RIO63YPASjHkCvYS3lCSh1/EZnz3IfrgMvFjNB7MsB6ahmKMUWqNa67mkcUdkMOaX YjkeSx7a1dL1HWw9DodKM0FV84ZTpvtrfAq3LlprFKp2uH14fvwkkUYaGBdriCFiFQqH wyWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=iuvplUmm; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r6-20020a170906280600b0099b4b6db8a4si7660753ejc.868.2023.08.09.06.31.32; Wed, 09 Aug 2023 06:31:57 -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=iuvplUmm; 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 S231752AbjHIM76 (ORCPT + 99 others); Wed, 9 Aug 2023 08:59:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54514 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231392AbjHIM76 (ORCPT ); Wed, 9 Aug 2023 08:59:58 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE5081FF6 for ; Wed, 9 Aug 2023 05:59:57 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 42ABB639E8 for ; Wed, 9 Aug 2023 12:59:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 37995C433CB; Wed, 9 Aug 2023 12:59:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1691585996; bh=Kjv7BSip4U2Z76k+hApURRKL4hnouy3m/W2QpYLKPo0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=iuvplUmmZ1qTGk7obsCf7HGiIbt84kz89KMj6mvs5v/+GanHGU1RtChVxT8efOgtk 8hiIfTVQIeTv8orz5OihFkQV9+5M5V3jXJVpS/S4cO/5nO2DWIwDB7OhPpQlKh7lzt quPlOgcWfab/fApuBTWEQWMFXP1uVgjSYyvAB09xdLI0Q7EhuoTe31W8iH7dHk1cJx Bqz8N6o/F6XcHQHEwmBS4ahEf7xuSw772NleWQUwA9Owx+ZKQB86wur6kb0WVnlV1X xIhx1GkBVTEJVnPJAZ5kyH7RppmjqxIeSgNjWfM4CUPcdoZ6/OmfCX5M3x+GBiFhGW rPJGbVo0hS6nw== Date: Wed, 9 Aug 2023 14:59:51 +0200 From: Simon Horman To: Nick Desaulniers Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Nathan Chancellor , Tom Rix , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, kernel test robot , Kuniyuki Iwashima Subject: Re: [PATCH] net/llc/llc_conn.c: fix 4 instances of -Wmissing-variable-declarations Message-ID: References: <20230808-llc_static-v1-1-c140c4c297e4@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230808-llc_static-v1-1-c140c4c297e4@google.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS 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 + Kuniyuki Iwashima On Tue, Aug 08, 2023 at 09:43:09AM -0700, Nick Desaulniers wrote: > I'm looking to enable -Wmissing-variable-declarations behind W=1. 0day > bot spotted the following instances: > > net/llc/llc_conn.c:44:5: warning: no previous extern declaration for > non-static variable 'sysctl_llc2_ack_timeout' > [-Wmissing-variable-declarations] > 44 | int sysctl_llc2_ack_timeout = LLC2_ACK_TIME * HZ; > | ^ > net/llc/llc_conn.c:44:1: note: declare 'static' if the variable is not > intended to be used outside of this translation unit > 44 | int sysctl_llc2_ack_timeout = LLC2_ACK_TIME * HZ; > | ^ > net/llc/llc_conn.c:45:5: warning: no previous extern declaration for > non-static variable 'sysctl_llc2_p_timeout' > [-Wmissing-variable-declarations] > 45 | int sysctl_llc2_p_timeout = LLC2_P_TIME * HZ; > | ^ > net/llc/llc_conn.c:45:1: note: declare 'static' if the variable is not > intended to be used outside of this translation unit > 45 | int sysctl_llc2_p_timeout = LLC2_P_TIME * HZ; > | ^ > net/llc/llc_conn.c:46:5: warning: no previous extern declaration for > non-static variable 'sysctl_llc2_rej_timeout' > [-Wmissing-variable-declarations] > 46 | int sysctl_llc2_rej_timeout = LLC2_REJ_TIME * HZ; > | ^ > net/llc/llc_conn.c:46:1: note: declare 'static' if the variable is not > intended to be used outside of this translation unit > 46 | int sysctl_llc2_rej_timeout = LLC2_REJ_TIME * HZ; > | ^ > net/llc/llc_conn.c:47:5: warning: no previous extern declaration for > non-static variable 'sysctl_llc2_busy_timeout' > [-Wmissing-variable-declarations] > 47 | int sysctl_llc2_busy_timeout = LLC2_BUSY_TIME * HZ; > | ^ > net/llc/llc_conn.c:47:1: note: declare 'static' if the variable is not > intended to be used outside of this translation unit > 47 | int sysctl_llc2_busy_timeout = LLC2_BUSY_TIME * HZ; > | ^ > > These symbols are referenced by more than one translation unit, so make > include the correct header for their declarations. Finally, sort the > list of includes to help keep them tidy. > > Reported-by: kernel test robot > Closes: https://lore.kernel.org/llvm/202308081000.tTL1ElTr-lkp@intel.com/ > Signed-off-by: Nick Desaulniers Reviewed-by: Simon Horman > --- > net/llc/llc_conn.c | 11 ++++++----- > 1 file changed, 6 insertions(+), 5 deletions(-) > > diff --git a/net/llc/llc_conn.c b/net/llc/llc_conn.c > index d037009ee10f..0a3f5e0bec00 100644 > --- a/net/llc/llc_conn.c > +++ b/net/llc/llc_conn.c > @@ -14,14 +14,15 @@ > > #include > #include > -#include > -#include > -#include > -#include > -#include > +#include > #include > +#include > #include > +#include > #include > +#include > +#include > +#include > > #if 0 > #define dprintk(args...) printk(KERN_DEBUG args) > > --- > base-commit: 14f9643dc90adea074a0ffb7a17d337eafc6a5cc > change-id: 20230808-llc_static-de4dddcc64b4 > > Best regards, > -- > Nick Desaulniers > >