From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750921AbdDABuX (ORCPT ); Fri, 31 Mar 2017 21:50:23 -0400 Received: from mail-pg0-f51.google.com ([74.125.83.51]:32944 "EHLO mail-pg0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750728AbdDABuV (ORCPT ); Fri, 31 Mar 2017 21:50:21 -0400 Date: Fri, 31 Mar 2017 18:50:19 -0700 From: Matthias Kaehlcke To: Alasdair Kergon , Mike Snitzer , dm-devel@redhat.com Cc: Shaohua Li , linux-raid@vger.kernel.org, linux-kernel@vger.kernel.org, Grant Grundler , Michael Davidson , Greg Hackmann Subject: Re: [PATCH] dm ioctl: Remove double parentheses Message-ID: <20170401015019.GA13986@google.com> References: <20170316164830.127026-1-mka@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20170316164830.127026-1-mka@chromium.org> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org El Thu, Mar 16, 2017 at 09:48:30AM -0700 Matthias Kaehlcke ha dit: > The extra pair of parantheses is not needed and causes clang to generate > the following warning: > > drivers/md/dm-ioctl.c:1776:11: error: equality comparison with extraneous parentheses [-Werror,-Wparentheses-equality] > if ((cmd == DM_DEV_CREATE_CMD)) { > ~~~~^~~~~~~~~~~~~~~~~~~~ > drivers/md/dm-ioctl.c:1776:11: note: remove extraneous parentheses around the comparison to silence this warning > if ((cmd == DM_DEV_CREATE_CMD)) { > ~ ^ ~ > drivers/md/dm-ioctl.c:1776:11: note: use '=' to turn this equality comparison into an assignment > if ((cmd == DM_DEV_CREATE_CMD)) { > ^~ > = > > Also remove another double parentheses that don't cause a warning. > > Signed-off-by: Matthias Kaehlcke > --- > drivers/md/dm-ioctl.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c > index a5a9b17f0f7f..9360036bf6d3 100644 > --- a/drivers/md/dm-ioctl.c > +++ b/drivers/md/dm-ioctl.c > @@ -1777,12 +1777,12 @@ static int validate_params(uint cmd, struct dm_ioctl *param) > cmd == DM_LIST_VERSIONS_CMD) > return 0; > > - if ((cmd == DM_DEV_CREATE_CMD)) { > + if (cmd == DM_DEV_CREATE_CMD) { > if (!*param->name) { > DMWARN("name not supplied when creating device"); > return -EINVAL; > } > - } else if ((*param->uuid && *param->name)) { > + } else if (*param->uuid && *param->name) { > DMWARN("only supply one of name or uuid, cmd(%u)", cmd); > return -EINVAL; > } Ping? Any feedback on this patch? Cheers Matthias