[patch] comparison of u_int against < 0 in g_journal.c

Alexander Best arundel at freebsd.org
Mon Feb 7 21:37:38 UTC 2011


hi there,

this was reported by clang 2.9 (dev) as -Wtautological-compare warning. i think
clang is right, because cswitch is of type u_int.

cheers.
alex

-- 
a13x
-------------- next part --------------
Index: sys/geom/journal/g_journal.c
===================================================================
--- sys/geom/journal/g_journal.c	(revision 218413)
+++ sys/geom/journal/g_journal.c	(working copy)
@@ -173,7 +173,7 @@
 	error = sysctl_handle_int(oidp, &cswitch, 0, req);
 	if (error != 0 || req->newptr == NULL)
 		return (error);
-	if (cswitch < 0 || cswitch > 100)
+	if (cswitch > 100)
 		return (EINVAL);
 	g_journal_cache_switch = cswitch;
 	g_journal_cache_low = (g_journal_cache_limit / 100) * cswitch;


More information about the freebsd-geom mailing list