[PATCH] drm: fix lut value extraction function

Daniel Vetter daniel at ffwll.ch
Mon Apr 18 15:53:25 UTC 2016


On Mon, Apr 18, 2016 at 03:40:11PM +0100, Emil Velikov wrote:
> 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 ;-)

Well commit message says sparse is still unhappy. So I'm not sure whether
the fix is good enough? And the issue with compiler/static checker noise
is that we really should aim to shut them up completely, because broken
windows and all that (even if it's sometimes a fallacy, I think it applies
here).
-Daniel

> 
> > 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

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch


More information about the dri-devel mailing list