DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] eal: fix unused-but-set-variable error
@ 2021-10-29 17:14 Jim Harris
  2021-10-29 18:48 ` David Marchand
  0 siblings, 1 reply; 3+ messages in thread
From: Jim Harris @ 2021-10-29 17:14 UTC (permalink / raw)
  To: dev; +Cc: Jim Harris

clang-13 rightfully complains that the total_mem
variable in eal_parse_socket_arg is set but not
used, since the final accumulated total_mem
result isn't used anywhere. So just remove the
total_mem variable.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
---
 lib/eal/linux/eal.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/lib/eal/linux/eal.c b/lib/eal/linux/eal.c
index 81fdebc6a0..60b4924838 100644
--- a/lib/eal/linux/eal.c
+++ b/lib/eal/linux/eal.c
@@ -562,7 +562,6 @@ eal_parse_socket_arg(char *strval, volatile uint64_t *socket_arg)
 	char * arg[RTE_MAX_NUMA_NODES];
 	char *end;
 	int arg_num, i, len;
-	uint64_t total_mem = 0;
 
 	len = strnlen(strval, SOCKET_MEM_STRLEN);
 	if (len == SOCKET_MEM_STRLEN) {
@@ -594,7 +593,6 @@ eal_parse_socket_arg(char *strval, volatile uint64_t *socket_arg)
 				(arg[i][0] == '\0') || (end == NULL) || (*end != '\0'))
 			return -1;
 		val <<= 20;
-		total_mem += val;
 		socket_arg[i] = val;
 	}
 
-- 
2.32.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] eal: fix unused-but-set-variable error
  2021-10-29 17:14 [dpdk-dev] [PATCH] eal: fix unused-but-set-variable error Jim Harris
@ 2021-10-29 18:48 ` David Marchand
  2021-11-04 12:19   ` David Marchand
  0 siblings, 1 reply; 3+ messages in thread
From: David Marchand @ 2021-10-29 18:48 UTC (permalink / raw)
  To: Jim Harris; +Cc: dev

On Fri, Oct 29, 2021 at 7:17 PM Jim Harris <james.r.harris@intel.com> wrote:
>
> clang-13 rightfully complains that the total_mem
> variable in eal_parse_socket_arg is set but not
> used, since the final accumulated total_mem
> result isn't used anywhere. So just remove the
> total_mem variable.
>

It was left behind by change:
Fixes: 0a703f0f36c1 ("eal/linux: fix parsing zero socket memory and limits")

> Signed-off-by: Jim Harris <james.r.harris@intel.com>
> ---
>  lib/eal/linux/eal.c | 2 --
>  1 file changed, 2 deletions(-)
>
> diff --git a/lib/eal/linux/eal.c b/lib/eal/linux/eal.c
> index 81fdebc6a0..60b4924838 100644
> --- a/lib/eal/linux/eal.c
> +++ b/lib/eal/linux/eal.c
> @@ -562,7 +562,6 @@ eal_parse_socket_arg(char *strval, volatile uint64_t *socket_arg)
>         char * arg[RTE_MAX_NUMA_NODES];
>         char *end;
>         int arg_num, i, len;
> -       uint64_t total_mem = 0;
>
>         len = strnlen(strval, SOCKET_MEM_STRLEN);
>         if (len == SOCKET_MEM_STRLEN) {
> @@ -594,7 +593,6 @@ eal_parse_socket_arg(char *strval, volatile uint64_t *socket_arg)
>                                 (arg[i][0] == '\0') || (end == NULL) || (*end != '\0'))
>                         return -1;
>                 val <<= 20;
> -               total_mem += val;
>                 socket_arg[i] = val;
>         }
>


Reviewed-by: David Marchand <david.marchand@redhat.com>


-- 
David Marchand


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] eal: fix unused-but-set-variable error
  2021-10-29 18:48 ` David Marchand
@ 2021-11-04 12:19   ` David Marchand
  0 siblings, 0 replies; 3+ messages in thread
From: David Marchand @ 2021-11-04 12:19 UTC (permalink / raw)
  To: Jim Harris; +Cc: dev

On Fri, Oct 29, 2021 at 8:48 PM David Marchand
<david.marchand@redhat.com> wrote:
>
> On Fri, Oct 29, 2021 at 7:17 PM Jim Harris <james.r.harris@intel.com> wrote:
> >
> > clang-13 rightfully complains that the total_mem
> > variable in eal_parse_socket_arg is set but not
> > used, since the final accumulated total_mem
> > result isn't used anywhere. So just remove the
> > total_mem variable.
>
> Fixes: 0a703f0f36c1 ("eal/linux: fix parsing zero socket memory and limits")
>
> > Signed-off-by: Jim Harris <james.r.harris@intel.com>
> Reviewed-by: David Marchand <david.marchand@redhat.com>

Applied, thanks.


-- 
David Marchand


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-11-04 12:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-29 17:14 [dpdk-dev] [PATCH] eal: fix unused-but-set-variable error Jim Harris
2021-10-29 18:48 ` David Marchand
2021-11-04 12:19   ` David Marchand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).