Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1658286imm; Fri, 22 Jun 2018 23:27:22 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIPLIs0ZcHOxpjIR/xVqQGTUF50k4DteKRPyaVwA115oasqXZCIfcQ5ec6FTnRNcsCGr/7j X-Received: by 2002:a62:b90f:: with SMTP id z15-v6mr4682492pfe.254.1529735242044; Fri, 22 Jun 2018 23:27:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529735242; cv=none; d=google.com; s=arc-20160816; b=dMzjOaaJnxn9wneoO1Wi+0Wpg8IodaguSseUvNzxeBen7gGWVjjrKXLDCKu7/q6anl fkE5RrfeA7+X3OdoRY3poj0+yCa4l3A5e87kl9zrCyCMon5EkzsF/uEZHmMiQI/dPjDc m5k+CRJiAUscq6XzOQhilGn2CAu2UACHXw++IByHIgpWkeLyKVDuKRORrGV7H7b/tA7L co7K3OTTvCRdbS15qk3TgiKcreAsRbDEpn4rgM7bdvVqDuxf7kWDCFT3hnC/N+u6ezvx xS/4CmXKTGsDbmOfnotbZYmLPyK/2+BbmYnqO6lN5goua1qt56EezxkqZVMNN6MYBJwd Kv0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date :arc-authentication-results; bh=Cu6VIhpVPLhZq7qIF0jI1uyYgx6nFK9x8N9vAGSn+ZM=; b=mQfrIYnLPbcOVmpmntWttaDxJTn4mTdxkxLkuD9tJ18kyZ/xDBOUCiVILogQGmQ6qv FNlhMAdBDmAyrjWILvNbOtlPgpFO8+NAluKWjyqMyi/wTGFITEk6LCWXS9VwWTJmPRGC +l+cRRTSvzPj4mxGLPMdx2Br/KKaJDktyW1XqVOp4vRIUw9V93NzZIlJY8kIlakleTXQ 9hIL9pQ4GNWH5RL7NBNiz9EKvgmRTkzLHSAcgsxR1ySdF6BNRbWG7qZFv/Pn1TqluDSj puw+JF2FvBRig3IvlfchZh5evInbTvwAoh3LC7jvU34RCvyfWnEG8O0KsCkUwVkTwBqM K/XA== ARC-Authentication-Results: i=1; mx.google.com; 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 m1-v6si8858916pfk.56.2018.06.22.23.26.29; Fri, 22 Jun 2018 23:27:22 -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; 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 S1751442AbeFWGY3 (ORCPT + 99 others); Sat, 23 Jun 2018 02:24:29 -0400 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:26289 "EHLO mail3-relais-sop.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751377AbeFWGY2 (ORCPT ); Sat, 23 Jun 2018 02:24:28 -0400 X-IronPort-AV: E=Sophos;i="5.51,260,1526335200"; d="scan'208";a="269708461" Received: from abo-154-110-68.mrs.modulonet.fr (HELO [192.168.0.15]) ([85.68.110.154]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Jun 2018 08:24:26 +0200 Date: Sat, 23 Jun 2018 08:24:26 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@hadrien To: Darren Hart 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 In-Reply-To: <20180623002237.GG27466@fury> Message-ID: References: <20180621181524.30550-1-colin.king@canonical.com> <20180623002237.GG27466@fury> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. julia > > I'm not finding a position on this in coding-style. > > Andy, do you care to weigh in on this? > > -- > Darren Hart > VMware Open Source Technology Center > -- > To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html >