diff mbox

test: packet: remove unused values to address coverity scan issue

Message ID 1462407660-28314-1-git-send-email-bill.fischofer@linaro.org
State New
Headers show

Commit Message

Bill Fischofer May 5, 2016, 12:21 a.m. UTC
Resolve bug https://bugs.linaro.org/show_bug.cgi?id=2220 by removing
unused values.

Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>
---
 test/validation/packet/packet.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Mike Holmes May 5, 2016, 1:58 p.m. UTC | #1
We shouldn't mention the tool that found the issue in the subject, future
readers of git only want to know what happened.
It can be changed on merge to  test: packet: remove unused values


On 4 May 2016 at 20:21, Bill Fischofer <bill.fischofer@linaro.org> wrote:

> Resolve bug https://bugs.linaro.org/show_bug.cgi?id=2220 by removing

> unused values.

>

> Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>

> ---

>  test/validation/packet/packet.c | 5 ++---

>  1 file changed, 2 insertions(+), 3 deletions(-)

>

> diff --git a/test/validation/packet/packet.c

> b/test/validation/packet/packet.c

> index 7c9622f..bf8d9f4 100644

> --- a/test/validation/packet/packet.c

> +++ b/test/validation/packet/packet.c

> @@ -1159,7 +1159,7 @@ void packet_test_align(void)

>                 CU_ASSERT(odp_packet_align(&pkt, 0, pkt_len, 0) < 0);

>

>                 offset = seg_len - 5;

> -               pkt_data = odp_packet_offset(pkt, offset, &seg_len, NULL);

> +               (void)odp_packet_offset(pkt, offset, &seg_len, NULL);

>

>                 /* Realign for addressability */

>                 CU_ASSERT(odp_packet_align(&pkt, offset,

> @@ -1167,8 +1167,7 @@ void packet_test_align(void)

>

>                 /* Alignment doesn't change packet length or contents */

>                 CU_ASSERT(odp_packet_len(pkt) == pkt_len);

> -               aligned_data = odp_packet_offset(pkt, offset,

> -                                                &aligned_seglen, NULL);

> +               (void)odp_packet_offset(pkt, offset, &aligned_seglen,

> NULL);

>                 _packet_compare_offset(pkt, offset,

>                                        segmented_test_packet, offset,

>                                        aligned_seglen);

> --

> 2.5.0

>

> _______________________________________________

> lng-odp mailing list

> lng-odp@lists.linaro.org

> https://lists.linaro.org/mailman/listinfo/lng-odp

>




-- 
Mike Holmes
Technical Manager - Linaro Networking Group
Linaro.org <http://www.linaro.org/> *│ *Open source software for ARM SoCs
"Work should be fun and collaborative, the rest follows"
Bill Fischofer May 6, 2016, 1:02 p.m. UTC | #2
I don't know how one can speak for "future readers" (whoever they might
be). I have no objection to the edit, but we should say that it's our rule,
not concern for posterity's sensibilities that motivates it. :)

On Thu, May 5, 2016 at 8:58 AM, Mike Holmes <mike.holmes@linaro.org> wrote:

> We shouldn't mention the tool that found the issue in the subject, future

> readers of git only want to know what happened.

> It can be changed on merge to  test: packet: remove unused values

>

>

> On 4 May 2016 at 20:21, Bill Fischofer <bill.fischofer@linaro.org> wrote:

>

>> Resolve bug https://bugs.linaro.org/show_bug.cgi?id=2220 by removing

>> unused values.

>>

>> Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>

>> ---

>>  test/validation/packet/packet.c | 5 ++---

>>  1 file changed, 2 insertions(+), 3 deletions(-)

>>

>> diff --git a/test/validation/packet/packet.c

>> b/test/validation/packet/packet.c

>> index 7c9622f..bf8d9f4 100644

>> --- a/test/validation/packet/packet.c

>> +++ b/test/validation/packet/packet.c

>> @@ -1159,7 +1159,7 @@ void packet_test_align(void)

>>                 CU_ASSERT(odp_packet_align(&pkt, 0, pkt_len, 0) < 0);

>>

>>                 offset = seg_len - 5;

>> -               pkt_data = odp_packet_offset(pkt, offset, &seg_len, NULL);

>> +               (void)odp_packet_offset(pkt, offset, &seg_len, NULL);

>>

>>                 /* Realign for addressability */

>>                 CU_ASSERT(odp_packet_align(&pkt, offset,

>> @@ -1167,8 +1167,7 @@ void packet_test_align(void)

>>

>>                 /* Alignment doesn't change packet length or contents */

>>                 CU_ASSERT(odp_packet_len(pkt) == pkt_len);

>> -               aligned_data = odp_packet_offset(pkt, offset,

>> -                                                &aligned_seglen, NULL);

>> +               (void)odp_packet_offset(pkt, offset, &aligned_seglen,

>> NULL);

>>                 _packet_compare_offset(pkt, offset,

>>                                        segmented_test_packet, offset,

>>                                        aligned_seglen);

>> --

>> 2.5.0

>>

>> _______________________________________________

>> lng-odp mailing list

>> lng-odp@lists.linaro.org

>> https://lists.linaro.org/mailman/listinfo/lng-odp

>>

>

>

>

> --

> Mike Holmes

> Technical Manager - Linaro Networking Group

> Linaro.org <http://www.linaro.org/> *│ *Open source software for ARM SoCs

> "Work should be fun and collaborative, the rest follows"

>

>

>
Mike Holmes May 6, 2016, 1:19 p.m. UTC | #3
It is already caught in some cases by checkpatch, and I think it is
standard kernel practice, but agree we should add it to CONTRIBUTING


# Check email subject for common tools that don't need to be mentioned
if ($in_header_lines &&
$line =~ /^Subject:.*\b(?:checkpatch|sparse|smatch)\b[^:]/i) {
WARN("EMAIL_SUBJECT",
"A patch subject line should describe the change not the tool that found
it\n" . $herecurr);
On 6 May 2016 at 09:02, Bill Fischofer <bill.fischofer@linaro.org> wrote:


I don't know how one can speak for "future readers" (whoever they might
> be). I have no objection to the edit, but we should say that it's our rule,

> not concern for posterity's sensibilities that motivates it. :)

>

> On Thu, May 5, 2016 at 8:58 AM, Mike Holmes <mike.holmes@linaro.org>

> wrote:

>

>> We shouldn't mention the tool that found the issue in the subject, future

>> readers of git only want to know what happened.

>> It can be changed on merge to  test: packet: remove unused values

>>

>>

>> On 4 May 2016 at 20:21, Bill Fischofer <bill.fischofer@linaro.org> wrote:

>>

>>> Resolve bug https://bugs.linaro.org/show_bug.cgi?id=2220 by removing

>>> unused values.

>>>

>>> Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>

>>> ---

>>>  test/validation/packet/packet.c | 5 ++---

>>>  1 file changed, 2 insertions(+), 3 deletions(-)

>>>

>>> diff --git a/test/validation/packet/packet.c

>>> b/test/validation/packet/packet.c

>>> index 7c9622f..bf8d9f4 100644

>>> --- a/test/validation/packet/packet.c

>>> +++ b/test/validation/packet/packet.c

>>> @@ -1159,7 +1159,7 @@ void packet_test_align(void)

>>>                 CU_ASSERT(odp_packet_align(&pkt, 0, pkt_len, 0) < 0);

>>>

>>>                 offset = seg_len - 5;

>>> -               pkt_data = odp_packet_offset(pkt, offset, &seg_len,

>>> NULL);

>>> +               (void)odp_packet_offset(pkt, offset, &seg_len, NULL);

>>>

>>>                 /* Realign for addressability */

>>>                 CU_ASSERT(odp_packet_align(&pkt, offset,

>>> @@ -1167,8 +1167,7 @@ void packet_test_align(void)

>>>

>>>                 /* Alignment doesn't change packet length or contents */

>>>                 CU_ASSERT(odp_packet_len(pkt) == pkt_len);

>>> -               aligned_data = odp_packet_offset(pkt, offset,

>>> -                                                &aligned_seglen, NULL);

>>> +               (void)odp_packet_offset(pkt, offset, &aligned_seglen,

>>> NULL);

>>>                 _packet_compare_offset(pkt, offset,

>>>                                        segmented_test_packet, offset,

>>>                                        aligned_seglen);

>>> --

>>> 2.5.0

>>>

>>> _______________________________________________

>>> lng-odp mailing list

>>> lng-odp@lists.linaro.org

>>> https://lists.linaro.org/mailman/listinfo/lng-odp

>>>

>>

>>

>>

>> --

>> Mike Holmes

>> Technical Manager - Linaro Networking Group

>> Linaro.org <http://www.linaro.org/> *│ *Open source software for ARM SoCs

>> "Work should be fun and collaborative, the rest follows"

>>

>>

>>

>



-- 
Mike Holmes
Technical Manager - Linaro Networking Group
Linaro.org <http://www.linaro.org/> *│ *Open source software for ARM SoCs
"Work should be fun and collaborative, the rest follows"
diff mbox

Patch

diff --git a/test/validation/packet/packet.c b/test/validation/packet/packet.c
index 7c9622f..bf8d9f4 100644
--- a/test/validation/packet/packet.c
+++ b/test/validation/packet/packet.c
@@ -1159,7 +1159,7 @@  void packet_test_align(void)
 		CU_ASSERT(odp_packet_align(&pkt, 0, pkt_len, 0) < 0);
 
 		offset = seg_len - 5;
-		pkt_data = odp_packet_offset(pkt, offset, &seg_len, NULL);
+		(void)odp_packet_offset(pkt, offset, &seg_len, NULL);
 
 		/* Realign for addressability */
 		CU_ASSERT(odp_packet_align(&pkt, offset,
@@ -1167,8 +1167,7 @@  void packet_test_align(void)
 
 		/* Alignment doesn't change packet length or contents */
 		CU_ASSERT(odp_packet_len(pkt) == pkt_len);
-		aligned_data = odp_packet_offset(pkt, offset,
-						 &aligned_seglen, NULL);
+		(void)odp_packet_offset(pkt, offset, &aligned_seglen, NULL);
 		_packet_compare_offset(pkt, offset,
 				       segmented_test_packet, offset,
 				       aligned_seglen);