"Tomas Winkler" <tomasw@xxxxxxxxx> writes: > On Thu, Jul 10, 2008 at 12:10 PM, Johannes Berg > <johannes@xxxxxxxxxxxxxxxx> wrote: >> Was just running sparse for something unrelated and noticed these: >> >> drivers/net/wireless/iwlwifi/iwl-rx.c:832:2: warning: cast truncates bits from constant value (1c00 becomes 0) >> drivers/net/wireless/iwlwifi/iwl-rx.c:836:2: warning: cast truncates bits from constant value (6f080000 becomes 0) >> drivers/net/wireless/iwlwifi/iwl-rx.c:836:2: warning: cast truncates bits from constant value (6f080000 becomes 0) >> drivers/net/wireless/iwlwifi/iwl-rx.c:856:3: warning: cast truncates bits from constant value (4001 becomes 1) >> drivers/net/wireless/iwlwifi/iwl-rx.c:860:3: warning: cast truncates bits from constant value (a000 becomes 0) >> drivers/net/wireless/iwlwifi/iwl-rx.c:864:3: warning: cast truncates bits from constant value (c000 becomes 0) > > Yeah I've actually wanted to ask someone how to solve. This comes from > radio tap code, frankly currently very low priority on my list. > Not sure why but only calling directly to put_unalinged_le32 fixes > this warning. In general put_unaligned should be expanded to this > macro. Only after constant folding. The put_unaligned macro itself contains calls to all put_unaligned_be?? variants with corresponding casts, and sparse does no constant folding here, apparently. Andreas. -- Andreas Schwab, SuSE Labs, schwab@xxxxxxx SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html