linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RESEND] dm ioctl: Remove double parentheses
@ 2017-04-17 18:05 Matthias Kaehlcke
  0 siblings, 0 replies; only message in thread
From: Matthias Kaehlcke @ 2017-04-17 18:05 UTC (permalink / raw)
  To: Alasdair Kergon, Mike Snitzer, dm-devel
  Cc: Shaohua Li, linux-raid, linux-kernel, Grant Grundler,
	Greg Hackmann, Michael Davidson, Matthias Kaehlcke

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 <mka@chromium.org>
---
 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;
 	}
-- 
2.12.2.762.g0e3151a226-goog

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2017-04-17 18:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-17 18:05 [PATCH RESEND] dm ioctl: Remove double parentheses Matthias Kaehlcke

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).