Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 03 Sep 2019 14:06:28 -0000
From:      Conrad Meyer <cem@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r345993 - head/sys/kern
Message-ID:  <201904062156.x36LuOnx044464@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: cem
Date: Sat Apr  6 21:56:24 2019
New Revision: 345993
URL: https://svnweb.freebsd.org/changeset/base/345993

Log:
  kern/subr_pctrie: Fix mismatched signedness in assertion comparison
  
  'tos' is an index into an array and never holds a negative value.  Correct
  its signedness to match PCTRIE_LIMIT, which it is compared to in assertions.
  
  No functional change (kills a warning).

Modified:
  head/sys/kern/subr_pctrie.c

Modified: head/sys/kern/subr_pctrie.c
==============================================================================
--- head/sys/kern/subr_pctrie.c	Sat Apr  6 21:53:46 2019	(r345992)
+++ head/sys/kern/subr_pctrie.c	Sat Apr  6 21:56:24 2019	(r345993)
@@ -385,7 +385,8 @@ pctrie_lookup_ge(struct pctrie *ptree, uint64_t index)
 #ifdef INVARIANTS
 	int loops = 0;
 #endif
-	int slot, tos;
+	unsigned tos;
+	int slot;
 
 	node = pctrie_getroot(ptree);
 	if (node == NULL)
@@ -496,7 +497,8 @@ pctrie_lookup_le(struct pctrie *ptree, uint64_t index)
 #ifdef INVARIANTS
 	int loops = 0;
 #endif
-	int slot, tos;
+	unsigned tos;
+	int slot;
 
 	node = pctrie_getroot(ptree);
 	if (node == NULL)





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201904062156.x36LuOnx044464>