From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1F5D7C001B0 for ; Wed, 9 Aug 2023 15:41:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233664AbjHIPlZ (ORCPT ); Wed, 9 Aug 2023 11:41:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45760 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232964AbjHIPlX (ORCPT ); Wed, 9 Aug 2023 11:41:23 -0400 Received: from smtp-fw-52004.amazon.com (smtp-fw-52004.amazon.com [52.119.213.154]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D1C9211C; Wed, 9 Aug 2023 08:41:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1691595682; x=1723131682; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=PXQIZ+fPIH3bc8gxDN+g8b0rmUv7zu4isFxQBbk0R64=; b=hkVOwlaKEEbp4TzWr9POvR/BIfcNwXKxEIiCTwzFe9xDBhJz917GaiG1 4D7EAnf8M2iXkrHewCgzfyD1JZ0ROtyLUygbB3INUH3HonfP8s0M9r/Kl cLe/PM/lnCKodvwZ+ILTuZ/b12p9/BNOpbY4QHLCDm+r32ohJpWglh0tN Q=; X-IronPort-AV: E=Sophos;i="6.01,159,1684800000"; d="scan'208";a="147543119" Received: from iad12-co-svc-p1-lb1-vlan2.amazon.com (HELO email-inbound-relay-iad-1e-m6i4x-529f0975.us-east-1.amazon.com) ([10.43.8.2]) by smtp-border-fw-52004.iad7.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Aug 2023 15:41:20 +0000 Received: from EX19MTAUWB002.ant.amazon.com (iad12-ws-svc-p26-lb9-vlan3.iad.amazon.com [10.40.163.38]) by email-inbound-relay-iad-1e-m6i4x-529f0975.us-east-1.amazon.com (Postfix) with ESMTPS id B516146BA6; Wed, 9 Aug 2023 15:41:17 +0000 (UTC) Received: from EX19D004ANA001.ant.amazon.com (10.37.240.138) by EX19MTAUWB002.ant.amazon.com (10.250.64.231) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.30; Wed, 9 Aug 2023 15:41:16 +0000 Received: from 88665a182662.ant.amazon.com (10.106.100.32) by EX19D004ANA001.ant.amazon.com (10.37.240.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.30; Wed, 9 Aug 2023 15:41:13 +0000 From: Kuniyuki Iwashima To: CC: , , , , , , , , , , , Subject: Re: [PATCH] net/llc/llc_conn.c: fix 4 instances of -Wmissing-variable-declarations Date: Wed, 9 Aug 2023 08:41:04 -0700 Message-ID: <20230809154104.64963-1-kuniyu@amazon.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.106.100.32] X-ClientProxiedBy: EX19D039UWA002.ant.amazon.com (10.13.139.32) To EX19D004ANA001.ant.amazon.com (10.37.240.138) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Simon Horman Date: Wed, 9 Aug 2023 14:59:51 +0200 > + Kuniyuki Iwashima Thanks Simon. > > 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 Reviewed-by: Kuniyuki Iwashima Thanks! > > > --- > > 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