cert: remove usused elem_data variable
PATCH 1/5 cert: remove usused elem_data variable
This was being set in the if block, but never used after that. Instead just check the return value directly.
--- ell/cert.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
ell/cert.c +1 -3
@@ -1658,7 +1658,6 @@ static int cert_try_load_der_format(const uint8_t *content, size_t content_len, {const uint8_t *seq;size_t seq_len; -const uint8_t *elem_data;size_t elem_len;uint8_t tag;
@@ -1674,8 +1673,7 @@ static int cert_try_load_der_format(const uint8_t *content, size_t content_len,* to add any more formats we'll probably need to start guessing * from the filename suffix. */ -if (!(elem_data =asn1_der_find_elem (seq, seq_len, -0 , &tag, &elem_len))) +if (!asn1_der_find_elem (seq, seq_len,0 , &tag, &elem_len))return -ENOMSG ;if (tag ==ASN1_ID_SEQUENCE ) {
Signature · 1 line
2.34.1
PATCH 2/5 dbus: remove unused 'type' variable
This was being set in the if block but never used afterwards.
--- ell/dbus.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
ell/dbus.c +1 -2
@@ -1689,8 +1689,7 @@ LIB_EXPORT unsigned int l_dbus_add_signal_watch(struct l_dbus *dbus,va_start (args, member); rule_len =0 ; - while ((type = va_arg(args, enum l_dbus_match_type)) != -L_DBUS_MATCH_NONE ) + while (va_arg(args, enum l_dbus_match_type) != L_DBUS_MATCH_NONE) rule_len++;va_end (args);
Signature · 1 line
2.34.1
PATCH 3/5 gvariant-util: remove unneeded initializer
In reply to James Prestwood'i' is initialized inside the for loop, so remove this extra initialization prior.
--- ell/gvariant-util.c | 1 - 1 file changed, 1 deletion(-)
ell/gvariant-util.c +0 -1
@@ -843,7 +843,6 @@ static void container_append_struct_offsets(struct container *container, offset_size =offset_length (builder->body_pos, container->offset_index); - i = container->offset_index -1 ; start =grow_body (builder, offset_size * container->offset_index,1 );
Signature · 1 line
2.34.1
PATCH 4/5 queue: remove unneeded entry advancement
In reply to James PrestwoodAt this point the loop is over and there is no point advancing the entry pointer.
--- ell/queue.c | 2 -- 1 file changed, 2 deletions(-)
ell/queue.c +0 -2
@@ -511,8 +511,6 @@ LIB_EXPORT void *l_queue_remove_if(struct l_queue *queue,if (!entry->next) queue->tail = prev; - entry = entry->next; - data = tmp->data;l_free (tmp);
Signature · 1 line
2.34.1
PATCH 5/5 unit: assert return of several gvariant-util calls
In reply to James PrestwoodCaught by clang static analysis, there were several calls where the return value was unused.
--- unit/test-gvariant-util.c | 3 +++ 1 file changed, 3 insertions(+)
unit/test-gvariant-util.c +3 -0
@@ -644,6 +644,7 @@ static void test_iter_variant_2(const void *test_data)assert (ret); ret =_gvariant_iter_enter_struct (&variant, &structure); +assert (ret); ret =_gvariant_iter_next_entry_basic (&structure,'s' , &s);assert (ret);
@@ -1047,6 +1048,7 @@ static void test_iter_header_1(const void *test_data) ret =_gvariant_iter_init (&iter,NULL ,"a(yv)" ,NULL , test->data +16 , u); +assert (ret); ret =_gvariant_iter_enter_array (&iter, &array);assert (ret);
@@ -1308,6 +1310,7 @@ static void test_builder_fixed_struct_2(const void *test_data)assert (ret); ret =_gvariant_builder_append_basic (builder,'t' , &t); +assert (ret); ret =_gvariant_builder_leave_struct (builder);assert (ret);
Signature · 1 line
2.34.1
Hi James,
Quoted 6 lines · James Prestwood
This was being set in the if block, but never used after that. Instead just check the return value directly.
--- ell/cert.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
All applied, thanks.
Regards,
-Denis