Date: Wed, 20 Mar 2013 20:06:03 GMT From: hiren panchasara <hiren.panchasara@gmail.com> To: freebsd-gnats-submit@FreeBSD.org Subject: kern/177155: [patch] Fixing clang warnings at /sys/dev/safe Message-ID: <201303202006.r2KK632x071282@red.freebsd.org> Resent-Message-ID: <201303202010.r2KKA0Xp076617@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 177155 >Category: kern >Synopsis: [patch] Fixing clang warnings at /sys/dev/safe >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Mar 20 20:10:00 UTC 2013 >Closed-Date: >Last-Modified: >Originator: hiren panchasara >Release: current >Organization: >Environment: 10.0-CURRENT FreeBSD 10.0-CURRENT #1 r248555: Wed Mar 20 15:00:20 UTC 2013 >Description: ===> safe (all) /usr/src/sys/modules/safe/../../dev/safe/safe.c:1610:11: warning: comparison of unsigned expression >= 0 is always true [-Wtautological-compare] while (j >= 0) { ~ ^ ~ /usr/src/sys/modules/safe/../../dev/safe/safe.c:1622:11: warning: comparison of unsigned expression >= 0 is always true [-Wtautological-compare] while (j >= 0) { ~ ^ ~ 2 warnings generated. Proposed fix is replacing always true condition "j >= 0" with 1. I _hope_ this is the correct way to "fix" this. >How-To-Repeat: cd /sys/modules/safe and do "make" to see clang warnings. >Fix: Index: safe.c =================================================================== --- safe.c (revision 248555) +++ safe.c (working copy) @@ -1607,7 +1607,7 @@ * Advance src and dst to offset. */ j = offset; - while (j >= 0) { + while (1) { if (srcm->m_len > j) break; j -= srcm->m_len; @@ -1619,7 +1619,7 @@ slen = srcm->m_len - j; j = offset; - while (j >= 0) { + while (1) { if (dstm->m_len > j) break; j -= dstm->m_len; >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201303202006.r2KK632x071282>