From patchwork Thu Mar 16 16:48:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Kaehlcke X-Patchwork-Id: 9629857 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 E6E9760245 for ; Fri, 17 Mar 2017 05:57:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D5D8428695 for ; Fri, 17 Mar 2017 05:57:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C67BA28698; Fri, 17 Mar 2017 05:57:47 +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 4AA8128695 for ; Fri, 17 Mar 2017 05:57:46 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A07D176E6; Fri, 17 Mar 2017 05:57:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com A07D176E6 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 A07D176E6 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 7F75860A99; Fri, 17 Mar 2017 05:57:46 +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 4A0B71853D12; Fri, 17 Mar 2017 05:57:44 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v2GGn8g4014735 for ; Thu, 16 Mar 2017 12:49:08 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8BE911796A; Thu, 16 Mar 2017 16:49:08 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx03.extmail.prod.ext.phx2.redhat.com [10.5.110.27]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 841A860A99 for ; Thu, 16 Mar 2017 16:49:06 +0000 (UTC) Received: from mail-pf0-f182.google.com (mail-pf0-f182.google.com [209.85.192.182]) (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 61555804FF for ; Thu, 16 Mar 2017 16:49:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 61555804FF Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=mka@google.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 61555804FF Received: by mail-pf0-f182.google.com with SMTP id o126so26937013pfb.3 for ; Thu, 16 Mar 2017 09:49:04 -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=luM62VB5n6D/szAsic5ImVBJXg81+9IfV0fIEyKqnbs=; b=j5Z0uO6VpzJ+uuMc1tyHFNRF90bfqwQBagGcrWNQVy4+kzat54Mfv0xPsJRWsqUNSC CjBFgdeLKEjDvF54j/Uli5o7y6y7bGANXi1fj+6p8uX23wh4w0ifOHM0R3iTkIqvTUvW aemuwKmixCdmE2fu19aKXW6L8gPRY/T04pEbE8xMNASsdqDsu4aCK/0710BPpkJkgomy ViV1njTm19b1otvcyzplj/VX/eVGrUkQDtFRG0rk6ym6NJtUusJoAV/+swEnJai9B05K fYxTUQCBGvvogT6d9gnKkj2CnMHZ3Y1vwBlBN/RllUMK5tJd+8MTvkaNRsGHX/G8hhoC 9gNQ== X-Gm-Message-State: AFeK/H0reWZluSo2ORjD9uBPpyUEvCQFDxwcK3J1lkoFktctqmOiTj7g7uE1q/zQTMYuQjWo X-Received: by 10.99.39.194 with SMTP id n185mr10978854pgn.24.1489682943678; Thu, 16 Mar 2017 09:49:03 -0700 (PDT) Received: from mka.mtv.corp.google.com ([172.22.66.174]) by smtp.gmail.com with ESMTPSA id o189sm11710170pga.12.2017.03.16.09.49.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 16 Mar 2017 09:49:02 -0700 (PDT) From: Matthias Kaehlcke To: Alasdair Kergon , Mike Snitzer , dm-devel@redhat.com Date: Thu, 16 Mar 2017 09:48:30 -0700 Message-Id: <20170316164830.127026-1-mka@chromium.org> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Thu, 16 Mar 2017 16:49:05 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Thu, 16 Mar 2017 16:49:05 +0000 (UTC) for IP:'209.85.192.182' DOMAIN:'mail-pf0-f182.google.com' HELO:'mail-pf0-f182.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.182 mail-pf0-f182.google.com 209.85.192.182 mail-pf0-f182.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.27 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: dm-devel@redhat.com X-Mailman-Approved-At: Fri, 17 Mar 2017 01:57:43 -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] 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 17 Mar 2017 05:57:47 +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 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; }