All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthias Kaehlcke <mka@chromium.org>
To: Alasdair Kergon <agk@redhat.com>,
	Mike Snitzer <snitzer@redhat.com>,
	dm-devel@redhat.com
Cc: Shaohua Li <shli@kernel.org>,
	linux-raid@vger.kernel.org, linux-kernel@vger.kernel.org,
	Grant Grundler <grundler@chromium.org>,
	Michael Davidson <md@google.com>,
	Greg Hackmann <ghackmann@google.com>
Subject: Re: [PATCH] dm ioctl: Remove double parentheses
Date: Fri, 31 Mar 2017 18:50:19 -0700	[thread overview]
Message-ID: <20170401015019.GA13986@google.com> (raw)
In-Reply-To: <20170316164830.127026-1-mka@chromium.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 <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 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

  reply	other threads:[~2017-04-01  1:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-16 16:48 [PATCH] dm ioctl: Remove double parentheses Matthias Kaehlcke
2017-04-01  1:50 ` Matthias Kaehlcke [this message]
2017-04-01  2:07   ` Joe Perches
2017-04-01  2:07     ` Joe Perches
2017-04-03 16:56     ` Matthias Kaehlcke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170401015019.GA13986@google.com \
    --to=mka@chromium.org \
    --cc=agk@redhat.com \
    --cc=dm-devel@redhat.com \
    --cc=ghackmann@google.com \
    --cc=grundler@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=md@google.com \
    --cc=shli@kernel.org \
    --cc=snitzer@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.