linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging: sm750fb: clean-up `else`-blocks
@ 2025-04-18  3:50 Eric Florin
  2025-04-18 10:39 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Florin @ 2025-04-18  3:50 UTC (permalink / raw)
  To: gregkh
  Cc: sudipm.mukherjee, teddy.wang, linux-fbdev, linux-staging,
	linux-kernel, Eric Florin

Clean-up `else`-blocks in `hw_sm750_map` that occur after `if`-blocks that
terminate function execution.

Signed-off-by: Eric Florin <ericflorin.kernel@gmail.com>
---
 drivers/staging/sm750fb/sm750_hw.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/sm750fb/sm750_hw.c b/drivers/staging/sm750fb/sm750_hw.c
index 4bc89218c11c..64b199061d14 100644
--- a/drivers/staging/sm750fb/sm750_hw.c
+++ b/drivers/staging/sm750fb/sm750_hw.c
@@ -55,9 +55,8 @@ int hw_sm750_map(struct sm750_dev *sm750_dev, struct pci_dev *pdev)
 		pr_err("mmio failed\n");
 		ret = -EFAULT;
 		goto exit;
-	} else {
-		pr_info("mmio virtual addr = %p\n", sm750_dev->pvReg);
 	}
+	pr_info("mmio virtual addr = %p\n", sm750_dev->pvReg);
 
 	sm750_dev->accel.dprBase = sm750_dev->pvReg + DE_BASE_ADDR_TYPE1;
 	sm750_dev->accel.dpPortBase = sm750_dev->pvReg + DE_PORT_ADDR_TYPE1;
@@ -84,9 +83,8 @@ int hw_sm750_map(struct sm750_dev *sm750_dev, struct pci_dev *pdev)
 		pr_err("Map video memory failed\n");
 		ret = -EFAULT;
 		goto exit;
-	} else {
-		pr_info("video memory vaddr = %p\n", sm750_dev->pvMem);
 	}
+	pr_info("video memory vaddr = %p\n", sm750_dev->pvMem);
 exit:
 	return ret;
 }
-- 
2.39.5


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] staging: sm750fb: clean-up `else`-blocks
  2025-04-18  3:50 [PATCH] staging: sm750fb: clean-up `else`-blocks Eric Florin
@ 2025-04-18 10:39 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2025-04-18 10:39 UTC (permalink / raw)
  To: Eric Florin
  Cc: sudipm.mukherjee, teddy.wang, linux-fbdev, linux-staging,
	linux-kernel

On Thu, Apr 17, 2025 at 08:50:23PM -0700, Eric Florin wrote:
> Clean-up `else`-blocks in `hw_sm750_map` that occur after `if`-blocks that
> terminate function execution.
> 
> Signed-off-by: Eric Florin <ericflorin.kernel@gmail.com>
> ---
>  drivers/staging/sm750fb/sm750_hw.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/staging/sm750fb/sm750_hw.c b/drivers/staging/sm750fb/sm750_hw.c
> index 4bc89218c11c..64b199061d14 100644
> --- a/drivers/staging/sm750fb/sm750_hw.c
> +++ b/drivers/staging/sm750fb/sm750_hw.c
> @@ -55,9 +55,8 @@ int hw_sm750_map(struct sm750_dev *sm750_dev, struct pci_dev *pdev)
>  		pr_err("mmio failed\n");
>  		ret = -EFAULT;
>  		goto exit;
> -	} else {
> -		pr_info("mmio virtual addr = %p\n", sm750_dev->pvReg);
>  	}
> +	pr_info("mmio virtual addr = %p\n", sm750_dev->pvReg);

When drivers work properly, they are "quiet".  This driver is not quiet
at all.  So this really should be a call to dev_dbg(), right?

>  
>  	sm750_dev->accel.dprBase = sm750_dev->pvReg + DE_BASE_ADDR_TYPE1;
>  	sm750_dev->accel.dpPortBase = sm750_dev->pvReg + DE_PORT_ADDR_TYPE1;
> @@ -84,9 +83,8 @@ int hw_sm750_map(struct sm750_dev *sm750_dev, struct pci_dev *pdev)
>  		pr_err("Map video memory failed\n");
>  		ret = -EFAULT;
>  		goto exit;
> -	} else {
> -		pr_info("video memory vaddr = %p\n", sm750_dev->pvMem);
>  	}
> +	pr_info("video memory vaddr = %p\n", sm750_dev->pvMem);

Same here.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-04-18 10:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-18  3:50 [PATCH] staging: sm750fb: clean-up `else`-blocks Eric Florin
2025-04-18 10:39 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).