Skip to content

Commit

Permalink
Fix warning about signed comparison and drop WARNS for ktrdump(8).
Browse files Browse the repository at this point in the history
Reviewed By:		jhb, imp
Differential Revision:	https://reviews.freebsd.org/D29381

(cherry picked from commit 9e5aeba)
  • Loading branch information
lemul committed Apr 1, 2021
1 parent 5e96fbd commit b4dc951
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
2 changes: 0 additions & 2 deletions usr.bin/ktrdump/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@ PROG= ktrdump
LIBADD= kvm
MAN= ktrdump.8

WARNS?= 2

.include <bsd.prog.mk>
14 changes: 7 additions & 7 deletions usr.bin/ktrdump/ktrdump.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -262,7 +262,7 @@ main(int ac, char **av)
fprintf(out, "\n");
}

tlast = -1;
tlast = UINTPTR_MAX;
/*
* Now tear through the trace buffer.
*
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit b4dc951

Please sign in to comment.