diff mbox

Fix -Wtautological-compare warnings with clang

Message ID alpine.BSF.2.00.1212090335350.64779@toaster.local (mailing list archive)
State Deferred
Delegated to: Alex Netes
Headers show

Commit Message

Garrett Cooper Dec. 9, 2012, 11:37 a.m. UTC
Signed-off-by: Garrett Cooper <yanegomi@gmail.com>
---
  src/ibportstate.c | 14 +++++++-------
  1 file changed, 7 insertions(+), 7 deletions(-)
diff mbox

Patch

diff --git a/src/ibportstate.c b/src/ibportstate.c
index 1d8dc81..9d90615 100644
--- a/src/ibportstate.c
+++ b/src/ibportstate.c
@@ -438,19 +438,19 @@  int main(int argc, char **argv)
  			val = strtoull(argv[i], 0, 0);
  			switch (j) {
  			case SPEED:
-				if (val < 0 || val > 15)
+				if (val > 15)
  					IBERROR("invalid speed value %ld", val);
  				break;
  			case ESPEED:
-				if (val < 0 || val > 31)
+				if (val > 31)
  					IBERROR("invalid extended speed value %ld", val);
  				break;
  			case FDR10SPEED:
-				if (val < 0 || val > 1)
+				if (val > 1)
  					IBERROR("invalid fdr10 speed value %ld", val);
  				break;
  			case WIDTH:
-				if (val < 0 || (val > 15 && val != 255))
+				if (val > 15 && val != 255)
  					IBERROR("invalid width value %ld", val);
  				break;
  			case VLS:
@@ -471,7 +471,7 @@  int main(int argc, char **argv)
  						val);
  				break;
  			case LMC:
-				if (val < 0 || val > 7)
+				if (val > 7)
  					IBERROR("invalid lmc value %ld", val);
  				break;
  			case MKEY:
@@ -488,11 +488,11 @@  int main(int argc, char **argv)
  				/* All 64-bit values are legal */
  				break;
  			case MKEYLEASE:
-				if (val < 0 || val > 0xFFFF)
+				if (val > 0xFFFF)
  					IBERROR("invalid mkey lease time %ld", val);
  				break;
  			case MKEYPROT:
-				if (val < 0 || val > 3)
+				if (val > 3)
  					IBERROR("invalid mkey protection bit setting %ld", val);
  			}
  			*port_args[j].val = val;