[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAKYAXd_7SeWb0TN=nWCWLrj2bKOTq1QYpjksagR6HbXvnhyhxQ@mail.gmail.com>
Date: Tue, 12 Jun 2012 09:05:40 +0900
From: Namjae Jeon <linkinjeon@...il.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: arnd@...db.de, linux-arch@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] include: Fix compile warning in include/linux/bitops.h
2012/6/12, Andrew Morton <akpm@...ux-foundation.org>:
> On Fri, 8 Jun 2012 23:15:30 -0400
> Namjae Jeon <linkinjeon@...il.com> wrote:
>
>> The compile warning is caused by __const_hweight8 when using
>> hweight_long with -Wsign-compare option.
>> The reason is that the default return value of this macro is signed.
>> So need type casting to remove warning.
>
> um, what warning?
Hi Andrew.
Sorry, I forgot it.
When we use hwight_long function, We can see the below warning message.
include/linux/bitops.h: In function 'hweight_long':
include/linux/bitops.h:49: warning: signed and unsigned type in
conditional expression
Thanks a lot.
>
> Please always quote the compiler messages when fixing build warnings or
> errors.
>
>> index fa2a50b..3ad0dae 100644
>> --- a/include/asm-generic/bitops/const_hweight.h
>> +++ b/include/asm-generic/bitops/const_hweight.h
>> @@ -4,7 +4,7 @@
>> /*
>> * Compile time versions of __arch_hweightN()
>> */
>> -#define __const_hweight8(w) \
>> +#define __const_hweight8(w) (unsigned long) \
>> ( (!!((w) & (1ULL << 0))) + \
>> (!!((w) & (1ULL << 1))) + \
>> (!!((w) & (1ULL << 2))) + \
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists