From patchwork Mon Apr 17 18:05:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Kaehlcke X-Patchwork-Id: 9685101 X-Patchwork-Delegate: snitzer@redhat.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A7F63602C9 for ; Tue, 18 Apr 2017 07:24:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9AF5D2832D for ; Tue, 18 Apr 2017 07:24:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8FC9828375; Tue, 18 Apr 2017 07:24:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 20E9C2832D for ; Tue, 18 Apr 2017 07:24:02 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 04C1D6198B; Tue, 18 Apr 2017 07:24:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 04C1D6198B Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 04C1D6198B Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CD70118003; Tue, 18 Apr 2017 07:24:00 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 8EFE518523D2; Tue, 18 Apr 2017 07:24:00 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v3HI5TY3016802 for ; Mon, 17 Apr 2017 14:05:30 -0400 Received: by smtp.corp.redhat.com (Postfix) id F01CC17BA2; Mon, 17 Apr 2017 18:05:29 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx10.extmail.prod.ext.phx2.redhat.com [10.5.110.39]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E716E17BAF for ; Mon, 17 Apr 2017 18:05:27 +0000 (UTC) Received: from mail-pf0-f176.google.com (mail-pf0-f176.google.com [209.85.192.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C12E2A2A96 for ; Mon, 17 Apr 2017 18:05:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com C12E2A2A96 Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=mka@google.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com C12E2A2A96 Received: by mail-pf0-f176.google.com with SMTP id s16so68977053pfs.0 for ; Mon, 17 Apr 2017 11:05:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=xwvHP+OECzuv99U4xxp/b63spyws0SE+GoVdrMcGRIU=; b=TWi7q7APlIWuMk/7KzrPM/eeuqMTzAaKz+BDYDuEjP27j/k4LGF1ExuU56Pc9dizbP BiSlOhXnFOkBZsZLUdBQjUlQxVOFPZUeZvprW6VavLBeHYv+KR59ZVYPZ7v9zfX3IgCe nDGtMWGadxc2KOKal7cx/uKd7bsYJRJS0KEX00db/B5o9R0299fhu9lU4jHN5/4xfeRz hyW19jlQgCTvVCmchcmuCKVcNwhakZ+E6UEe3IBkC7FFPxAlucElYyr1p6HN/l3XU4iw lqrokdpXt4GYn7aIDOHdXAzKmlutfSWMbYc3SC04ywjJCfeX5zUCZ2pvSDMm34GcPvdd vikw== X-Gm-Message-State: AN3rC/6IFVqFGRoYE7fI2Noe51ykevAcRsjsHGfe46rrsQN1Ujv5AMma 9NgGljgDYn79xt7n X-Received: by 10.84.217.67 with SMTP id e3mr17513861plj.108.1492452325156; Mon, 17 Apr 2017 11:05:25 -0700 (PDT) Received: from mka.mtv.corp.google.com ([172.22.64.162]) by smtp.gmail.com with ESMTPSA id u198sm19400641pgb.63.2017.04.17.11.05.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 17 Apr 2017 11:05:24 -0700 (PDT) From: Matthias Kaehlcke To: Alasdair Kergon , Mike Snitzer , dm-devel@redhat.com Date: Mon, 17 Apr 2017 11:05:03 -0700 Message-Id: <20170417180503.30435-1-mka@chromium.org> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 17 Apr 2017 18:05:25 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 17 Apr 2017 18:05:25 +0000 (UTC) for IP:'209.85.192.176' DOMAIN:'mail-pf0-f176.google.com' HELO:'mail-pf0-f176.google.com' FROM:'mka@google.com' RCPT:'' X-RedHat-Spam-Score: -2.411 (BAYES_50, DCC_REPUT_00_12, HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, RP_MATCHES_RCVD, SPF_PASS) 209.85.192.176 mail-pf0-f176.google.com 209.85.192.176 mail-pf0-f176.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.39 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: dm-devel@redhat.com X-Mailman-Approved-At: Tue, 18 Apr 2017 03:23:31 -0400 Cc: Michael Davidson , Grant Grundler , linux-kernel@vger.kernel.org, Greg Hackmann , linux-raid@vger.kernel.org, Matthias Kaehlcke , Shaohua Li Subject: [dm-devel] [PATCH RESEND] dm ioctl: Remove double parentheses X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 18 Apr 2017 07:24:01 +0000 (UTC) X-Virus-Scanned: ClamAV using ClamSMTP 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 4da6fc6b1ffd..acd8f12439e4 100644 --- a/drivers/md/dm-ioctl.c +++ b/drivers/md/dm-ioctl.c @@ -1778,12 +1778,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; }