From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754406AbeALBR7 (ORCPT + 1 other); Thu, 11 Jan 2018 20:17:59 -0500 Received: from smtprelay0180.hostedemail.com ([216.40.44.180]:44373 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754016AbeALBR5 (ORCPT ); Thu, 11 Jan 2018 20:17:57 -0500 X-Session-Marker: 6A6F6540706572636865732E636F6D X-HE-Tag: beast76_7f821ebdb9820 X-Filterd-Recvd-Size: 1694 Message-ID: <1515719873.9619.179.camel@perches.com> Subject: Re: checkpatch: exclude drivers/staging from if with unnecessary parentheses test From: Joe Perches To: Andrew Morton Cc: LKML , Greg KH Date: Thu, 11 Jan 2018 17:17:53 -0800 In-Reply-To: <20180111150319.86ca6ee1c16b85e4c0e034a0@linux-foundation.org> References: <1515704034.9619.165.camel@perches.com> <20180111150319.86ca6ee1c16b85e4c0e034a0@linux-foundation.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.26.1-1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Thu, 2018-01-11 at 15:03 -0800, Andrew Morton wrote: > On Thu, 11 Jan 2018 12:53:54 -0800 Joe Perches wrote: > > > Greg KH doesn't like this test so exclude the staging directory > > from the implied --strict only test unless --strict is actually > > used on the command-line. > > > > "doesn't like" is rather vague. What is the objection, specifically? Unnecessary parentheses sometimes make code easier to read for those that don't know C very well. i.e.: Greg and maybe others too. > Also, an example of code which has an "if with unnecessary parentheses" > would help others understand the decision. if ((foo == bar) && (baz != qux)) where the parentheses around the comparisons are generically unnecessary as the && is a much higher precedence than the comparisons.