Re: [PATCH 2/3] net: fix netdev features shift for features bit > 31

Patrick McHardy
2013-04-21T20:59:24Z

David Miller <davem@davemloft.net> schrieb:

>From: Patrick McHardy <kaber@trash.net>
>Date: Sun, 21 Apr 2013 12:09:33 +0200
>
>> drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c: In function
>'qlcnic_set_netdev_features':
>>>> drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c:967:7: warning:
>large integer implicitly truncated to unsigned type [-Woverflow]
>>
>> This should be fixed by explicitly using 1ULL for the shifted value.
>>
>> Reported-by: kbuild test robot <fengguang.wu@intel.com>
>> Signed-off-by: Patrick McHardy <kaber@trash.net>
>
>The limitation is in the variable being assigned to, not the value
>itself.
>
>The "1" is already cast to a netdev_features_t by the macro
>definition.

Right, I thought the warning was caused by the shift not being able to represent the result. I'll fix it up properly later.