Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp5612936imm; Tue, 26 Jun 2018 14:36:17 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLpJIlFk+MERLTEqyw/14UR4eav4tezYWMSnQG4m5+JsDFxoPWxLpe1XAkmuvsaxK5Wdx6I X-Received: by 2002:a17:902:280b:: with SMTP id e11-v6mr3222040plb.298.1530048977499; Tue, 26 Jun 2018 14:36:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530048977; cv=none; d=google.com; s=arc-20160816; b=F6NJqgjLWzh9uIk1rY9CcbxDL3bBZSRZvmsWfTpx5FamOpytP7+YT/vt8dMjv+kg2S mwTeDgU9SajZYo82JkXx/SHC9rpPBqbJPkiS7wGgBW+FoOSKD4MC31cqsmHuhhFBMfHY KfVgwiDUq4bKKnycYxEpq/XlJdF9Vv4P7FBYlasmH4wQaXXSNdnN4VCyHsPTIhYiYLjV GL4tNFJRsoNveVoAqQDdoENYoSluWWcKBzo6B9BJeksdjRTj3qy9/l8iHyevvBmb+R5y sAiBCJL2S+XyHylr0DD9010WzaEC9JVLGFyBDC3d5SqQ6V4kzRgNfIeVbv9SedZ0P6LG neCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=OgSwYmnGww2ElL7BKZyxeu0ytNz07pvRvAYnrB0tfuU=; b=Oqyr0fhjIyrHiOM6XxeaG2f9nmlHJKzxpFXN6jxUIlzmlP4yeHGutONOw07tiwnfKB bjsn8Hwfsa1VYFkHa6pqGgCFNxL/CVoxng3CNQtljrNZqa2UBd1zrQoTo8dboJKBgy3z xsRRzoiZFw9yJlrxlDUHGLnACrngUQv/zkbg9PQlPd3N6le5LUWwBFQIFyu7Vbmh9OTf ZeCTpaiNfufYVk43Rjz9tzFBpm84fDiR3gAKfQj0adsScnMHuVOHYnk9lYmw9xK3sDRD L+tt07fAKMYaSMWppbMZfWv8KxsEg1zcxmu724sEAEewvMjCp2JvLAJnar/nhI/X+Io8 P8nQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=qvLw38Za; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w13-v6si2399718plp.51.2018.06.26.14.36.02; Tue, 26 Jun 2018 14:36:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=qvLw38Za; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932624AbeFZVe7 (ORCPT + 99 others); Tue, 26 Jun 2018 17:34:59 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:53960 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752258AbeFZVe6 (ORCPT ); Tue, 26 Jun 2018 17:34:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=OgSwYmnGww2ElL7BKZyxeu0ytNz07pvRvAYnrB0tfuU=; b=qvLw38ZaMlHMRgKPU9gbjtcmH rz+oD6uHpfArtS8X3UgUJ9fv8Irr3zNmXfTnbj1kY5V0KloZ9SgsFj2snrmmqt402KJz4GahX7sXd /CgB7r/KsojpvsE98DfM2JYpTy4FLGt8FCS1MUMCw6WA12/JsfnCnQPtBwG/i0iEOHriuxh9DcdCq ToeHS0Dr69nG7ugLhunnHt99EeVR7rtlXf2VwtkzFiSR4IO+J6leYrJDcE/BULxS9KWMcBwrZiNd4 o8fKaL8KfrKV3rVt58rkLRJ2RQLoiHFr2dNbjetxW7757JRiGR7KJJgFuDYqvB5ZOeB44hkd8orUy UmJ/guvVA==; Received: from dvhart by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1fXvbv-0004t1-Q6; Tue, 26 Jun 2018 21:34:51 +0000 Date: Tue, 26 Jun 2018 14:34:50 -0700 From: Darren Hart To: Julia Lawall Cc: Colin King , Mario Limonciello , Andy Shevchenko , platform-driver-x86@vger.kernel.org, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] platform/x86: dell-smbios: make a function and a pointer static Message-ID: <20180626213450.GB4945@fury> References: <20180621181524.30550-1-colin.king@canonical.com> <20180623002237.GG27466@fury> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jun 23, 2018 at 08:24:26AM +0200, Julia Lawall wrote: > > > On Fri, 22 Jun 2018, Darren Hart wrote: > > > On Thu, Jun 21, 2018 at 07:15:24PM +0100, Colin King wrote: > > > From: Colin Ian King > > > > > > The function dell_smbios_smm_call and pointer platform_device are > > > local to the source and do not need to be in global scope, so make > > > them static. > > > > > > Cleans up sparse warnings: > > > warning: symbol 'platform_device' was not declared. Should it be static? > > > warning: symbol 'dell_smbios_smm_call' was not declared. Should it be > > > static? > > > > > > Signed-off-by: Colin Ian King > > > --- > > > drivers/platform/x86/dell-smbios-smm.c | 4 ++-- > > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > > > diff --git a/drivers/platform/x86/dell-smbios-smm.c b/drivers/platform/x86/dell-smbios-smm.c > > > index e9e9da556318..97a90bebc360 100644 > > > --- a/drivers/platform/x86/dell-smbios-smm.c > > > +++ b/drivers/platform/x86/dell-smbios-smm.c > > > @@ -24,7 +24,7 @@ > > > static int da_command_address; > > > static int da_command_code; > > > static struct calling_interface_buffer *buffer; > > > -struct platform_device *platform_device; > > > +static struct platform_device *platform_device; > > > static DEFINE_MUTEX(smm_mutex); > > > > > > static const struct dmi_system_id dell_device_table[] __initconst = { > > > @@ -82,7 +82,7 @@ static void find_cmd_address(const struct dmi_header *dm, void *dummy) > > > } > > > } > > > > > > -int dell_smbios_smm_call(struct calling_interface_buffer *input) > > > +static int dell_smbios_smm_call(struct calling_interface_buffer *input) > > > > Hrm. So these are passed by pointer to dell_smbios_register_device(), which is in > > turn called by dell_smbios_call() from dell-smbios-base.c. > > > > So while it is valid to make these static, since we're not referencing the > > symbol, but the pointer value instead - I do worry about the "static" suggesting > > to someone reading the code that this data is not used outside of this file, > > when it is. > > Static protects the name. The name in this case is very generic. Indeed "platform_device" is even more generic than I'd like for a static ;-) -- Darren Hart VMware Open Source Technology Center