[Mesa-dev] [PATCH] radeon: remove unnecessary checks

Jan Vesely jan.vesely at rutgers.edu
Tue Jun 14 18:39:24 UTC 2016


On Tue, 2016-06-14 at 20:19 +0200, Jakob Sinclair wrote:
> On 2016-06-13 12:02, Nicolai Hähnle wrote:
> > 
> > Meh. This is the kind of thing where Coverity should perhaps just
> > shut 
> > up :/
> 
> I do agree with you that Coverity should perhaps shut up about this 
> kinda thing
> but I couldn't see a reason to have these checks in the code. They 
> really didn't
> contribute to my understanding of the code. 

I really disagree here. The conditions check whether swizzle is between
X and W (as in, only X,Y,Z,W are allowed). The fact that X maps to 0 is
irrelevant. removing the checks impairs readability of the code because
the lower bound is now inferred (by being 0) rather than explicit.

the same comment applies to your v2.

Jan

> Although I may be missing 
> something
> important here.
> 
> > Anyway...
> > I think for consistency, you should also remove the '-
> > PIPE_SWIZZLE_X'
> > here, similar to the first hunk. With that changed,
> 
> Forgot about that one. I agree with this change.
> 
> > Reviewed-by: Nicolai Hähnle <nicolai.haehnle at amd.com>
> 
> Thanks!
-- 
Jan Vesely <jan.vesely at rutgers.edu>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160614/f5f6d397/attachment.sig>


More information about the mesa-dev mailing list