Hi Krzysztof,

url:    
https://github.com/0day-ci/linux/commits/Krzysztof-Kozlowski/gpio-Add-devm_fwnode_gpiod_get_optional-helpers/20200827-041021
base:   https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git 
for-next
config: x86_64-randconfig-m001-20200826 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>
Reported-by: Dan Carpenter <[email protected]>

New smatch warnings:
drivers/input/keyboard/gpio_keys.c:500 gpio_keys_setup_key() error: 
uninitialized symbol 'error'.

# 
https://github.com/0day-ci/linux/commit/e138d2340a72b4f117d0da36fe7cddb4bc073c58
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review 
Krzysztof-Kozlowski/gpio-Add-devm_fwnode_gpiod_get_optional-helpers/20200827-041021
git checkout e138d2340a72b4f117d0da36fe7cddb4bc073c58
vim +/error +500 drivers/input/keyboard/gpio_keys.c

5298cc4cc753bb Bill Pemberton      2012-11-23  477  static int 
gpio_keys_setup_key(struct platform_device *pdev,
d9080921aa32c7 Dmitry Torokhov     2012-03-18  478                              
struct input_dev *input,
83e4947a569f4d Hans de Goede       2017-01-21  479                              
struct gpio_keys_drvdata *ddata,
700a38b27eefc5 Dmitry Torokhov     2016-10-19  480                              
const struct gpio_keys_button *button,
83e4947a569f4d Hans de Goede       2017-01-21  481                              
int idx,
700a38b27eefc5 Dmitry Torokhov     2016-10-19  482                              
struct fwnode_handle *child)
bc8f1eaf68a8aa Ben Dooks           2009-11-10  483  {
92a47674f57b4a Alexander Stein     2011-04-11  484      const char *desc = 
button->desc ? button->desc : "gpio_keys";
9e3af04f878731 Mika Westerberg     2010-02-04  485      struct device *dev = 
&pdev->dev;
83e4947a569f4d Hans de Goede       2017-01-21  486      struct gpio_button_data 
*bdata = &ddata->data[idx];
d8ee4a1c90529e Laxman Dewangan     2012-03-19  487      irq_handler_t isr;
9e3af04f878731 Mika Westerberg     2010-02-04  488      unsigned long irqflags;
27245519f0de50 Alexander Shiyan    2014-04-28  489      int irq;
27245519f0de50 Alexander Shiyan    2014-04-28  490      int error;
                                                        ^^^^^^^^^

bc8f1eaf68a8aa Ben Dooks           2009-11-10  491  
d9080921aa32c7 Dmitry Torokhov     2012-03-18  492      bdata->input = input;
d9080921aa32c7 Dmitry Torokhov     2012-03-18  493      bdata->button = button;
d8ee4a1c90529e Laxman Dewangan     2012-03-19  494      
spin_lock_init(&bdata->lock);
d8ee4a1c90529e Laxman Dewangan     2012-03-19  495  
700a38b27eefc5 Dmitry Torokhov     2016-10-19  496      if (child) {
e138d2340a72b4 Krzysztof Kozlowski 2020-08-26  497              bdata->gpiod = 
devm_fwnode_gpiod_get_optional(dev, child, NULL,
e138d2340a72b4 Krzysztof Kozlowski 2020-08-26  498                              
                              GPIOD_IN, desc);
e138d2340a72b4 Krzysztof Kozlowski 2020-08-26  499              if 
(IS_ERR(bdata->gpiod))
e138d2340a72b4 Krzysztof Kozlowski 2020-08-26 @500                      return 
dev_err_probe(dev, error, "failed to get gpio\n");
                                                                                
                  ^^^^^
Uninitialized

700a38b27eefc5 Dmitry Torokhov     2016-10-19  501      } else if 
(gpio_is_valid(button->gpio)) {
5feeca3c1e39c0 Geert Uytterhoeven  2016-10-19  502              /*
5feeca3c1e39c0 Geert Uytterhoeven  2016-10-19  503               * Legacy GPIO 
number, so request the GPIO here and
5feeca3c1e39c0 Geert Uytterhoeven  2016-10-19  504               * convert it 
to descriptor.
5feeca3c1e39c0 Geert Uytterhoeven  2016-10-19  505               */
5feeca3c1e39c0 Geert Uytterhoeven  2016-10-19  506              unsigned flags 
= GPIOF_IN;
5feeca3c1e39c0 Geert Uytterhoeven  2016-10-19  507  
5feeca3c1e39c0 Geert Uytterhoeven  2016-10-19  508              if 
(button->active_low)
5feeca3c1e39c0 Geert Uytterhoeven  2016-10-19  509                      flags 
|= GPIOF_ACTIVE_LOW;
bc8f1eaf68a8aa Ben Dooks           2009-11-10  510  
b4e66e7d1948e0 Guenter Roeck       2017-01-21  511              error = 
devm_gpio_request_one(dev, button->gpio, flags, desc);
bc8f1eaf68a8aa Ben Dooks           2009-11-10  512              if (error < 0) {
d8ee4a1c90529e Laxman Dewangan     2012-03-19  513                      
dev_err(dev, "Failed to request GPIO %d, error %d\n",
bc8f1eaf68a8aa Ben Dooks           2009-11-10  514                              
button->gpio, error);
d8ee4a1c90529e Laxman Dewangan     2012-03-19  515                      return 
error;
bc8f1eaf68a8aa Ben Dooks           2009-11-10  516              }
bc8f1eaf68a8aa Ben Dooks           2009-11-10  517  
5feeca3c1e39c0 Geert Uytterhoeven  2016-10-19  518              bdata->gpiod = 
gpio_to_desc(button->gpio);
5feeca3c1e39c0 Geert Uytterhoeven  2016-10-19  519              if 
(!bdata->gpiod)
5feeca3c1e39c0 Geert Uytterhoeven  2016-10-19  520                      return 
-EINVAL;
700a38b27eefc5 Dmitry Torokhov     2016-10-19  521      }

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]

Attachment: .config.gz
Description: application/gzip

_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to