Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

crypto: bfin_crc - Simplify use of devm_ioremap_resource

Remove unneeded error handling on the result of a call to
platform_get_resource when the value is passed to
devm_ioremap_resource.

The Coccinelle semantic patch that makes this change is as follows:

// <smpl>
@@
expression pdev,res,n,e,e1;
expression ret != 0;
identifier l;
@@

- res = platform_get_resource(pdev, IORESOURCE_MEM, n);
... when != res
- if (res == NULL) { ... \(goto l;\|return ret;\) }
... when != res
+ res = platform_get_resource(pdev, IORESOURCE_MEM, n);
e = devm_ioremap_resource(e1, res);
// </smpl>

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Amitoj Kaur Chawla and committed by
Herbert Xu
8d63a6d5 8c419778

-5
-5
drivers/crypto/bfin_crc.c
··· 588 588 crypto_init_queue(&crc->queue, CRC_CCRYPTO_QUEUE_LENGTH); 589 589 590 590 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 591 - if (res == NULL) { 592 - dev_err(&pdev->dev, "Cannot get IORESOURCE_MEM\n"); 593 - return -ENOENT; 594 - } 595 - 596 591 crc->regs = devm_ioremap_resource(dev, res); 597 592 if (IS_ERR((void *)crc->regs)) { 598 593 dev_err(&pdev->dev, "Cannot map CRC IO\n");