lkml.org 
[lkml]   [2021]   [Feb]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectdrivers/pinctrl/qcom/pinctrl-lpass-lpi.c:458 lpi_config_set() error: uninitialized symbol 'strength'.
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 2c87f7a38f930ef6f6a7bdd04aeb82ce3971b54b
commit: 6e261d1090d6db0e9dd22978b6f38a2c58558a3f pinctrl: qcom: Add sm8250 lpass lpi pinctrl driver
config: arm64-randconfig-m031-20210226 (attached as .config)
compiler: aarch64-linux-gcc (GCC) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

New smatch warnings:
drivers/pinctrl/qcom/pinctrl-lpass-lpi.c:458 lpi_config_set() error: uninitialized symbol 'strength'.

Old smatch warnings:
drivers/pinctrl/qcom/pinctrl-lpass-lpi.c:457 lpi_config_set() error: uninitialized symbol 'pullup'.

vim +/strength +458 drivers/pinctrl/qcom/pinctrl-lpass-lpi.c

6e261d1090d6db Srinivas Kandagatla 2020-12-02 391 static int lpi_config_set(struct pinctrl_dev *pctldev, unsigned int group,
6e261d1090d6db Srinivas Kandagatla 2020-12-02 392 unsigned long *configs, unsigned int nconfs)
6e261d1090d6db Srinivas Kandagatla 2020-12-02 393 {
6e261d1090d6db Srinivas Kandagatla 2020-12-02 394 struct lpi_pinctrl *pctrl = dev_get_drvdata(pctldev->dev);
6e261d1090d6db Srinivas Kandagatla 2020-12-02 395 unsigned int param, arg, pullup, strength;
^^^^^^^^

6e261d1090d6db Srinivas Kandagatla 2020-12-02 396 bool value, output_enabled = false;
6e261d1090d6db Srinivas Kandagatla 2020-12-02 397 const struct lpi_pingroup *g;
6e261d1090d6db Srinivas Kandagatla 2020-12-02 398 unsigned long sval;
6e261d1090d6db Srinivas Kandagatla 2020-12-02 399 int i, slew_offset;
6e261d1090d6db Srinivas Kandagatla 2020-12-02 400 u32 val;
6e261d1090d6db Srinivas Kandagatla 2020-12-02 401
6e261d1090d6db Srinivas Kandagatla 2020-12-02 402 g = &pctrl->data->groups[group];
6e261d1090d6db Srinivas Kandagatla 2020-12-02 403 for (i = 0; i < nconfs; i++) {
6e261d1090d6db Srinivas Kandagatla 2020-12-02 404 param = pinconf_to_config_param(configs[i]);
6e261d1090d6db Srinivas Kandagatla 2020-12-02 405 arg = pinconf_to_config_argument(configs[i]);
6e261d1090d6db Srinivas Kandagatla 2020-12-02 406
6e261d1090d6db Srinivas Kandagatla 2020-12-02 407 switch (param) {
6e261d1090d6db Srinivas Kandagatla 2020-12-02 408 case PIN_CONFIG_BIAS_DISABLE:
6e261d1090d6db Srinivas Kandagatla 2020-12-02 409 pullup = LPI_GPIO_BIAS_DISABLE;
6e261d1090d6db Srinivas Kandagatla 2020-12-02 410 break;
6e261d1090d6db Srinivas Kandagatla 2020-12-02 411 case PIN_CONFIG_BIAS_PULL_DOWN:
6e261d1090d6db Srinivas Kandagatla 2020-12-02 412 pullup = LPI_GPIO_PULL_DOWN;
6e261d1090d6db Srinivas Kandagatla 2020-12-02 413 break;
6e261d1090d6db Srinivas Kandagatla 2020-12-02 414 case PIN_CONFIG_BIAS_BUS_HOLD:
6e261d1090d6db Srinivas Kandagatla 2020-12-02 415 pullup = LPI_GPIO_KEEPER;
6e261d1090d6db Srinivas Kandagatla 2020-12-02 416 break;
6e261d1090d6db Srinivas Kandagatla 2020-12-02 417 case PIN_CONFIG_BIAS_PULL_UP:
6e261d1090d6db Srinivas Kandagatla 2020-12-02 418 pullup = LPI_GPIO_PULL_UP;
6e261d1090d6db Srinivas Kandagatla 2020-12-02 419 break;
6e261d1090d6db Srinivas Kandagatla 2020-12-02 420 case PIN_CONFIG_INPUT_ENABLE:
6e261d1090d6db Srinivas Kandagatla 2020-12-02 421 output_enabled = false;
6e261d1090d6db Srinivas Kandagatla 2020-12-02 422 break;
6e261d1090d6db Srinivas Kandagatla 2020-12-02 423 case PIN_CONFIG_OUTPUT:
6e261d1090d6db Srinivas Kandagatla 2020-12-02 424 output_enabled = true;
6e261d1090d6db Srinivas Kandagatla 2020-12-02 425 value = arg;
6e261d1090d6db Srinivas Kandagatla 2020-12-02 426 break;
6e261d1090d6db Srinivas Kandagatla 2020-12-02 427 case PIN_CONFIG_DRIVE_STRENGTH:
6e261d1090d6db Srinivas Kandagatla 2020-12-02 428 strength = arg;
^^^^^^^^^^^^^^^
Only initialized here.

6e261d1090d6db Srinivas Kandagatla 2020-12-02 429 break;
6e261d1090d6db Srinivas Kandagatla 2020-12-02 430 case PIN_CONFIG_SLEW_RATE:
6e261d1090d6db Srinivas Kandagatla 2020-12-02 431 if (arg > LPI_SLEW_RATE_MAX) {
6e261d1090d6db Srinivas Kandagatla 2020-12-02 432 dev_err(pctldev->dev, "invalid slew rate %u for pin: %d\n",
6e261d1090d6db Srinivas Kandagatla 2020-12-02 433 arg, group);
6e261d1090d6db Srinivas Kandagatla 2020-12-02 434 return -EINVAL;
6e261d1090d6db Srinivas Kandagatla 2020-12-02 435 }
6e261d1090d6db Srinivas Kandagatla 2020-12-02 436
6e261d1090d6db Srinivas Kandagatla 2020-12-02 437 slew_offset = g->slew_offset;
6e261d1090d6db Srinivas Kandagatla 2020-12-02 438 if (slew_offset == NO_SLEW)
6e261d1090d6db Srinivas Kandagatla 2020-12-02 439 break;
6e261d1090d6db Srinivas Kandagatla 2020-12-02 440
6e261d1090d6db Srinivas Kandagatla 2020-12-02 441 mutex_lock(&pctrl->slew_access_lock);
6e261d1090d6db Srinivas Kandagatla 2020-12-02 442
6e261d1090d6db Srinivas Kandagatla 2020-12-02 443 sval = ioread32(pctrl->slew_base + LPI_SLEW_RATE_CTL_REG);
6e261d1090d6db Srinivas Kandagatla 2020-12-02 444 sval &= ~(LPI_SLEW_RATE_MASK << slew_offset);
6e261d1090d6db Srinivas Kandagatla 2020-12-02 445 sval |= arg << slew_offset;
6e261d1090d6db Srinivas Kandagatla 2020-12-02 446 iowrite32(sval, pctrl->slew_base + LPI_SLEW_RATE_CTL_REG);
6e261d1090d6db Srinivas Kandagatla 2020-12-02 447
6e261d1090d6db Srinivas Kandagatla 2020-12-02 448 mutex_unlock(&pctrl->slew_access_lock);
6e261d1090d6db Srinivas Kandagatla 2020-12-02 449 break;
6e261d1090d6db Srinivas Kandagatla 2020-12-02 450 default:
6e261d1090d6db Srinivas Kandagatla 2020-12-02 451 return -EINVAL;
6e261d1090d6db Srinivas Kandagatla 2020-12-02 452 }
6e261d1090d6db Srinivas Kandagatla 2020-12-02 453 }
6e261d1090d6db Srinivas Kandagatla 2020-12-02 454
6e261d1090d6db Srinivas Kandagatla 2020-12-02 455 val = lpi_gpio_read(pctrl, group, LPI_GPIO_CFG_REG);
6e261d1090d6db Srinivas Kandagatla 2020-12-02 456
6e261d1090d6db Srinivas Kandagatla 2020-12-02 457 u32p_replace_bits(&val, pullup, LPI_GPIO_PULL_MASK);
6e261d1090d6db Srinivas Kandagatla 2020-12-02 @458 u32p_replace_bits(&val, LPI_GPIO_DS_TO_VAL(strength),
^^^^^^^^

6e261d1090d6db Srinivas Kandagatla 2020-12-02 459 LPI_GPIO_OUT_STRENGTH_MASK);
6e261d1090d6db Srinivas Kandagatla 2020-12-02 460 u32p_replace_bits(&val, output_enabled, LPI_GPIO_OE_MASK);
6e261d1090d6db Srinivas Kandagatla 2020-12-02 461
6e261d1090d6db Srinivas Kandagatla 2020-12-02 462 lpi_gpio_write(pctrl, group, LPI_GPIO_CFG_REG, val);
6e261d1090d6db Srinivas Kandagatla 2020-12-02 463
6e261d1090d6db Srinivas Kandagatla 2020-12-02 464 if (output_enabled) {
6e261d1090d6db Srinivas Kandagatla 2020-12-02 465 val = u32_encode_bits(value ? 1 : 0, LPI_GPIO_VALUE_OUT_MASK);
6e261d1090d6db Srinivas Kandagatla 2020-12-02 466 lpi_gpio_write(pctrl, group, LPI_GPIO_VALUE_REG, val);
6e261d1090d6db Srinivas Kandagatla 2020-12-02 467 }
6e261d1090d6db Srinivas Kandagatla 2020-12-02 468
6e261d1090d6db Srinivas Kandagatla 2020-12-02 469 return 0;
6e261d1090d6db Srinivas Kandagatla 2020-12-02 470 }

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[unhandled content-type:application/gzip]
\
 
 \ /
  Last update: 2021-02-27 10:24    [W:0.124 / U:0.768 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site