linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Maxim Kochetkov <fido_max@inbox.ru>
Cc: kbuild-all@lists.01.org,
	Linux Memory Management List <linux-mm@kvack.org>,
	Li Yang <leoyang.li@nxp.com>
Subject: [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: Thu, 12 Aug 2021 08:30:34 +0800	[thread overview]
Message-ID: <202108120827.3Jn31r7w-lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 2908 bytes --]

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@intel.com>

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@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 27404 bytes --]

                 reply	other threads:[~2021-08-12  0:31 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202108120827.3Jn31r7w-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=fido_max@inbox.ru \
    --cc=kbuild-all@lists.01.org \
    --cc=leoyang.li@nxp.com \
    --cc=linux-mm@kvack.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox