On Thu, 2024-08-22 at 10:02 -0700, Bart Van Assche wrote: > > External email : Please do not click links or open attachments until > you have verified the sender or the content. > On 8/21/24 10:34 PM, Peter Wang (王信友) wrote: > > For example, consider the following complex conditional expression: > > > > if (a == b && c > d || e < f && g != h) > > Hi Peter, > > As you may know, the above is not allowed in Linux kernel code. I'm > not sure this has been written down anywhere formally. The C > compilers > supported by the Linux kernel emit a warning about expressions like > the > above and Linux kernel code should be warning-free. > > I agree with you that code readability is important. However, I think > that it's important for Linux kernel developers to make themselves > familiar with expressions like (a & b && ...) since this style is > common > in the Linux kernel. Do you agree that the data below shows that not > surrounding binary and expressions with parentheses is common in > Linux > kernel code? > > $ git grep -nHE 'if.*&&[^()&]*&[^&]|if.*[^&]&[^&()]*&&' | wc -l > 2548 > > Thanks, > > Bart. Hi Bart, I agree that it's important for Linux kernel developers to make themselves familiar with expressions like (a & b && ...) I have no further comments. Thanks Peter Reviewed-by: Peter Wang <peter.wang@xxxxxxxxxxxx>