fix(libtl): evaluate condition for boolean
A literal 0 shall not be used as a null pointer constant.
In these cases, pointer variables were being implicitly
compared using if (ptr) syntax. The condition is now explicitly
checked using if (ptr != NULL) to ensure clarity and compliance
with the rule.
Change-Id: Ia1a793925fa519e09a1ddd7eaf43cabb4617c94f
Signed-off-by: Pranav Tilak <pranav.vinaytilak@amd.com>
diff --git a/src/generic/transfer_list.c b/src/generic/transfer_list.c
index f83b812..5d05066 100644
--- a/src/generic/transfer_list.c
+++ b/src/generic/transfer_list.c
@@ -43,7 +43,7 @@
void transfer_entry_dump(struct transfer_list_entry *te)
{
- if (te) {
+ if (te != NULL) {
info("tag_id 0x%x\n", te->tag_id);
info("hdr_size 0x%x\n", te->hdr_size);
info("data_size 0x%x\n", te->data_size);
@@ -181,7 +181,7 @@
tl_ev = (uintptr_t)tl + tl->size;
- if (last) {
+ if (last != NULL) {
va = (uintptr_t)last;
/* check if the total size overflow */
if (libtl_add_overflow(last->hdr_size, last->data_size, &sz)) {