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]
Message-ID: <0cf870f1-8cdb-df74-79d6-a4004cdfcc2f@baylibre.com>
Date:   Tue, 23 May 2023 11:09:51 +0200
From:   jerome Neanne <jneanne@...libre.com>
To:     Andy Shevchenko <andy.shevchenko@...il.com>
Cc:     Bartosz Golaszewski <brgl@...ev.pl>,
        Linus Walleij <linus.walleij@...aro.org>,
        Tony Lindgren <tony@...mide.com>, Lee Jones <lee@...nel.org>,
        linux-kernel@...r.kernel.org, linux-gpio@...r.kernel.org,
        linux-omap@...r.kernel.org,
        Jonathan Cormier <jcormier@...ticallink.com>
Subject: Re: [PATCH v2 1/2] gpio: tps65219: add GPIO support for TPS65219 PMIC



On 22/05/2023 13:18, Andy Shevchenko wrote:
> On Mon, May 22, 2023 at 10:47 AM jerome Neanne <jneanne@...libre.com> wrote:
>> On 20/05/2023 11:44, andy.shevchenko@...il.com wrote:
>>> Mon, May 15, 2023 at 05:36:46PM +0200, Bartosz Golaszewski kirjoitti:
>>>> On Thu, May 11, 2023 at 4:09 PM Jerome Neanne <jneanne@...libre.com> wrote:
> 
> ...
> 
>>>>> +       gpio->gpio_chip = tps65219_gpio_chip;
>>>>
>>>> Aren't you getting any warnings here about dropping the 'const' from
>>>> the global structure?
>>>
>>> But this is a copy of the contents and not the simple pointer.
> 
> I commented on Bart's question.
> 
>> In many other places where this is done, the struct is declared like:
>>
>> static const struct gpio_chip template_chip = {
>>
>> After internal review, I changed this to:
>>
>> static const struct gpio_chip tps65219_gpio_chip = {
>>
>> This is because I didn't want to have this "template" that sounds to me
>> like "dummy". Maybe I misunderstood and this "template" was used on
>> purpose because this const struct is just copied once to initialize
>> tps65219_gpio->gpio_chip during probe.
>>
>> Introducing tps65219_gpio_chip name is maybe confusing with
>> tps65219_gpio struct.
>>
>> I think the const should not be a problem here but the naming I used
>> might be misleading. If you have a suggestion of what is a good practice
>> to make this piece of code clearer. I'll follow your suggestion (use
>> template? more_explicit name like ???).
> 
> It's up to Bart.
> 
Bart, should I keep the code like this or do you suggest a name change 
so that's it's more appealing?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ