Skip to contentSkip to conversation

cpuidle: Drop unnecessary type cast in cpuidle_poll_time()

PATCH In review Rafael J. Wysocki 4 participants 4 messages Dec 11, 2019 CPU idle time management framework

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---

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(-)
drivers/cpuidle/cpuidle.c +1 -1
Index: 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;
 	}
 
#1 lore raw
Quoted 10 lines

-----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()

Quoted 6 lines

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

Quoted 26 lines

---

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
==============================================================
=====

drivers/cpuidle/cpuidle.c +1 -1
@@ -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;
 	}
 
#2 lore raw
Quoted 11 lines · Rui
Quoted 11 lines

-----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()

Quoted 8 lines
Quoted 6 lines

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!

Acked-by on v1 1/1
#3 lore raw
In reply to Rafael J. Wysocki
Quoted 8 lines · Rafael J. Wysocki

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.

Signature · 5 lines
 <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