diff mbox

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

Message ID 20170314121936.1360-1-tomas.winkler@intel.com (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Winkler, Tomas March 14, 2017, 12:19 p.m. UTC
IS_ERR and ERR_PTR already forcefully cast their argument,
hence there is no need for additional (complex) casting.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
---
 drivers/scsi/ufs/ufshcd-pltfrm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

subhashj@codeaurora.org March 15, 2017, 11:01 p.m. UTC | #1
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 <tomas.winkler@intel.com>
> ---
>  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 <subhashj@codeaurora.org>
Martin K. Petersen March 15, 2017, 11:04 p.m. UTC | #2
Tomas Winkler <tomas.winkler@intel.com> 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.
diff mbox

Patch

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;
 	}