[PATCH] drm: fix lut value extraction function

Emil Velikov emil.l.velikov at gmail.com
Mon Apr 18 14:40:11 UTC 2016


On 18 April 2016 at 13:36, Daniel Vetter <daniel at ffwll.ch> wrote:
> On Mon, Apr 18, 2016 at 12:09:51PM +0100, Lionel Landwerlin wrote:
>> Ping?
>>
>> On 22/03/16 14:10, Lionel Landwerlin wrote:
>> >When extracting the value at full precision (16 bits), no need to
>> >round the value.
>> >
>> >This was spotted by Jani when running sparse. Unfortunately this fix
>> >doesn't get rid of the warning.
>
> It sounded like no bug, and the patch itself fails to appease sparse. And
> I didn't check what's upsetting sparse itself, so figured "nothing to do
> here until a real fix shows up".
>
According to the C99 standard a left shift with negative value is
undefined. And we're hitting this case at full precision ;-)

> Should I do something here?
Having the above information in, optionally with the warning message
in place of the current commit message would be recommended imho.

After all the patch is a definite fix, even if I personally I'd write
the inline helper via a switch (makes things dead obvious).

Regardless,
Reviewed-by: Emil Velikov <emil.velikov at collabora.com>

-Emil


More information about the dri-devel mailing list