lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 31 Mar 2017 18:50:19 -0700
From:   Matthias Kaehlcke <mka@...omium.org>
To:     Alasdair Kergon <agk@...hat.com>,
        Mike Snitzer <snitzer@...hat.com>, dm-devel@...hat.com
Cc:     Shaohua Li <shli@...nel.org>, linux-raid@...r.kernel.org,
        linux-kernel@...r.kernel.org,
        Grant Grundler <grundler@...omium.org>,
        Michael Davidson <md@...gle.com>,
        Greg Hackmann <ghackmann@...gle.com>
Subject: Re: [PATCH] dm ioctl: Remove double parentheses

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@...omium.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ