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]
Message-ID: <58DD4574.3020803@youngman.org.uk>
Date:   Thu, 30 Mar 2017 18:50:44 +0100
From:   Wols Lists <antlists@...ngman.org.uk>
To:     Gioh Kim <gi-oh.kim@...fitbricks.com>, jes.sorensen@...il.com,
        neilb@...e.com
Cc:     linux-raid@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCHv2] mdadm.c: fix compile error "switch condition has
 boolean value"

You can add my acked-by (never done it before, not sure how :-)

Cheers,
Wol

On 30/03/17 17:58, Gioh Kim wrote:
> Remove a boolean expression in switch condition
> to prevent compile error of some compilers,
> for example, gcc version 5.2.1 20151010 (Ubuntu 5.2.1-22ubuntu2).
> 
> Signed-off-by: Gioh Kim <gi-oh.kim@...fitbricks.com>
> ---
>  mdadm.c | 14 ++++++--------
>  1 file changed, 6 insertions(+), 8 deletions(-)
> 
> diff --git a/mdadm.c b/mdadm.c
> index 0f32773..d6b5437 100644
> --- a/mdadm.c
> +++ b/mdadm.c
> @@ -1965,14 +1965,12 @@ static int misc_list(struct mddev_dev *devlist,
>  			rv |= SetAction(dv->devname, c->action);
>  			continue;
>  		}
> -		switch(dv->devname[0] == '/') {
> -			case 0:
> -				mdfd = open_dev(dv->devname);
> -				if (mdfd >= 0)
> -					break;
> -			case 1:
> -				mdfd = open_mddev(dv->devname, 1);  
> -		}
> +
> +		if (dv->devname[0] != '/')
> +			mdfd = open_dev(dv->devname);
> +		if (dv->devname[0] == '/' || mdfd < 0)
> +			mdfd = open_mddev(dv->devname, 1);
> +
>  		if (mdfd >= 0) {
>  			switch(dv->disposition) {
>  			case 'R':
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ