Re: [PATCH] drm/i915: Explicitly convert some macros to boolean values

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jul 04, 2016 at 03:50:23PM +0100, Tvrtko Ursulin wrote:
> From: Tvrtko Ursulin <tvrtko.ursulin@xxxxxxxxx>
> 
> Some IS_ and HAS_ macros can return any non-zero value for true.
> 
> One potential problem with that is that someone could assign
> them to integers and be surprised with the result. Therefore it
> is probably safer to do the conversion to 0/1 in the macros
> themselves.
> 
> Luckily this does not seem to have an effect on code size.

Indeed, gcc is quite happy to remove the !! and combine
e.g. IS_GEN6() || IS_GEN7() into a single testb.

With that,
Reviewed-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux