From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752298AbdDHQHf (ORCPT ); Sat, 8 Apr 2017 12:07:35 -0400 Received: from mail-wm0-f44.google.com ([74.125.82.44]:35358 "EHLO mail-wm0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751626AbdDHQH3 (ORCPT ); Sat, 8 Apr 2017 12:07:29 -0400 Date: Sat, 8 Apr 2017 17:07:17 +0100 From: Alfonso Lima To: apw@canonical.com, joe@perches.com Cc: linux-kernel@vger.kernel.org Subject: [bug report] checkpatch: if statement does not need to be enclosed in parentheses Message-ID: <20170408160717.GA7337@alima-W65-67SF> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, In current linux-next, if you run the script on this piece of code: #define FOO(a) \ if (a) { \ something(); \ something_else(); \ } You should get: ERROR: Macros with complex values should be enclosed in parentheses #1: FILE: foo.c:1: +#define FOO(a) \ + if (a) { \ + something(); \ + something_else(); \ + } We could silence checkpatch.pl using "do {} while ()" around the if statement. However, the "if () {}" statement should be enough. If someone could confirm this, I'll go and fix it. Thanks, Alfonso