Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 1 Apr 2021 07:59:25 GMT
From:      Dmitry Chagin <dchagin@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 3802433d25c9 - stable/12 - Fix warning about signed comparison and drop WARNS for ktrdump(8).
Message-ID:  <202104010759.1317xPWJ029949@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/12 has been updated by dchagin:

URL: https://cgit.FreeBSD.org/src/commit/?id=3802433d25c9274fe71f024bbf260aa1450a3e1a

commit 3802433d25c9274fe71f024bbf260aa1450a3e1a
Author:     Dmitry Chagin <dchagin@FreeBSD.org>
AuthorDate: 2021-03-24 07:51:25 +0000
Commit:     Dmitry Chagin <dchagin@FreeBSD.org>
CommitDate: 2021-04-01 07:52:34 +0000

    Fix warning about signed comparison and drop WARNS for ktrdump(8).
    
    Reviewed By:            jhb, imp
    Differential Revision:  https://reviews.freebsd.org/D29381
    
    (cherry picked from commit 9e5aeba51b431256adfd18b087ee61b09bfd6a79)
---
 usr.bin/ktrdump/Makefile  |  2 --
 usr.bin/ktrdump/ktrdump.c | 14 +++++++-------
 2 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/usr.bin/ktrdump/Makefile b/usr.bin/ktrdump/Makefile
index 63cd2cf2cea9..796569977f0f 100644
--- a/usr.bin/ktrdump/Makefile
+++ b/usr.bin/ktrdump/Makefile
@@ -4,6 +4,4 @@ PROG=	ktrdump
 LIBADD=	kvm
 MAN=	ktrdump.8
 
-WARNS?=	2
-
 .include <bsd.prog.mk>
diff --git a/usr.bin/ktrdump/ktrdump.c b/usr.bin/ktrdump/ktrdump.c
index 750f138f5485..bbe8fb19aae9 100644
--- a/usr.bin/ktrdump/ktrdump.c
+++ b/usr.bin/ktrdump/ktrdump.c
@@ -56,11 +56,11 @@ __FBSDID("$FreeBSD$");
 static void usage(void);
 
 static struct nlist nl[] = {
-	{ "_ktr_version" },
-	{ "_ktr_entries" },
-	{ "_ktr_idx" },
-	{ "_ktr_buf" },
-	{ NULL }
+	{ .n_name = "_ktr_version" },
+	{ .n_name = "_ktr_entries" },
+	{ .n_name = "_ktr_idx" },
+	{ .n_name = "_ktr_buf" },
+	{ .n_name = NULL }
 };
 
 static int cflag;
@@ -262,7 +262,7 @@ main(int ac, char **av)
 		fprintf(out, "\n");
 	}
 
-	tlast = -1;
+	tlast = UINTPTR_MAX;
 	/*
 	 * Now tear through the trace buffer.
 	 *
@@ -327,7 +327,7 @@ next:			if ((c = *p++) == '\0')
 		if (tflag) {
 			tnow = (uintmax_t)buf[i].ktr_timestamp;
 			if (rflag) {
-				if (tlast == -1)
+				if (tlast == UINTPTR_MAX)
 					tlast = tnow;
 				fprintf(out, "%16ju ", !iflag ? tlast - tnow :
 				    tnow - tlast);



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