Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 8 Jan 2017 17:56:54 +0000 (UTC)
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r311688 - head/sys/geom/vinum
Message-ID:  <201701081756.v08HusdO002359@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dim
Date: Sun Jan  8 17:56:54 2017
New Revision: 311688
URL: https://svnweb.freebsd.org/changeset/base/311688

Log:
  Fix logic error in gvinum's gv_set_sd_state()
  
  With clang 4.0.0, I'm getting the following warnings:
  
      sys/geom/vinum/geom_vinum_state.c:186:7: error: logical not is only
      applied to the left hand side of this bitwise operator
      [-Werror,-Wlogical-not-parentheses]
                      if (!flags & GV_SETSTATE_FORCE)
                          ^      ~
  
  The logical not operator should obiously be called after masking.
  
  Reviewed by:	mav, pfg
  MFC after:	3 days
  Differential Revision:	https://reviews.freebsd.org/D9093

Modified:
  head/sys/geom/vinum/geom_vinum_state.c

Modified: head/sys/geom/vinum/geom_vinum_state.c
==============================================================================
--- head/sys/geom/vinum/geom_vinum_state.c	Sun Jan  8 16:59:07 2017	(r311687)
+++ head/sys/geom/vinum/geom_vinum_state.c	Sun Jan  8 17:56:54 2017	(r311688)
@@ -183,7 +183,7 @@ gv_set_sd_state(struct gv_sd *s, int new
 		 * Only do this if we're forced, since it usually is done
 		 * internally, and then we do use the force flag. 
 		 */
-		if (!flags & GV_SETSTATE_FORCE)
+		if (!(flags & GV_SETSTATE_FORCE))
 			return (GV_ERR_SETSTATE);
 		break;
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201701081756.v08HusdO002359>