[PATCH weston v5 30/42] compositor-drm: Introduce drm_output_state structure
Fabien DESSENNE
fabien.dessenne at st.com
Thu Dec 8 13:21:16 UTC 2016
On 08/12/16 13:58, Daniel Stone wrote:
> Hi Fabien,
>
> On 21 November 2016 at 14:58, Fabien DESSENNE <fabien.dessenne at st.com> wrote:
>> On 11/16/2016 03:25 PM, Daniel Stone wrote:
>>> +/**
>>> + * Mark a drm_output_state (the output's last state) as complete. This handles
>>> + * any post-completion actions such as updating the repaint timer, disabling the
>>> + * output, and finally freeing the state.
>>> + */
>>> +static void
>>> +drm_output_update_complete(struct drm_output *output, uint32_t flags,
>>> + unsigned int sec, unsigned int usec)
>>> +{
>>> + struct timespec ts;
>>> +
>>> + drm_output_state_free(output->state_last);
>>> + output->state_last = NULL;
>>> +
>>> + if (output->destroy_pending) {
>>> + drm_output_destroy(&output->base);
>>> + goto out;
>>> + }
>>> + else if (output->disable_pending) {
>> Remove 'else'
> You're right that it isn't strictly necessary, as the 'goto' will jump
> away from it and make these branches mutually exclusive anyway. But I
> do like that it makes things clearer at a first read ('right, only one
> of these branches will ever be executed at a time'), and also it does
> match what the previous code this moved was doing.
OK, no problem Daniel. You may also consider keeping "} else if (...) {"
on the same line.
BR
Fabien
>
> Cheers,
> Daniel
More information about the wayland-devel
mailing list