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

Reply via email to