Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1611758

[PATCH 2/2] mdadm.c: fix compile error "switch condition has boolean value"

From Gioh Kim <gi-oh.kim@profitbricks.com>
Newsgroups linux.kernel
Subject [PATCH 2/2] mdadm.c: fix compile error "switch condition has boolean value"
Date 2017-03-29 11:50 +0200
Message-ID <tqioP-51x-41@gated-at.bofh.it> (permalink)
References <tqioO-51x-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Remove a boolean expression in switch condition
to prevent compile error of some compilers.

Signed-off-by: Gioh Kim <gi-oh.kim@profitbricks.com>
---
 mdadm.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/mdadm.c b/mdadm.c
index 08ddcab..a98a051 100644
--- a/mdadm.c
+++ b/mdadm.c
@@ -1905,11 +1905,11 @@ static int misc_list(struct mddev_dev *devlist,
 			rv |= SetAction(dv->devname, c->action);
 			continue;
 		}
-		switch(dv->devname[0] == '/') {
-			case 0:
+		switch(dv->devname[0]) {
+			default:
 				mdfd = open_dev(dv->devname);
 				if (mdfd >= 0) break;
-			case 1:
+			case '/':
 				mdfd = open_mddev(dv->devname, 1);  
 		}
 		if (mdfd>=0) {
-- 
2.5.0

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 1/2] super1: replace hard-coded values with bit definitions Gioh Kim <gi-oh.kim@profitbricks.com> - 2017-03-29 11:50 +0200
  [PATCH 2/2] mdadm.c: fix compile error "switch condition has boolean value" Gioh Kim <gi-oh.kim@profitbricks.com> - 2017-03-29 11:50 +0200
    Re: [PATCH 2/2] mdadm.c: fix compile error "switch condition has boolean value" jes.sorensen@gmail.com - 2017-03-29 17:50 +0200
      Re: [PATCH 2/2] mdadm.c: fix compile error "switch condition has  boolean value" Gioh Kim <gi-oh.kim@profitbricks.com> - 2017-03-29 18:00 +0200
      Re: [PATCH 2/2] mdadm.c: fix compile error "switch condition has boolean value" NeilBrown <neilb@suse.com> - 2017-03-29 23:40 +0200
        Re: [PATCH 2/2] mdadm.c: fix compile error "switch condition has  boolean value" Gioh Kim <gi-oh.kim@profitbricks.com> - 2017-03-30 10:00 +0200
          Re: [PATCH 2/2] mdadm.c: fix compile error "switch condition has  boolean value" Jes Sorensen <jes.sorensen@gmail.com> - 2017-03-30 18:00 +0200
  Re: [PATCH 1/2] super1: replace hard-coded values with bit definitions jes.sorensen@gmail.com - 2017-03-29 17:50 +0200

csiph-web