diff options
author | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2022-09-27 12:24:19 -0700 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2022-09-27 12:25:37 -0700 |
commit | 293d670fb0ec51b69cdd0b9bf625b1e4d3a7975f (patch) | |
tree | 802252aafb40184e123d5ba5c0dc3699ebe45d32 /monitor | |
parent | 643b074d7dc7f722588192eea852ce2e0d0584ae (diff) | |
download | bluez-293d670fb0ec51b69cdd0b9bf625b1e4d3a7975f.tar.gz |
monitor/packet: Fix scan-build warnings
This fixes the following warnings:
monitor/packet.c:410:4: warning: Value stored to 'ts_pos' is never read
[deadcode.DeadStores]
ts_pos += n;
^ ~
monitor/packet.c:455:4: warning: Value stored to 'pos' is never read
[deadcode.DeadStores]
pos += n;
^ ~
monitor/packet.c:7477:2: warning: Value stored to 'mask' is never read
[deadcode.DeadStores]
mask = tx_phys;
^ ~~~~~~~
monitor/packet.c:7485:2: warning: Value stored to 'mask' is never read
[deadcode.DeadStores]
mask = rx_phys;
^ ~~~~~~~
monitor/packet.c:11229:3: warning: Value stored to 'str' is never read
[deadcode.DeadStores]
str = "AoA Constant Tone Extension";
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
monitor/packet.c:11232:3: warning: Value stored to 'str' is never read
[deadcode.DeadStores]
str = "AoA Constant Tone Extension with 1us slots";
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
monitor/packet.c:11235:3: warning: Value stored to 'str' is never read
[deadcode.DeadStores]
str = "AoD Constant Tone Extension with 2us slots";
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
monitor/packet.c:11238:3: warning: Value stored to 'str' is never read
[deadcode.DeadStores]
str = "No Constant Tone Extension";
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
monitor/packet.c:11241:3: warning: Value stored to 'str' is never read
[deadcode.DeadStores]
str = "Reserved";
^ ~~~~~~~~~~
monitor/packet.c:11242:3: warning: Value stored to 'color_on' is never read
[deadcode.DeadStores]
color_on = COLOR_RED;
^ ~~~~~~~~~
Diffstat (limited to 'monitor')
-rw-r--r-- | monitor/packet.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/monitor/packet.c b/monitor/packet.c index 1a41498e9..692012029 100644 --- a/monitor/packet.c +++ b/monitor/packet.c @@ -405,12 +405,7 @@ static void print_packet(struct timeval *tv, struct ucred *cred, char ident, } if (use_color()) { - n = sprintf(ts_str + ts_pos, "%s", COLOR_OFF); - if (n > 0) - ts_pos += n; - } - - if (use_color()) { + sprintf(ts_str + ts_pos, "%s", COLOR_OFF); n = sprintf(line + pos, "%s", color); if (n > 0) pos += n; @@ -451,10 +446,8 @@ static void print_packet(struct timeval *tv, struct ucred *cred, char ident, if (extra) { n = sprintf(line + pos, " %s", extra); - if (n > 0) { - pos += n; + if (n > 0) len += n; - } } if (ts_len > 0) { @@ -7474,7 +7467,6 @@ static void print_le_phys_preference(uint8_t all_phys, uint8_t tx_phys, " (0x%2.2x)", mask); print_field("TX PHYs preference: 0x%2.2x", tx_phys); - mask = tx_phys; mask = print_bitfield(2, tx_phys, le_phys); if (mask) @@ -7482,7 +7474,6 @@ static void print_le_phys_preference(uint8_t all_phys, uint8_t tx_phys, " (0x%2.2x)", mask); print_field("RX PHYs preference: 0x%2.2x", rx_phys); - mask = rx_phys; mask = print_bitfield(2, rx_phys, le_phys); if (mask) @@ -11239,10 +11230,11 @@ static void le_pa_report_evt(uint16_t index, const void *data, uint8_t size) break; default: str = "Reserved"; - color_on = COLOR_RED; break; } + print_field("CTE Type: %s (0x%2x)", str, evt->cte_type); + switch (evt->data_status) { case 0x00: str = "Complete"; |