Received: by 2002:a05:6358:51dd:b0:131:369:b2a3 with SMTP id 29csp189167rwl; Wed, 9 Aug 2023 13:02:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHThbcUMZ0JdDUu94GRJkwYY9v7ZUG/6c+5GMNMmRnkdz6vwSARJwB8tJxZqSy/OaivKtcL X-Received: by 2002:a05:6512:1589:b0:4fe:1a99:45e3 with SMTP id bp9-20020a056512158900b004fe1a9945e3mr184248lfb.30.1691611361589; Wed, 09 Aug 2023 13:02:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691611361; cv=none; d=google.com; s=arc-20160816; b=qjJL78pY51s+2K/UwNB1eCrfpNmXXhpjCvw54pUbB4YyS9zg25kAKiLsiDfd2u/oBi MUA5D/3FOy/HrdijGBp5MDjxDa3nyWNcuz+1MOiRsVwTEz+ABfpmFIB8ftuwHnU/tXrI eoAcJ7MvwMmylVr80RC/INclQqOpdVOdogCJ56klkQFNH0YnAlImiLtYykz11ohzIhWF lvEg/9loyHv/pwLN5B24qIt33MAU6xAW/cf2r94Z6aDZnB935n866tfdVM6XWF7PKMBC +pYbZShhODVv6rS95L2moznDTTB9/v3ze9U0Vw6I6ZLsfsJA6vmCuICwZllrY0wFO4et 9QNw== 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=Zx1N8mJHP2IUUmBILuwjXMg/YX85jHLFYGcKlBnYxDg=; fh=X/aw8o/UwHniDW0dDmvadNfzcCIphZak3BltocQCLSA=; b=Y1mEGnUPLPVK84N7lHqKHW+e2aYagTfLpM5pwyrVw9wYbaAXm9I8yFtOiKRgMm4Q+2 OI/bv34BfwpOBN+XTZHRLET6MfcoI34za5+WWaSyS4J5E/KlSVuZLjBDzw0TefamQCXP zQjYb2iR/6hbUwpjW8cbL7fuQGguTLQVipOAoUo+RZ4UYKHMmX7HJib+DZoMpN/MYvxe Yz4jy544InRUgF56o1pT23FY5YyF/B7xAvVRE2vvobNQCOl/jieZsI/jLat+lumzQjJU ofm0SmxE6l9t0rruK0mSYInzcf0HiTAA4cMdDP81taZz9o+ouOEmGCqvU8goQ/+ZreiZ tTWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="foNa56/L"; 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 bq12-20020a170906d0cc00b0099bc86f70a9si9665324ejb.748.2023.08.09.13.02.04; Wed, 09 Aug 2023 13:02:41 -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="foNa56/L"; 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 S233428AbjHITPc (ORCPT + 99 others); Wed, 9 Aug 2023 15:15:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232532AbjHITPR (ORCPT ); Wed, 9 Aug 2023 15:15:17 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C65E423C; Wed, 9 Aug 2023 12:13:51 -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 40B346456F; Wed, 9 Aug 2023 19:13:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F0B1DC433C8; Wed, 9 Aug 2023 19:13:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1691608394; bh=LeVB41u38/bhZJrLFYAIuDBKlGLS2oWJkoZGthUq6Jo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=foNa56/Lvq4BCC02Q0ZTTK/jrSpYteAeDNQMdVNsyuFpsa9NA9veVhr1OryMX+6Y1 5eo69vm1HvoiTG/+RFjyCQUESdxy1N0V+PJuoo1I77HXUdV3RoOcJFCZST144usBxk UqEJUWXAf0J7zQ9DhyHWd2jZwqL+H5iiHiKzAPlCHjXM+t4Kc8ZU3QdqHoA9saStRU Pnz4Y7aXVJn7GLkEWc2VbOhGhLklgpJvPd9SppbWmrEeCxXm3cUUU3eFiZoNv7QEqV x4aWcmFpjm9Wc5o5cBSbEX5yduts81Vog3ta1qctnKYw0yuKy+UFvwlpdkybvwANvG 8jGt+6GCg8oFw== Date: Wed, 9 Aug 2023 21:13:10 +0200 From: Andi Shyti To: Nick Desaulniers Cc: Jean Delvare , Nathan Chancellor , Tom Rix , linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org, llvm@lists.linux.dev, kernel test robot Subject: Re: [PATCH] i2c/busses: fix -Wmissing-variable-declarations Message-ID: <20230809191310.atpqztlpgdbdvc5m@intel.intel> References: <20230808-i2c-amd_static-v1-1-1902f608bba1@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230808-i2c-amd_static-v1-1-1902f608bba1@google.com> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 Hi Nick, On Tue, Aug 08, 2023 at 09:56:16AM -0700, Nick Desaulniers wrote: > I'm looking to enable -Wmissing-variable-declarations behind W=1. 0day > bot spotted the following instance: > > drivers/i2c/busses/i2c-amd756.c:286:20: warning: no previous extern > declaration for non-static variable 'amd756_smbus' > [-Wmissing-variable-declarations] > 286 | struct i2c_adapter amd756_smbus = { > | ^ > drivers/i2c/busses/i2c-amd756.c:286:1: note: declare 'static' if the > variable is not intended to be used outside of this translation unit > 286 | struct i2c_adapter amd756_smbus = { > | ^ > > This symbol is referenced by more than one translation unit, so create > then include the correct header for their declarations. > > Reported-by: kernel test robot > Closes: https://lore.kernel.org/llvm/202308081000.tTL1ElTr-lkp@intel.com/ > Signed-off-by: Nick Desaulniers You might want to have a Fixes tag here and Cc: Jean Delvare [...] > --- /dev/null > +++ b/drivers/i2c/busses/i2c-amd756.h > @@ -0,0 +1,3 @@ > +/* SPDX-License-Identifier: GPL-2.0 */ Please, leave a space here. And you might also want to have something like: #ifndef __I2C_AMD_756_H__ #define __I2C_AMD_756_H__ > +#include space here. > +extern struct i2c_adapter amd756_smbus; #endif /* __I2C_AMD_756_H__ */ Jean, any opinion on this patch, I don't really know this driver, but is there a way to avoid this extern declaration. Thanks, Andi