2017-03-14 12:20:26

by Tomas Winkler

[permalink] [raw]
Subject: [scsi] scsi: ufshcd-platform: remove the useless cast in ERR_PTR/IS_ERR

IS_ERR and ERR_PTR already forcefully cast their argument,
hence there is no need for additional (complex) casting.

Signed-off-by: Tomas Winkler <[email protected]>
---
drivers/scsi/ufs/ufshcd-pltfrm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/ufs/ufshcd-pltfrm.c b/drivers/scsi/ufs/ufshcd-pltfrm.c
index a72a4ba78125..8e5e6c04c035 100644
--- a/drivers/scsi/ufs/ufshcd-pltfrm.c
+++ b/drivers/scsi/ufs/ufshcd-pltfrm.c
@@ -309,8 +309,8 @@ int ufshcd_pltfrm_init(struct platform_device *pdev,

mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
mmio_base = devm_ioremap_resource(dev, mem_res);
- if (IS_ERR(*(void **)&mmio_base)) {
- err = PTR_ERR(*(void **)&mmio_base);
+ if (IS_ERR(mmio_base)) {
+ err = PTR_ERR(mmio_base);
goto out;
}

--
2.9.3


2017-03-15 23:01:17

by Subhash Jadavani

[permalink] [raw]
Subject: Re: [scsi] scsi: ufshcd-platform: remove the useless cast in ERR_PTR/IS_ERR

On 2017-03-14 05:19, Tomas Winkler wrote:
> IS_ERR and ERR_PTR already forcefully cast their argument,
> hence there is no need for additional (complex) casting.
>
> Signed-off-by: Tomas Winkler <[email protected]>
> ---
> drivers/scsi/ufs/ufshcd-pltfrm.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/scsi/ufs/ufshcd-pltfrm.c
> b/drivers/scsi/ufs/ufshcd-pltfrm.c
> index a72a4ba78125..8e5e6c04c035 100644
> --- a/drivers/scsi/ufs/ufshcd-pltfrm.c
> +++ b/drivers/scsi/ufs/ufshcd-pltfrm.c
> @@ -309,8 +309,8 @@ int ufshcd_pltfrm_init(struct platform_device
> *pdev,
>
> mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> mmio_base = devm_ioremap_resource(dev, mem_res);
> - if (IS_ERR(*(void **)&mmio_base)) {
> - err = PTR_ERR(*(void **)&mmio_base);
> + if (IS_ERR(mmio_base)) {
> + err = PTR_ERR(mmio_base);
> goto out;
> }

LGTM.
Reviewed-by: Subhash Jadavani <[email protected]>

--
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

2017-03-15 23:05:19

by Martin K. Petersen

[permalink] [raw]
Subject: Re: [scsi] scsi: ufshcd-platform: remove the useless cast in ERR_PTR/IS_ERR

Tomas Winkler <[email protected]> writes:

> IS_ERR and ERR_PTR already forcefully cast their argument, hence there
> is no need for additional (complex) casting.

Applied to 4.11/scsi-fixes.

--
Martin K. Petersen Oracle Linux Engineering