diff options
author | John Baldwin <jhb@FreeBSD.org> | 2022-05-13 09:56:43 -0700 |
---|---|---|
committer | John Baldwin <jhb@FreeBSD.org> | 2022-05-13 09:56:43 -0700 |
commit | bd396a444474f557f716cbf803229c725c38ff6f (patch) | |
tree | 4788d5e61671a3224310dde5ecfa0192f893f916 /net/isboot-kmod/files/patch-ibft.c | |
parent | sysutils/rtsx-kmod: Update to 2.0n (diff) |
net/isboot-kmod: Fix set but unused warnings.
- Remove unused variables.
- Add a __trace_unused helper macro to mark variables only used in
ISBOOT_TRACE.
Reviewed by: john@jnielsen.net (maintainer)
Differential Revision: https://reviews.freebsd.org/D35176
Diffstat (limited to 'net/isboot-kmod/files/patch-ibft.c')
-rw-r--r-- | net/isboot-kmod/files/patch-ibft.c | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/net/isboot-kmod/files/patch-ibft.c b/net/isboot-kmod/files/patch-ibft.c new file mode 100644 index 000000000000..0c68479849a8 --- /dev/null +++ b/net/isboot-kmod/files/patch-ibft.c @@ -0,0 +1,74 @@ +--- ibft.c.orig 2022-05-11 20:18:36 UTC ++++ ibft.c +@@ -146,13 +146,12 @@ ibft_print_address(uint8_t *addr) + void + ibft_print_address(uint8_t *addr) + { +- uint32_t n0, n1, n2, n3; ++ uint32_t n0, n1, n2; + + /* RFC2373 2.5.4 */ + n0 = be32toh(*(uint32_t *)(addr + 0)); + n1 = be32toh(*(uint32_t *)(addr + 4)); + n2 = be32toh(*(uint32_t *)(addr + 8)); +- n3 = be32toh(*(uint32_t *)(addr +12)); + if (n0 == 0 && n1 == 0 && n2 == 0x0000ffffU) { + /* IPv4-mapped IPv6 */ + printf("%d.%d.%d.%d", +@@ -188,7 +187,7 @@ ibft_parse_structure(uint8_t *ibft) + struct ibft_nic *n0h, *n1h; + struct ibft_target *t0h, *t1h; + char oemid[6+1], oemtableid[8+1]; +- int id, version, length, index, flags; ++ int id, length, index, flags; + int revision, checksum; + int name_length, name_offset; + int sum, i; +@@ -226,7 +225,6 @@ ibft_parse_structure(uint8_t *ibft) + /* Control Structure (18 bytes or more) */ + ch = (struct ibft_control *)(ibft + 48); + id = ch->id; +- version = ch->version; + length = le16toh(ch->length); + index = ch->index; + flags = ch->flags; +@@ -258,7 +256,6 @@ ibft_parse_structure(uint8_t *ibft) + if (ibft_initiator_offset != 0) { + ih = (struct ibft_initiator *)(ibft + ibft_initiator_offset); + id = ih->id; +- version = ih->version; + length = le16toh(ih->length); + index = ih->index; + flags = ih->flags; +@@ -307,7 +304,6 @@ ibft_parse_structure(uint8_t *ibft) + if (ibft_nic0_offset != 0) { + n0h = (struct ibft_nic *)(ibft + ibft_nic0_offset); + id = n0h->id; +- version = n0h->version; + length = le16toh(n0h->length); + index = n0h->index; + flags = n0h->flags; +@@ -396,7 +392,6 @@ ibft_parse_structure(uint8_t *ibft) + if (ibft_target0_offset != 0) { + t0h = (struct ibft_target *)(ibft + ibft_target0_offset); + id = t0h->id; +- version = t0h->version; + length = le16toh(t0h->length); + index = t0h->index; + flags = t0h->flags; +@@ -480,7 +475,6 @@ ibft_parse_structure(uint8_t *ibft) + if (ibft_nic1_offset != 0) { + n1h = (struct ibft_nic *)(ibft + ibft_nic1_offset); + id = n1h->id; +- version = n1h->version; + length = le16toh(n1h->length); + index = n1h->index; + flags = n1h->flags; +@@ -499,7 +493,6 @@ ibft_parse_structure(uint8_t *ibft) + if (ibft_target1_offset != 0) { + t1h = (struct ibft_target *)(ibft + ibft_target1_offset); + id = t1h->id; +- version = t1h->version; + length = le16toh(t1h->length); + index = t1h->index; + flags = t1h->flags; |