Skip to contentSkip to conversation

lockd: Eliminate harmless mixed sign comparison in nlmdbg_cookie2a()

PATCH In review Chuck Lever 1 participant 1 message Dec 20, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 7/8 lockd: Eliminate harmless mixed sign comparison in nlmdbg_cookie2a()

The cookie->len field is unsigned, so the loop index variable in nlmdbg_cookie2a() should also be unsigned.

---

 fs/lockd/xdr.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
fs/lockd/xdr.c +1 -2
index 633653b..3e459e1 100644
@@ -612,8 +612,7 @@ const char *nlmdbg_cookie2a(const struct nlm_cookie *cookie)
 	 * called with BKL held.
 	 */
 	static char buf[2*NLM_MAXCOOKIELEN+1];
-	int i;
-	int len = sizeof(buf);
+	unsigned int i, len = sizeof(buf);
 	char *p = buf;
 
 	len--;	/* allow for trailing \0 */