On Wed, Jul 26, 2017 at 9:33 AM, Lance Richardson <lrichard@xxxxxxxxxx> wrote: > Hmm, it seems sparse is incorrectly taking ~0UL to be a 64-bit value > while BITS_PER_LONG is (correctly) evaluated to be 32. > > #define GENMASK(h, l) \ > (((~0UL) << (l)) & (~0UL >> (BITS_PER_LONG - 1 - (h)))) > What is the sizeof(unsigned long) in ARM 32 bit world? ~0UL has the type of "unsigned long", I assume BITS_PER_LONG is just plain "int"? Using sparse -E should be able to get the expression after the macro expression. The kernel compile invoke sparse directly. That is the assumption that the host gcc has the same type size as the target gcc. That is no longer true if you have cross compiler. If you want to have sparse understand the proper architecture difference, the current practices is using cgcc to handle the architecture specific macros. you can try to invoke the kernel building with: CHECK="cgcc -no-compile". Warning: I haven't try that myself, it might not work as expected. In the long run, I do wish sparse can implement the proper handling of the architecture specific stuff by itself without go through of cgcc. Chris -- To unsubscribe from this list: send the line "unsubscribe linux-sparse" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html