Re: [Intel-gfx] [PATCH 4/9] drm/core: Add drm_for_each_encoder_mask.

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

 



Hi

On Tue, Nov 24, 2015 at 7:00 PM, Jani Nikula
<jani.nikula@xxxxxxxxxxxxxxx> wrote:
> On Tue, 24 Nov 2015, Maarten Lankhorst <maarten.lankhorst@xxxxxxxxxxxxxxx> wrote:
>> +#define drm_for_each_encoder_mask(encoder, dev, encoder_mask) \
>> +     list_for_each_entry((encoder), &(dev)->mode_config.encoder_list, head) \
>> +             if ((encoder_mask) & (1 << drm_encoder_index(encoder)))
>
> How about
>
>         if (!((encoder_mask) & (1 << drm_encoder_index(encoder)))); else
>
> to avoid dangling else problems?

YES! Please use inverted conditions in macros. Otherwise, looks good to me.

But I think an empty block "{ }" is preferable over the empty
statement. llvm tends to warn about empty statements.

Thanks
David
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux