diff mbox

linux-generic: cpumask: fix signed and unsigned compare

Message ID 1423429418-29150-1-git-send-email-maxim.uvarov@linaro.org
State Accepted
Commit fe8ab2ca25514fd1d25e10d2c639a4e7f502799d
Headers show

Commit Message

Maxim Uvarov Feb. 8, 2015, 9:03 p.m. UTC
odp_cpumask.c: In function 'odp_cpumask_to_str':
odp_cpumask.c:87:10: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
  if (len < (3 + nibbles))
          ^
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
---
 platform/linux-generic/odp_cpumask.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Ola Liljedahl Feb. 9, 2015, 4:41 a.m. UTC | #1
On 8 February 2015 at 22:03, Maxim Uvarov <maxim.uvarov@linaro.org> wrote:
> odp_cpumask.c: In function 'odp_cpumask_to_str':
> odp_cpumask.c:87:10: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
>   if (len < (3 + nibbles))
>           ^
> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Reviewed-by: Ola Liljedahl <ola.liljedahl@linaro.org>

> ---
>  platform/linux-generic/odp_cpumask.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/platform/linux-generic/odp_cpumask.c b/platform/linux-generic/odp_cpumask.c
> index 24b9d75..7abf593 100644
> --- a/platform/linux-generic/odp_cpumask.c
> +++ b/platform/linux-generic/odp_cpumask.c
> @@ -65,7 +65,7 @@ ssize_t odp_cpumask_to_str(const odp_cpumask_t *mask, char *str, ssize_t len)
>  {
>         char *p = str;
>         int cpu = odp_cpumask_last(mask);
> -       unsigned int nibbles;
> +       int nibbles;
>         int value;
>
>         /* Handle bad string length, need at least 4 chars for "0x0" and
> --
> 1.8.5.1.163.gd7aced9
>
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
Maxim Uvarov Feb. 9, 2015, 4:57 a.m. UTC | #2
Merged,

Maxim.

On 02/09/2015 07:41 AM, Ola Liljedahl wrote:
> On 8 February 2015 at 22:03, Maxim Uvarov <maxim.uvarov@linaro.org> wrote:
>> odp_cpumask.c: In function 'odp_cpumask_to_str':
>> odp_cpumask.c:87:10: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
>>    if (len < (3 + nibbles))
>>            ^
>> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
> Reviewed-by: Ola Liljedahl <ola.liljedahl@linaro.org>
>
>> ---
>>   platform/linux-generic/odp_cpumask.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/platform/linux-generic/odp_cpumask.c b/platform/linux-generic/odp_cpumask.c
>> index 24b9d75..7abf593 100644
>> --- a/platform/linux-generic/odp_cpumask.c
>> +++ b/platform/linux-generic/odp_cpumask.c
>> @@ -65,7 +65,7 @@ ssize_t odp_cpumask_to_str(const odp_cpumask_t *mask, char *str, ssize_t len)
>>   {
>>          char *p = str;
>>          int cpu = odp_cpumask_last(mask);
>> -       unsigned int nibbles;
>> +       int nibbles;
>>          int value;
>>
>>          /* Handle bad string length, need at least 4 chars for "0x0" and
>> --
>> 1.8.5.1.163.gd7aced9
>>
>>
>> _______________________________________________
>> lng-odp mailing list
>> lng-odp@lists.linaro.org
>> http://lists.linaro.org/mailman/listinfo/lng-odp
diff mbox

Patch

diff --git a/platform/linux-generic/odp_cpumask.c b/platform/linux-generic/odp_cpumask.c
index 24b9d75..7abf593 100644
--- a/platform/linux-generic/odp_cpumask.c
+++ b/platform/linux-generic/odp_cpumask.c
@@ -65,7 +65,7 @@  ssize_t odp_cpumask_to_str(const odp_cpumask_t *mask, char *str, ssize_t len)
 {
 	char *p = str;
 	int cpu = odp_cpumask_last(mask);
-	unsigned int nibbles;
+	int nibbles;
 	int value;
 
 	/* Handle bad string length, need at least 4 chars for "0x0" and