<div dir="ltr"><div><div><div><div>Before my patch, gcc warned about:<br><br>src/gallium/drivers/freedreno/a2xx/fd2_screen.c:64:30: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]<br><br></div>The change suggested:<br><br> (fd2_pipe2surface(format) != (enum a2xx_sq_surfaceformat)~0)) {<br><br></div>makes both compiler happy.<br></div>Cheers,<br></div>Francesco<br></div><div class="gmail_extra"><br><div class="gmail_quote">2016-07-29 2:20 GMT+02:00 Rob Herring <span dir="ltr"><<a href="mailto:robh@kernel.org" target="_blank">robh@kernel.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Thu, Jul 28, 2016 at 6:55 PM, Rob Clark <<a href="mailto:robdclark@gmail.com">robdclark@gmail.com</a>> wrote:<br>
> On Thu, Jul 28, 2016 at 6:36 PM, Rob Herring <<a href="mailto:robh@kernel.org">robh@kernel.org</a>> wrote:<br>
>> On Thu, Jun 30, 2016 at 12:16 PM, Francesco Ansanelli<br>
>> <<a href="mailto:francians@gmail.com">francians@gmail.com</a>> wrote:<br>
>>> ---<br>
>>> src/gallium/drivers/freedreno/a2xx/fd2_screen.c | 8 ++++----<br>
>>> 1 file changed, 4 insertions(+), 4 deletions(-)<br>
>>><br>
>>> diff --git a/src/gallium/drivers/freedreno/a2xx/fd2_screen.c b/src/gallium/drivers/freedreno/a2xx/fd2_screen.c<br>
>>> index c2baa6f..fe4849b 100644<br>
>>> --- a/src/gallium/drivers/freedreno/a2xx/fd2_screen.c<br>
>>> +++ b/src/gallium/drivers/freedreno/a2xx/fd2_screen.c<br>
>>> @@ -61,7 +61,7 @@ fd2_screen_is_format_supported(struct pipe_screen *pscreen,<br>
>>><br>
>>> if ((usage & (PIPE_BIND_SAMPLER_VIEW |<br>
>>> PIPE_BIND_VERTEX_BUFFER)) &&<br>
>>> - (fd2_pipe2surface(format) != ~0)) {<br>
>>> + (fd2_pipe2surface(format) != ~0u)) {<br>
>><br>
>> FYI, all these still warn with LLVM, but now the warning is about<br>
>> being out of range:<br>
>><br>
>> external/mesa3d/src/gallium/drivers/freedreno/a2xx/fd2_screen.c:64:30:<br>
>> warning: comparison of constant 4294967295 with expression of type<br>
>> 'enum a2xx_sq_surfaceformat' is always true<br>
>> [-Wtautological-constant-out-of-range-compare]<br>
>> (fd2_pipe2surface(format) != ~0u)) {<br>
>> ~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~<br>
><br>
> bleh.. I guess it depends on whether enums are signed or unsigned?<br>
><br>
> maybe (enum a2xx_sq_surfaceformat)~0 then?<br>
<br>
</div></div>Or add the error value to the enums.<br>
<span class="HOEnZb"><font color="#888888"><br>
Rob<br>
</font></span><br>
P.S. This is why I hate enums.<br>
</blockquote></div><br></div>