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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

Regards,
Hartley

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux