[linux-next:pending-fixes 99/240] drivers/soc/fsl/qe/qe_ic.c:438 qe_ic_init() warn: unsigned 'qe_ic->virq_low' is never less than zero.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git pending-fixes
head:   5c6ff2f54dee49d1c75558d08c0a4fb50f0ede14
commit: be7ecbd240b2f9ec544d3ce6fccf4cec3cd15dca [99/240] soc: fsl: qe: convert QE interrupt controller to platform_device
config: openrisc-randconfig-m031-20210811 (attached as .config)
compiler: or1k-linux-gcc (GCC) 10.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

smatch warnings:
drivers/soc/fsl/qe/qe_ic.c:438 qe_ic_init() warn: unsigned 'qe_ic->virq_low' is never less than zero.

vim +438 drivers/soc/fsl/qe/qe_ic.c

   407	
   408	static int qe_ic_init(struct platform_device *pdev)
   409	{
   410		struct device *dev = &pdev->dev;
   411		void (*low_handler)(struct irq_desc *desc);
   412		void (*high_handler)(struct irq_desc *desc);
   413		struct qe_ic *qe_ic;
   414		struct resource *res;
   415		struct device_node *node = pdev->dev.of_node;
   416	
   417		res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
   418		if (res == NULL) {
   419			dev_err(dev, "no memory resource defined\n");
   420			return -ENODEV;
   421		}
   422	
   423		qe_ic = devm_kzalloc(dev, sizeof(*qe_ic), GFP_KERNEL);
   424		if (qe_ic == NULL)
   425			return -ENOMEM;
   426	
   427		qe_ic->regs = devm_ioremap(dev, res->start, resource_size(res));
   428		if (qe_ic->regs == NULL) {
   429			dev_err(dev, "failed to ioremap() registers\n");
   430			return -ENODEV;
   431		}
   432	
   433		qe_ic->hc_irq = qe_ic_irq_chip;
   434	
   435		qe_ic->virq_high = platform_get_irq(pdev, 0);
   436		qe_ic->virq_low = platform_get_irq(pdev, 1);
   437	
 > 438		if (qe_ic->virq_low < 0) {
   439			return -ENODEV;
   440		}
   441	
   442		if (qe_ic->virq_high != qe_ic->virq_low) {
   443			low_handler = qe_ic_cascade_low;
   444			high_handler = qe_ic_cascade_high;
   445		} else {
   446			low_handler = qe_ic_cascade_muxed_mpic;
   447			high_handler = NULL;
   448		}
   449	
   450		qe_ic->irqhost = irq_domain_add_linear(node, NR_QE_IC_INTS,
   451						       &qe_ic_host_ops, qe_ic);
   452		if (qe_ic->irqhost == NULL) {
   453			dev_err(dev, "failed to add irq domain\n");
   454			return -ENODEV;
   455		}
   456	
   457		qe_ic_write(qe_ic->regs, QEIC_CICR, 0);
   458	
   459		irq_set_handler_data(qe_ic->virq_low, qe_ic);
   460		irq_set_chained_handler(qe_ic->virq_low, low_handler);
   461	
   462		if (qe_ic->virq_high && qe_ic->virq_high != qe_ic->virq_low) {
   463			irq_set_handler_data(qe_ic->virq_high, qe_ic);
   464			irq_set_chained_handler(qe_ic->virq_high, high_handler);
   465		}
   466		return 0;
   467	}
   468	static const struct of_device_id qe_ic_ids[] = {
   469		{ .compatible = "fsl,qe-ic"},
   470		{ .type = "qeic"},
   471		{},
   472	};
   473	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux