tree: https://gitee.com/openeuler/kernel.git openEuler-1.0-LTS head: 4c37b6449701a1fcb16050d4e517fa6d505673e1 commit: 00711bad7e372a30c4975ba43811ffa666aff0e1 [1297/1297] gpio: add phytium gpio driver config: x86_64-randconfig-r121-20241117 (https://download.01.org/0day-ci/archive/20241118/202411180247.fYG6VoE2-lkp@i...) compiler: clang version 19.1.3 (https://github.com/llvm/llvm-project ab51eccf88f5321e7c60591c5546b254b6afab99) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241118/202411180247.fYG6VoE2-lkp@i...)
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 lkp@intel.com | Closes: https://lore.kernel.org/oe-kbuild-all/202411180247.fYG6VoE2-lkp@intel.com/
sparse warnings: (new ones prefixed by >>) drivers/gpio/gpio-phytium-pci.c: note: in included file (through include/linux/kernel.h, include/linux/interrupt.h): /opt/cross/clang-ab51eccf88/lib/clang/19/include/stdarg.h:22:44: sparse: sparse: Expected ) in function call /opt/cross/clang-ab51eccf88/lib/clang/19/include/stdarg.h:22:44: sparse: sparse: got < /opt/cross/clang-ab51eccf88/lib/clang/19/include/stdarg.h:22:43: sparse: sparse: not a function <noident> /opt/cross/clang-ab51eccf88/lib/clang/19/include/stdarg.h:22:22: sparse: sparse: bad constant expression type drivers/gpio/gpio-phytium-pci.c: note: in included file (through include/linux/printk.h, include/linux/kernel.h, include/linux/interrupt.h): /opt/cross/clang-ab51eccf88/lib/clang/19/include/stdarg.h:22:44: sparse: sparse: Expected ) in function call /opt/cross/clang-ab51eccf88/lib/clang/19/include/stdarg.h:22:44: sparse: sparse: got < /opt/cross/clang-ab51eccf88/lib/clang/19/include/stdarg.h:22:43: sparse: sparse: not a function <noident> /opt/cross/clang-ab51eccf88/lib/clang/19/include/stdarg.h:22:22: sparse: sparse: bad constant expression type drivers/gpio/gpio-phytium-pci.c: note: in included file (through include/linux/string.h, include/linux/bitmap.h, include/linux/cpumask.h, ...): /opt/cross/clang-ab51eccf88/lib/clang/19/include/stdarg.h:22:44: sparse: sparse: Expected ) in function call /opt/cross/clang-ab51eccf88/lib/clang/19/include/stdarg.h:22:44: sparse: sparse: got < /opt/cross/clang-ab51eccf88/lib/clang/19/include/stdarg.h:22:43: sparse: sparse: not a function <noident> /opt/cross/clang-ab51eccf88/lib/clang/19/include/stdarg.h:22:22: sparse: sparse: bad constant expression type
drivers/gpio/gpio-phytium-pci.c:52:23: sparse: sparse: incompatible types for operation (<):
drivers/gpio/gpio-phytium-pci.c:52:23: sparse: int * drivers/gpio/gpio-phytium-pci.c:52:23: sparse: int
vim +52 drivers/gpio/gpio-phytium-pci.c
15 16 static int phytium_gpio_pci_probe(struct pci_dev *pdev, 17 const struct pci_device_id *id) 18 { 19 struct device *dev = &pdev->dev; 20 struct phytium_gpio *gpio; 21 struct gpio_irq_chip *girq; 22 int err; 23 24 gpio = devm_kzalloc(&pdev->dev, sizeof(*gpio), GFP_KERNEL); 25 if (!gpio) 26 return -ENOMEM; 27 28 err = pcim_enable_device(pdev); 29 if (err) { 30 dev_err(dev, "Failed to enable PCI device: err %d\n", err); 31 goto out; 32 } 33 34 err = pcim_iomap_regions(pdev, 1 << 0, pci_name(pdev)); 35 if (err) { 36 dev_err(dev, "Failed to iomap PCI device: err %d\n", err); 37 goto out; 38 } 39 40 gpio->regs = pcim_iomap_table(pdev)[0]; 41 if (!gpio->regs) { 42 dev_err(dev, "Cannot map PCI resource\n"); 43 err = -ENOMEM; 44 goto out; 45 } 46 47 err = pci_enable_msi(pdev); 48 if (err < 0) 49 goto out; 50 51 gpio->irq[0] = pdev->irq;
52 if (gpio->irq < 0)
53 dev_warn(dev, "no irq is found.\n"); 54 55 /* There is only one group of Pins at the moment. */ 56 gpio->ngpio[0] = NGPIO_MAX; 57 58 /* irq_chip support */ 59 gpio->irq_chip.name = dev_name(dev); 60 gpio->irq_chip.irq_ack = phytium_gpio_irq_ack; 61 gpio->irq_chip.irq_mask = phytium_gpio_irq_mask; 62 gpio->irq_chip.irq_unmask = phytium_gpio_irq_unmask; 63 gpio->irq_chip.irq_set_type = phytium_gpio_irq_set_type; 64 gpio->irq_chip.irq_enable = phytium_gpio_irq_enable; 65 gpio->irq_chip.irq_disable = phytium_gpio_irq_disable; 66 67 raw_spin_lock_init(&gpio->lock); 68 69 gpio->gc.base = -1; 70 gpio->gc.get_direction = phytium_gpio_get_direction; 71 gpio->gc.direction_input = phytium_gpio_direction_input; 72 gpio->gc.direction_output = phytium_gpio_direction_output; 73 gpio->gc.get = phytium_gpio_get; 74 gpio->gc.set = phytium_gpio_set; 75 gpio->gc.ngpio = gpio->ngpio[0] + gpio->ngpio[1]; 76 gpio->gc.label = dev_name(dev); 77 gpio->gc.parent = dev; 78 gpio->gc.owner = THIS_MODULE; 79 80 girq = &gpio->gc.irq; 81 girq->handler = handle_bad_irq; 82 girq->default_type = IRQ_TYPE_NONE; 83 84 girq->num_parents = 1; 85 girq->parents = devm_kcalloc(&pdev->dev, girq->num_parents, 86 sizeof(*girq->parents), GFP_KERNEL); 87 if (!girq->parents) 88 return -ENOMEM; 89 girq->parents[0] = gpio->irq[0]; 90 girq->parent_handler = phytium_gpio_irq_handler; 91 92 girq->chip = &gpio->irq_chip; 93 94 err = devm_gpiochip_add_data(dev, &gpio->gc, gpio); 95 if (err) 96 goto out; 97 98 dev_info(dev, "Phytium PCI GPIO controller @%pa registered\n", 99 &gpio->regs); 100 101 pci_set_drvdata(pdev, gpio); 102 103 out: 104 return err; 105 } 106