Skip to contentSkip to conversation

drivers/gpio/gpio-mpfs.c:142 mpfs_gpio_irq_set_type() error: uninitialized symbol 'interrupt_type'.

PATCH kernel test robot 1 participant 1 message Nov 7, 2024

lore
Share & tools
lore

kernel test robot

author build bot
#0 lore raw

BCC: [email protected]
CC: [email protected]
TO: Conor Dooley <[email protected]>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/conor/linux.git gpio-irq-regmap
head:   d1b7c5558fb6dded2dee2cfebe358de0d93f022e
commit: 3166771fc5c026351f261c9332a04a63401a747a [17/18] gpio: mpfs: Add interrupt support

:::::: branch date: 2 days ago
:::::: commit date: 2 days ago
config: loongarch-randconfig-r073-20241107 (https://download.01.org/0day-ci/archive/20241108/[email protected]/config)
compiler: loongarch64-linux-gcc (GCC) 14.2.0

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags

| Reported-by: kernel test robot <[email protected]>
| Reported-by: Dan Carpenter <[email protected]>
| Closes: https://lore.kernel.org/r/[email protected]/

smatch warnings:
drivers/gpio/gpio-mpfs.c:142 mpfs_gpio_irq_set_type() error: uninitialized symbol 'interrupt_type'.

vim +/interrupt_type +142 drivers/gpio/gpio-mpfs.c

af05583913c262 Lewis Hanly 2022-08-15  115  
3166771fc5c026 Lewis Hanly 2022-08-15  116  static int mpfs_gpio_irq_set_type(struct irq_data *data, unsigned int type)
3166771fc5c026 Lewis Hanly 2022-08-15  117  {
3166771fc5c026 Lewis Hanly 2022-08-15  118  	struct gpio_chip *gc = irq_data_get_irq_chip_data(data);
3166771fc5c026 Lewis Hanly 2022-08-15  119  	struct mpfs_gpio_chip *mpfs_gpio = gpiochip_get_data(gc);
3166771fc5c026 Lewis Hanly 2022-08-15  120  	int gpio_index = irqd_to_hwirq(data) % 32;
3166771fc5c026 Lewis Hanly 2022-08-15  121  	u32 interrupt_type;
3166771fc5c026 Lewis Hanly 2022-08-15  122  
3166771fc5c026 Lewis Hanly 2022-08-15  123  	switch (type) {
3166771fc5c026 Lewis Hanly 2022-08-15  124  	case IRQ_TYPE_EDGE_BOTH:
3166771fc5c026 Lewis Hanly 2022-08-15  125  		interrupt_type = MPFS_GPIO_TYPE_INT_EDGE_BOTH;
3166771fc5c026 Lewis Hanly 2022-08-15  126  		break;
3166771fc5c026 Lewis Hanly 2022-08-15  127  	case IRQ_TYPE_EDGE_FALLING:
3166771fc5c026 Lewis Hanly 2022-08-15  128  		interrupt_type = MPFS_GPIO_TYPE_INT_EDGE_NEG;
3166771fc5c026 Lewis Hanly 2022-08-15  129  		break;
3166771fc5c026 Lewis Hanly 2022-08-15  130  	case IRQ_TYPE_EDGE_RISING:
3166771fc5c026 Lewis Hanly 2022-08-15  131  		interrupt_type = MPFS_GPIO_TYPE_INT_EDGE_POS;
3166771fc5c026 Lewis Hanly 2022-08-15  132  		break;
3166771fc5c026 Lewis Hanly 2022-08-15  133  	case IRQ_TYPE_LEVEL_HIGH:
3166771fc5c026 Lewis Hanly 2022-08-15  134  		interrupt_type = MPFS_GPIO_TYPE_INT_LEVEL_HIGH;
3166771fc5c026 Lewis Hanly 2022-08-15  135  		break;
3166771fc5c026 Lewis Hanly 2022-08-15  136  	case IRQ_TYPE_LEVEL_LOW:
3166771fc5c026 Lewis Hanly 2022-08-15  137  		interrupt_type = MPFS_GPIO_TYPE_INT_LEVEL_LOW;
3166771fc5c026 Lewis Hanly 2022-08-15  138  		break;
3166771fc5c026 Lewis Hanly 2022-08-15  139  	}
3166771fc5c026 Lewis Hanly 2022-08-15  140  
3166771fc5c026 Lewis Hanly 2022-08-15  141  	regmap_update_bits(mpfs_gpio->regs, MPFS_GPIO_CTRL(gpio_index),
3166771fc5c026 Lewis Hanly 2022-08-15 @142  			   MPFS_GPIO_TYPE_INT_MASK, interrupt_type);
3166771fc5c026 Lewis Hanly 2022-08-15  143  
3166771fc5c026 Lewis Hanly 2022-08-15  144  	return 0;
3166771fc5c026 Lewis Hanly 2022-08-15  145  }
3166771fc5c026 Lewis Hanly 2022-08-15  146  
Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki