lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 26 Jun 2018 22:32:17 +0300
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Darren Hart <dvhart@...radead.org>
Cc:     Colin King <colin.king@...onical.com>,
        Mario Limonciello <mario.limonciello@...l.com>,
        Andy Shevchenko <andy@...radead.org>,
        Platform Driver <platform-driver-x86@...r.kernel.org>,
        kernel-janitors@...r.kernel.org,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] platform/x86: dell-smbios: make a function and a pointer static

On Sat, Jun 23, 2018 at 3:22 AM, Darren Hart <dvhart@...radead.org> wrote:
> On Thu, Jun 21, 2018 at 07:15:24PM +0100, Colin King wrote:
>> From: Colin Ian King <colin.king@...onical.com>
>>
>> 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?


>> -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.
>
> I'm not finding a position on this in coding-style.
>
> Andy, do you care to weigh in on this?

We are using static keyword by almost all callback defined functions,
so, for my point of view it's pretty much okay.

-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ