[PATCH 15/22] staging: comedi: s626: remove the uint16_t casts of the bit values

H Hartley Sweeten hartleys at visionengravers.com
Tue Mar 26 18:16:17 UTC 2013

On Monday, March 25, 2013 4:07 AM, Ian Abbott wrote:
> On 2013-03-22 22:59, H Hartley Sweeten wrote:
>> There are a number of uint16_t casts used in the #define's of the
>> constant bit field values as well as the calls to DEBIreplace().
>> These cause a number of sparse warnings of the type:
>> warning: cast truncates bits from constant value (ffff1cff becomes 1cff)
>> Remove all of the casts and change the types of the parameters to
>> DEBIreplace from uin16_t to unsigned int. This fixes all the warnings.
> I'm pretty sure this will break (especially for the places where bitwise 
> NOT has been applied to a value) because the conversion to uint16_t was 
> being used as a substitute for ANDing the value with 0xFFFF.

Removing the casts in the defines and all the calls to DEBIreplace()
should not break anything. But, the writel() calls to the P_DEBICMD
and P_DEBIAD registers should probably be masked with 0xffff.

I'll add the mask when I repost the remained of this series.


More information about the devel mailing list