[patch] comparison of u_long against < 0 in linux32_machdep.c

Alexander Best arundel at freebsd.org
Mon Feb 7 22:52:16 UTC 2011


hi there,

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

cheers.
alex

-- 
a13x
-------------- next part --------------
Index: sys/amd64/linux32/linux32_machdep.c
===================================================================
--- sys/amd64/linux32/linux32_machdep.c	(revision 218413)
+++ sys/amd64/linux32/linux32_machdep.c	(working copy)
@@ -911,7 +911,7 @@
 {
 	int error;
 
-	if (args->level < 0 || args->level > 3)
+	if (args->level > 3)
 		return (EINVAL);
 	if ((error = priv_check(td, PRIV_IO)) != 0)
 		return (error);


More information about the freebsd-emulation mailing list