2019-12-11 10:32:53

by Rafael J. Wysocki

[permalink] [raw]
Subject: [PATCH] cpuidle: Drop unnecessary type cast in cpuidle_poll_time()

From: Rafael J. Wysocki <[email protected]>

The data type of the target_residency_ns field in struct cpuidle_state
is u64, so it does not need to be cast into u64.

Get read of the unnecessary type cast.

Signed-off-by: Rafael J. Wysocki <[email protected]>
---

On top of the linux-next branch of linux-pm.git from today.

---
drivers/cpuidle/cpuidle.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-pm/drivers/cpuidle/cpuidle.c
===================================================================
--- linux-pm.orig/drivers/cpuidle/cpuidle.c
+++ linux-pm/drivers/cpuidle/cpuidle.c
@@ -381,7 +381,7 @@ u64 cpuidle_poll_time(struct cpuidle_dri
if (dev->states_usage[i].disable)
continue;

- limit_ns = (u64)drv->states[i].target_residency_ns;
+ limit_ns = drv->states[i].target_residency_ns;
break;
}





2019-12-11 10:33:53

by Zhang, Rui

[permalink] [raw]
Subject: RE: [PATCH] cpuidle: Drop unnecessary type cast in cpuidle_poll_time()


> -----Original Message-----
> From: [email protected] [mailto:linux-pm-
> [email protected]] On Behalf Of Rafael J. Wysocki
> Sent: Wednesday, December 11, 2019 6:31 PM
> To: Linux PM <[email protected]>
> Cc: LKML <[email protected]>; Daniel Lezcano
> <[email protected]>
> Subject: [PATCH] cpuidle: Drop unnecessary type cast in cpuidle_poll_time()
>
> From: Rafael J. Wysocki <[email protected]>
>
> The data type of the target_residency_ns field in struct cpuidle_state is u64,
> so it does not need to be cast into u64.
>
> Get read of the unnecessary type cast.

s/read/rid

thanks,
rui
>
> Signed-off-by: Rafael J. Wysocki <[email protected]>
> ---
>
> On top of the linux-next branch of linux-pm.git from today.
>
> ---
> drivers/cpuidle/cpuidle.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> Index: linux-pm/drivers/cpuidle/cpuidle.c
> ==============================================================
> =====
> --- linux-pm.orig/drivers/cpuidle/cpuidle.c
> +++ linux-pm/drivers/cpuidle/cpuidle.c
> @@ -381,7 +381,7 @@ u64 cpuidle_poll_time(struct cpuidle_dri
> if (dev->states_usage[i].disable)
> continue;
>
> - limit_ns = (u64)drv->states[i].target_residency_ns;
> + limit_ns = drv->states[i].target_residency_ns;
> break;
> }
>
>
>

2019-12-11 10:37:07

by Rafael J. Wysocki

[permalink] [raw]
Subject: Re: [PATCH] cpuidle: Drop unnecessary type cast in cpuidle_poll_time()

On Wed, Dec 11, 2019 at 11:33 AM Zhang, Rui <[email protected]> wrote:
>
>
> > -----Original Message-----
> > From: [email protected] [mailto:linux-pm-
> > [email protected]] On Behalf Of Rafael J. Wysocki
> > Sent: Wednesday, December 11, 2019 6:31 PM
> > To: Linux PM <[email protected]>
> > Cc: LKML <[email protected]>; Daniel Lezcano
> > <[email protected]>
> > Subject: [PATCH] cpuidle: Drop unnecessary type cast in cpuidle_poll_time()
> >
> > From: Rafael J. Wysocki <[email protected]>
> >
> > The data type of the target_residency_ns field in struct cpuidle_state is u64,
> > so it does not need to be cast into u64.
> >
> > Get read of the unnecessary type cast.
>
> s/read/rid

Indeed, thanks!

2019-12-11 15:33:06

by Daniel Lezcano

[permalink] [raw]
Subject: Re: [PATCH] cpuidle: Drop unnecessary type cast in cpuidle_poll_time()

On 11/12/2019 11:30, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <[email protected]>
>
> The data type of the target_residency_ns field in struct cpuidle_state
> is u64, so it does not need to be cast into u64.
>
> Get read of the unnecessary type cast.
>
> Signed-off-by: Rafael J. Wysocki <[email protected]>

Acked-by: Daniel Lezcano <[email protected]>

--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog