astlpc: Refactor redundant assertion and associated logic
The type of the pkt_size member was changed from int to size_t and
therefore the assertion always holds. The assertion was protecting the
subsequent cast to uint32_t, so the assertion is deleted and the cast
replaced by ensuring body is of the right type for the comparison.
Fixes: #10
Fixes: e889b19f4b34 ("core: Make pkt_size and pkt_pad size_t")
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: I6600bb242b66fd8510a150e1a508a7f572beb8d0
diff --git a/astlpc.c b/astlpc.c
index df4e245..4cf5dac 100644
--- a/astlpc.c
+++ b/astlpc.c
@@ -988,8 +988,7 @@
return;
}
- assert(astlpc->binding.pkt_size >= 0);
- if (body > (uint32_t)astlpc->binding.pkt_size) {
+ if ((size_t)body > astlpc->binding.pkt_size) {
astlpc_prwarn(astlpc, "invalid RX len 0x%x", body);
return;
}