git: 74a6f2a76b32 - main - iwx: Shorten log code field

From: Tom Jones <thj_at_FreeBSD.org>
Date: Thu, 03 Apr 2025 07:07:25 UTC
The branch main has been updated by thj:

URL: https://cgit.FreeBSD.org/src/commit/?id=74a6f2a76b32e01d05c4ad71897bd3a6831e703e

commit 74a6f2a76b32e01d05c4ad71897bd3a6831e703e
Author:     Tom Jones <thj@FreeBSD.org>
AuthorDate: 2025-04-03 07:06:40 +0000
Commit:     Tom Jones <thj@FreeBSD.org>
CommitDate: 2025-04-03 07:06:40 +0000

    iwx: Shorten log code field
    
    The widest value used with code is 32 bits, other values are smaller.
    Reduce this down. Update printfs.
    
    This fixes the build on i386.
    
    Reviewed by:    bapt, emast, kevans, adrian
    Sponsored by:   The FreeBSD Foundation
    Differential Revision: https://reviews.freebsd.org/D49634
---
 sys/dev/iwx/if_iwx_debug.c | 10 +++++-----
 sys/dev/iwx/if_iwx_debug.h |  4 ++--
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/sys/dev/iwx/if_iwx_debug.c b/sys/dev/iwx/if_iwx_debug.c
index 7ce1ea8abe43..6a2bf32ad738 100644
--- a/sys/dev/iwx/if_iwx_debug.c
+++ b/sys/dev/iwx/if_iwx_debug.c
@@ -126,7 +126,7 @@ iwx_dump_cmd(uint32_t id, void *data, uint16_t len, const char *str, int type)
 }
 
 void 
-iwx_bbl_add_entry(uint64_t code, int type, int ticks)
+iwx_bbl_add_entry(uint32_t code, int type, int ticks)
 {
 	/* 
 	 * Compress together repeated notifications, but increment the sequence
@@ -162,22 +162,22 @@ iwx_bbl_print_entry(struct iwx_bbl_entry *e)
 	switch(e->type) {
 	case IWX_BBL_PKT_TX:
 		printf("pkt     ");
-		printf("seq %08d\t pkt len %ld",
+		printf("seq %08d\t pkt len %u",
 			e->seq, e->code);
 		break;
 		printf("pkt dup ");
-		printf("seq %08d\t dup count %ld",
+		printf("seq %08d\t dup count %u",
 			e->seq, e->code);
 		break;
 	case IWX_BBL_CMD_TX:
 		printf("tx ->   ");
-		printf("seq %08d\tcode 0x%08lx (%s:%s)",
+		printf("seq %08d\tcode 0x%08x (%s:%s)",
 			e->seq, e->code, get_label(command_group, group),
 			get_label(get_table(group), opcode));
 		break;
 	case IWX_BBL_CMD_RX:
 		printf("rx      ");
-		printf("seq %08d\tcode 0x%08lx (%s:%s)",
+		printf("seq %08d\tcode 0x%08x (%s:%s)",
 			e->seq, e->code, get_label(command_group, group),
 			get_label(get_table(group), opcode));
 		break;
diff --git a/sys/dev/iwx/if_iwx_debug.h b/sys/dev/iwx/if_iwx_debug.h
index 7875338ef6b6..80fd3ffa6eed 100644
--- a/sys/dev/iwx/if_iwx_debug.h
+++ b/sys/dev/iwx/if_iwx_debug.h
@@ -56,7 +56,7 @@ enum {
 void print_opcode(const char *, int, int, uint32_t);
 void print_ratenflags(const char *, int , uint32_t , int );
 void iwx_dump_cmd(uint32_t , void *, uint16_t, const char *, int);
-void iwx_bbl_add_entry(uint64_t, int, int);
+void iwx_bbl_add_entry(uint32_t, int, int);
 void iwx_bbl_print_log(void);
 
 #define IWX_BBL_NONE	0x00
@@ -254,7 +254,7 @@ static struct opcode_label phyops_opcodes[] = {
 
 struct iwx_bbl_entry {
 	uint8_t type;
-	uint64_t code;
+	uint32_t code;
 	uint32_t seq;
 	uint32_t ticks;
 	uint32_t count;