linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild@lists.01.org, Herbert Xu <herbert@gondor.apana.org.au>
Cc: lkp@intel.com, kbuild-all@lists.01.org,
	Linux Memory Management List <linux-mm@kvack.org>,
	Neal Liu <neal_liu@aspeedtech.com>
Subject: [kbuild] [linux-next:master 4120/6188] drivers/crypto/aspeed/aspeed-hace.c:133 aspeed_hace_probe() warn: platform_get_irq() does not return zero
Date: Thu, 8 Sep 2022 16:24:58 +0300	[thread overview]
Message-ID: <202209082053.apSRNNQ5-lkp@intel.com> (raw)

Hi Herbert,

FYI, the error/warning was bisected to this commit, please ignore it if it's irrelevant.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git   master
head:   47c191411b68a771261be3dc0bd6f68394cef358
commit: 31b39755e32568b43c80814c5e13d7b1ab796d73 [4120/6188] crypto: aspeed - Enable compile testing
config: openrisc-randconfig-m041-20220907
compiler: or1k-linux-gcc (GCC) 12.1.0

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

smatch warnings:
drivers/crypto/aspeed/aspeed-hace.c:133 aspeed_hace_probe() warn: platform_get_irq() does not return zero

vim +133 drivers/crypto/aspeed/aspeed-hace.c

108713a713c7e4b Neal Liu 2022-08-18   96  static int aspeed_hace_probe(struct platform_device *pdev)
108713a713c7e4b Neal Liu 2022-08-18   97  {
62f58b1637b7c8d Neal Liu 2022-08-18   98  	struct aspeed_engine_crypto *crypto_engine;
108713a713c7e4b Neal Liu 2022-08-18   99  	const struct of_device_id *hace_dev_id;
108713a713c7e4b Neal Liu 2022-08-18  100  	struct aspeed_engine_hash *hash_engine;
108713a713c7e4b Neal Liu 2022-08-18  101  	struct aspeed_hace_dev *hace_dev;
108713a713c7e4b Neal Liu 2022-08-18  102  	struct resource *res;
108713a713c7e4b Neal Liu 2022-08-18  103  	int rc;
108713a713c7e4b Neal Liu 2022-08-18  104  
108713a713c7e4b Neal Liu 2022-08-18  105  	hace_dev = devm_kzalloc(&pdev->dev, sizeof(struct aspeed_hace_dev),
108713a713c7e4b Neal Liu 2022-08-18  106  				GFP_KERNEL);
108713a713c7e4b Neal Liu 2022-08-18  107  	if (!hace_dev)
108713a713c7e4b Neal Liu 2022-08-18  108  		return -ENOMEM;
108713a713c7e4b Neal Liu 2022-08-18  109  
108713a713c7e4b Neal Liu 2022-08-18  110  	hace_dev_id = of_match_device(aspeed_hace_of_matches, &pdev->dev);
108713a713c7e4b Neal Liu 2022-08-18  111  	if (!hace_dev_id) {
108713a713c7e4b Neal Liu 2022-08-18  112  		dev_err(&pdev->dev, "Failed to match hace dev id\n");
108713a713c7e4b Neal Liu 2022-08-18  113  		return -EINVAL;
108713a713c7e4b Neal Liu 2022-08-18  114  	}
108713a713c7e4b Neal Liu 2022-08-18  115  
108713a713c7e4b Neal Liu 2022-08-18  116  	hace_dev->dev = &pdev->dev;
108713a713c7e4b Neal Liu 2022-08-18  117  	hace_dev->version = (unsigned long)hace_dev_id->data;
108713a713c7e4b Neal Liu 2022-08-18  118  	hash_engine = &hace_dev->hash_engine;
62f58b1637b7c8d Neal Liu 2022-08-18  119  	crypto_engine = &hace_dev->crypto_engine;
108713a713c7e4b Neal Liu 2022-08-18  120  
108713a713c7e4b Neal Liu 2022-08-18  121  	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
108713a713c7e4b Neal Liu 2022-08-18  122  
108713a713c7e4b Neal Liu 2022-08-18  123  	platform_set_drvdata(pdev, hace_dev);
108713a713c7e4b Neal Liu 2022-08-18  124  
108713a713c7e4b Neal Liu 2022-08-18  125  	hace_dev->regs = devm_ioremap_resource(&pdev->dev, res);
108713a713c7e4b Neal Liu 2022-08-18  126  	if (!hace_dev->regs) {
108713a713c7e4b Neal Liu 2022-08-18  127  		dev_err(&pdev->dev, "Failed to map resources\n");
108713a713c7e4b Neal Liu 2022-08-18  128  		return -ENOMEM;
108713a713c7e4b Neal Liu 2022-08-18  129  	}
108713a713c7e4b Neal Liu 2022-08-18  130  
108713a713c7e4b Neal Liu 2022-08-18  131  	/* Get irq number and register it */
108713a713c7e4b Neal Liu 2022-08-18  132  	hace_dev->irq = platform_get_irq(pdev, 0);
108713a713c7e4b Neal Liu 2022-08-18 @133  	if (!hace_dev->irq) {

This should be:

	if (hace_dev->irq < 0)
		return hace_dev->irq;

platform_get_irq() does not return zero, but if it did then treat it
as success.

108713a713c7e4b Neal Liu 2022-08-18  134  		dev_err(&pdev->dev, "Failed to get interrupt\n");
108713a713c7e4b Neal Liu 2022-08-18  135  		return -ENXIO;
108713a713c7e4b Neal Liu 2022-08-18  136  	}
108713a713c7e4b Neal Liu 2022-08-18  137  
108713a713c7e4b Neal Liu 2022-08-18  138  	rc = devm_request_irq(&pdev->dev, hace_dev->irq, aspeed_hace_irq, 0,
108713a713c7e4b Neal Liu 2022-08-18  139  			      dev_name(&pdev->dev), hace_dev);
108713a713c7e4b Neal Liu 2022-08-18  140  	if (rc) {
108713a713c7e4b Neal Liu 2022-08-18  141  		dev_err(&pdev->dev, "Failed to request interrupt\n");
108713a713c7e4b Neal Liu 2022-08-18  142  		return rc;
108713a713c7e4b Neal Liu 2022-08-18  143  	}
108713a713c7e4b Neal Liu 2022-08-18  144  
108713a713c7e4b Neal Liu 2022-08-18  145  	/* Get clk and enable it */



                 reply	other threads:[~2022-09-08 13:25 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=202209082053.apSRNNQ5-lkp@intel.com \
    --to=dan.carpenter@oracle.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=kbuild-all@lists.01.org \
    --cc=kbuild@lists.01.org \
    --cc=linux-mm@kvack.org \
    --cc=lkp@intel.com \
    --cc=neal_liu@aspeedtech.com \
    /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