diff mbox

[PATCHv2] linux-generic: traffic-manager: fix integer handling issue

Message ID 1459243348-18979-1-git-send-email-bala.manoharan@linaro.org
State Accepted
Commit 599bd486574f4efb385a45a807230aacccca8d54
Headers show

Commit Message

Balasubramanian Manoharan March 29, 2016, 9:22 a.m. UTC
Fixes: https://bugs.linaro.org/show_bug.cgi?id=2122

Signed-off-by: Balasubramanian Manoharan <bala.manoharan@linaro.org>
---
v2: Incorporates comments from Maxim

 platform/linux-generic/odp_timer_wheel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Maxim Uvarov March 29, 2016, 10:35 a.m. UTC | #1
Merged,

added Bills review from previous version.
Maxim.

On 03/29/16 12:22, Balasubramanian Manoharan wrote:
> Fixes: https://bugs.linaro.org/show_bug.cgi?id=2122
>
> Signed-off-by: Balasubramanian Manoharan <bala.manoharan@linaro.org>
> ---
> v2: Incorporates comments from Maxim
>
>   platform/linux-generic/odp_timer_wheel.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/platform/linux-generic/odp_timer_wheel.c b/platform/linux-generic/odp_timer_wheel.c
> index 638edf4..bf43654 100644
> --- a/platform/linux-generic/odp_timer_wheel.c
> +++ b/platform/linux-generic/odp_timer_wheel.c
> @@ -167,7 +167,7 @@ static uint32_t _odp_internal_ilog2(uint64_t value)
>   	uint32_t bit_shift;
>   
>   	for (bit_shift = 0; bit_shift < 64; bit_shift++) {
> -		pwr_of_2 = 1 << bit_shift;
> +		pwr_of_2 = 1ULL << bit_shift;
>   		if (value == pwr_of_2)
>   			return bit_shift;
>   		else if (value < pwr_of_2)
diff mbox

Patch

diff --git a/platform/linux-generic/odp_timer_wheel.c b/platform/linux-generic/odp_timer_wheel.c
index 638edf4..bf43654 100644
--- a/platform/linux-generic/odp_timer_wheel.c
+++ b/platform/linux-generic/odp_timer_wheel.c
@@ -167,7 +167,7 @@  static uint32_t _odp_internal_ilog2(uint64_t value)
 	uint32_t bit_shift;
 
 	for (bit_shift = 0; bit_shift < 64; bit_shift++) {
-		pwr_of_2 = 1 << bit_shift;
+		pwr_of_2 = 1ULL << bit_shift;
 		if (value == pwr_of_2)
 			return bit_shift;
 		else if (value < pwr_of_2)