[PATCH v1] drm/mipi_dbi: Use simple right shift instead of double negation

Noralf Trønnes noralf at tronnes.org
Tue Oct 22 13:37:40 UTC 2019



Den 17.10.2019 18.27, skrev Noralf Trønnes:
> 
> 
> Den 17.10.2019 13.49, skrev Andy Shevchenko:
>> GCC complains about dubious bitwise OR operand:
>>
>> drivers/gpu/drm/drm_mipi_dbi.c:1024:49: warning: dubious: x | !y
>>   CC [M]  drivers/gpu/drm/drm_mipi_dbi.o
>>
>> As long as buffer is consist of byte (u8) values, we may use
>> simple right shift and satisfy compiler. It also reduces amount of
>> operations needed.
>>
>> Signed-off-by: Andy Shevchenko <andriy.shevchenko at linux.intel.com>
>> ---
> 
> Thanks, it's even more readable now, for me at least. And since I don't
> trust my in-head C compiler/parser, I ran a test and
> /sys/kernel/debug/dri/0/command returns the same for commands 04H and
> 09h which are the ones affected by this change.
> 
> Reviewed-by: Noralf Trønnes <noralf at tronnes.org>
> Tested-by: Noralf Trønnes <noralf at tronnes.org>
> 

Applied to drm-misc-next.

Noralf.


More information about the dri-devel mailing list