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, 16 May 2023 15:49:16 +0200
From:   jerome Neanne <jneanne@...libre.com>
To:     Bartosz Golaszewski <brgl@...ev.pl>
Cc:     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 15/05/2023 17:36, Bartosz Golaszewski wrote:
>> +static const struct gpio_chip tps65219_gpio_chip = {
>> +       .label                  = "tps65219-gpio",
>> +       .owner                  = THIS_MODULE,
>> +       .get_direction          = tps65219_gpio_get_direction,
>> +       .direction_input        = tps65219_gpio_direction_input,
>> +       .direction_output       = tps65219_gpio_direction_output,
>> +       .get                    = tps65219_gpio_get,
>> +       .set                    = tps65219_gpio_set,
>> +       .base                   = -1,
>> +       .ngpio                  = 3,
>> +       .can_sleep              = true,
>> +};
>> +
>> +static int tps65219_gpio_probe(struct platform_device *pdev)
>> +{
>> +       struct tps65219 *tps = dev_get_drvdata(pdev->dev.parent);
>> +       struct tps65219_gpio *gpio;
>> +
>> +       gpio = devm_kzalloc(&pdev->dev, sizeof(*gpio), GFP_KERNEL);
>> +       if (!gpio)
>> +               return -ENOMEM;
>> +
>> +       gpio->tps = tps;
>> +       gpio->gpio_chip = tps65219_gpio_chip;
> 
> Aren't you getting any warnings here about dropping the 'const' from
> the global structure?
I tried a build with W=1 to check for warning I might have missed but 
can't catch any here.
It's done in the exact same way in many other upstream drivers.
Anyway I can remove the const here if you think that could create 
trouble at some point.

Just let me know your recommendation.

Regards,
Jerome

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ