Re: [RFC PATCH v11 for 4.15 01/24] Restartable sequences system call

From: Peter Zijlstra
Date: Thu Nov 16 2017 - 15:46:48 EST


On Thu, Nov 16, 2017 at 08:37:58PM +0000, Mathieu Desnoyers wrote:
> I usually never space-align with open parenthesis "(". Is it a coding
> style requirement of the kernel for multi-line if () conditions ?

Not sure, but it is the predominant pattern in most of the code.

> Would the following replatement code be ok ?
>
> if (unlikely(flags & RSEQ_CS_FLAG_NO_RESTART_ON_SIGNAL)) {
> if ((flags & (RSEQ_CS_FLAG_NO_RESTART_ON_MIGRATE
> | RSEQ_CS_FLAG_NO_RESTART_ON_PREEMPT)) !=
> (RSEQ_CS_FLAG_NO_RESTART_ON_MIGRATE
> | RSEQ_CS_FLAG_NO_RESTART_ON_PREEMPT))
> return -EINVAL;

I really prefer the operator at the end,

git grep "&&$" | wc -l
40708

git grep "^[[:space:]]*&&" | wc -l
3901