public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] hexagon: time: Remove redundant null check for resource
@ 2024-11-11 14:24 Hardevsinh Palaniya
  2024-11-12 16:19 ` Brian Cain
  0 siblings, 1 reply; 2+ messages in thread
From: Hardevsinh Palaniya @ 2024-11-11 14:24 UTC (permalink / raw)
  To: akpm, bcain
  Cc: Hardevsinh Palaniya, Nathan Chancellor, linux-hexagon,
	linux-kernel

Null check for 'resource' before assignment is unnecessary because the
variable 'resource' is initialized to NULL at the beginning of the function.

Signed-off-by: Hardevsinh Palaniya <hardevsinh.palaniya@siliconsignals.io>
---
 arch/hexagon/kernel/time.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/hexagon/kernel/time.c b/arch/hexagon/kernel/time.c
index f0f207e2a694..6f851e1cd4ee 100644
--- a/arch/hexagon/kernel/time.c
+++ b/arch/hexagon/kernel/time.c
@@ -170,8 +170,7 @@ static void __init time_init_deferred(void)
 
 	ce_dev->cpumask = cpu_all_mask;
 
-	if (!resource)
-		resource = rtos_timer_device.resource;
+	resource = rtos_timer_device.resource;
 
 	/*  ioremap here means this has to run later, after paging init  */
 	rtos_timer = ioremap(resource->start, resource_size(resource));
-- 
2.43.0


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

* RE: [PATCH] hexagon: time: Remove redundant null check for resource
  2024-11-11 14:24 [PATCH] hexagon: time: Remove redundant null check for resource Hardevsinh Palaniya
@ 2024-11-12 16:19 ` Brian Cain
  0 siblings, 0 replies; 2+ messages in thread
From: Brian Cain @ 2024-11-12 16:19 UTC (permalink / raw)
  To: Hardevsinh Palaniya, akpm@linux-foundation.org
  Cc: Nathan Chancellor, linux-hexagon@vger.kernel.org,
	linux-kernel@vger.kernel.org, Sid Manning


> -----Original Message-----
> From: Hardevsinh Palaniya <hardevsinh.palaniya@siliconsignals.io>
> Sent: Monday, November 11, 2024 8:24 AM
> To: akpm@linux-foundation.org; Brian Cain <bcain@quicinc.com>
> Cc: Hardevsinh Palaniya <hardevsinh.palaniya@siliconsignals.io>; Nathan
> Chancellor <nathan@kernel.org>; linux-hexagon@vger.kernel.org; linux-
> kernel@vger.kernel.org
> Subject: [PATCH] hexagon: time: Remove redundant null check for resource
> 
> 
> Null check for 'resource' before assignment is unnecessary because the
> variable 'resource' is initialized to NULL at the beginning of the function.
> 
> Signed-off-by: Hardevsinh Palaniya <hardevsinh.palaniya@siliconsignals.io>
> ---

Acked-by: Brian Cain <bcain@quicinc.com>

>  arch/hexagon/kernel/time.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/arch/hexagon/kernel/time.c b/arch/hexagon/kernel/time.c
> index f0f207e2a694..6f851e1cd4ee 100644
> --- a/arch/hexagon/kernel/time.c
> +++ b/arch/hexagon/kernel/time.c
> @@ -170,8 +170,7 @@ static void __init time_init_deferred(void)
> 
>         ce_dev->cpumask = cpu_all_mask;
> 
> -       if (!resource)
> -               resource = rtos_timer_device.resource;
> +       resource = rtos_timer_device.resource;
> 
>         /*  ioremap here means this has to run later, after paging init  */
>         rtos_timer = ioremap(resource->start, resource_size(resource));
> --
> 2.43.0


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

end of thread, other threads:[~2024-11-12 16:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-11 14:24 [PATCH] hexagon: time: Remove redundant null check for resource Hardevsinh Palaniya
2024-11-12 16:19 ` Brian Cain

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox