drivers/pinctrl/renesas/pinctrl-rzg2l.c:1048:19: warning: variable 'irq' is uninitialized when used here
From: kernel test robot
Date: Mon Sep 27 2021 - 19:38:40 EST
tree: https://github.com/0day-ci/linux/commits/Lad-Prabhakar/Renesas-RZ-G2L-IRQC-support/20210922-114225
head: 148cc816430df44e59684c9d9d841517efebdd02
commit: 87298d46797ed3e16804c5662b4338243d1548f4 pinctrl: renesas: pinctrl-rzg2l: Add IRQ domain to handle GPIO interrupt
date: 6 days ago
config: arm64-randconfig-r012-20210927 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project dc6e8dfdfe7efecfda318d43a06fae18b40eb498)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install arm64 cross compiling tool for clang build
# apt-get install binutils-aarch64-linux-gnu
# https://github.com/0day-ci/linux/commit/87298d46797ed3e16804c5662b4338243d1548f4
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Lad-Prabhakar/Renesas-RZ-G2L-IRQC-support/20210922-114225
git checkout 87298d46797ed3e16804c5662b4338243d1548f4
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=arm64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>
All warnings (new ones prefixed by >>):
>> drivers/pinctrl/renesas/pinctrl-rzg2l.c:1048:19: warning: variable 'irq' is uninitialized when used here [-Wuninitialized]
chip_data->irq = irq;
^~~
drivers/pinctrl/renesas/pinctrl-rzg2l.c:1029:9: note: initialize the variable 'irq' to silence this warning
int irq, ret;
^
= 0
1 warning generated.
vim +/irq +1048 drivers/pinctrl/renesas/pinctrl-rzg2l.c
1019
1020 static int rzg2l_gpio_irq_domain_alloc(struct irq_domain *domain,
1021 unsigned int virq,
1022 unsigned int nr_irqs, void *arg)
1023 {
1024 struct rzg2l_pinctrl_irq_chip_data *chip_data = NULL;
1025 struct rzg2l_pinctrl *pctrl = domain->host_data;
1026 struct irq_fwspec parent_fwspec;
1027 irq_hw_number_t hwirq;
1028 unsigned int type;
1029 int irq, ret;
1030 int gpioint;
1031
1032 if (WARN_ON(nr_irqs != 1))
1033 return -EINVAL;
1034
1035 ret = irq_domain_translate_twocell(domain, arg, &hwirq, &type);
1036 if (ret)
1037 return ret;
1038
1039 gpioint = rzg2l_gpio_get_gpioint(hwirq);
1040 if (gpioint < 0)
1041 return ret;
1042
1043 chip_data = kzalloc(sizeof(*chip_data), GFP_KERNEL);
1044 if (!chip_data)
1045 return -ENOMEM;
1046
1047 chip_data->pctrl = pctrl;
> 1048 chip_data->irq = irq;
1049 ret = irq_domain_set_hwirq_and_chip(domain, virq, hwirq,
1050 &pctrl->irq_chip, chip_data);
1051 if (ret)
1052 goto free_data;
1053
1054 /* parent is IRQC */
1055 parent_fwspec.fwnode = domain->parent->fwnode;
1056 parent_fwspec.param_count = 3;
1057 parent_fwspec.param[0] = gpioint;
1058 parent_fwspec.param[1] = type;
1059 parent_fwspec.param[2] = 1;
1060 ret = irq_domain_alloc_irqs_parent(domain, virq, 1, &parent_fwspec);
1061 if (ret)
1062 goto free_data;
1063
1064 return 0;
1065
1066 free_data:
1067 kfree(chip_data);
1068 return ret;
1069 }
1070
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx
Attachment:
.config.gz
Description: application/gzip