From owner-freebsd-geom@FreeBSD.ORG Mon Feb 7 21:37:38 2011 Return-Path: Delivered-To: freebsd-geom@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id 392491065673; Mon, 7 Feb 2011 21:37:38 +0000 (UTC) Date: Mon, 7 Feb 2011 21:37:38 +0000 From: Alexander Best To: freebsd-geom@freebsd.org Message-ID: <20110207213738.GA54609@freebsd.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="45Z9DzgjV8m4Oswq" Content-Disposition: inline Subject: [patch] comparison of u_int against < 0 in g_journal.c X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Feb 2011 21:37:38 -0000 --45Z9DzgjV8m4Oswq Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 --45Z9DzgjV8m4Oswq Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="g_journal.c.diff" 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; --45Z9DzgjV8m4Oswq--