Re: [PATCH v2 10/17] signal: make has_pending_signals() return bool

From: Oleg Nesterov
Date: Fri Jun 01 2018 - 12:17:08 EST


On 06/01, Christian Brauner wrote:
>
> has_pending_signals() already behaves like a boolean function. Let's
> actually declare it as such too.

But this patch does more.

> - case 4: ready = signal->sig[3] &~ blocked->sig[3];
> - ready |= signal->sig[2] &~ blocked->sig[2];
> - ready |= signal->sig[1] &~ blocked->sig[1];
> - ready |= signal->sig[0] &~ blocked->sig[0];
> + case 4:
> + ready = signal->sig[3] & ~blocked->sig[3];
> + ready |= signal->sig[2] & ~blocked->sig[2];
> + ready |= signal->sig[1] & ~blocked->sig[1];
> + ready |= signal->sig[0] & ~blocked->sig[0];
> break;

Again, personally I do not care at all. But why do you think the code looks
better after re-formatting? This is subjective, but to me it does not.

In particular, note the extra space before "=" removed by this patch. I guess
it was added on purpose, and to me

ready = signal->sig[3] &~ blocked->sig[3];
ready |= signal->sig[2] &~ blocked->sig[2];

actually looks better thab

ready = signal->sig[3] &~ blocked->sig[3];
ready |= signal->sig[2] &~ blocked->sig[2];

after your patch.

Oleg.