DPDK patches and discussions
 help / color / mirror / Atom feed
From: Chas Williams <3chas3@gmail.com>
To: Andrzej Ostruszka <amo@semihalf.com>, dev@dpdk.org
Cc: Andrzej Ostruszka <aostruszka@marvell.com>
Subject: Re: [dpdk-dev] [PATCH 05/10] app/test: fix maybe-uninitialized warnings for LTO build
Date: Thu, 5 Sep 2019 09:25:48 -0400	[thread overview]
Message-ID: <85b8287e-4396-6cdd-bd24-79ebfd408e3c@gmail.com> (raw)
In-Reply-To: <20190905093239.27187-6-amo@semihalf.com>



On 9/5/19 5:32 AM, Andrzej Ostruszka wrote:
> During LTO build compiler reports some 'false positive' warnings about
> variables being possibly used uninitialized.  This patch silences these
> warnings.
> 
> Signed-off-by: Andrzej Ostruszka <aostruszka@marvell.com>
> ---
>   app/test/test_hash_readwrite.c     | 2 +-
>   app/test/test_link_bonding_mode4.c | 6 ++++--
>   app/test/test_memzone.c            | 3 ++-
>   3 files changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/app/test/test_hash_readwrite.c b/app/test/test_hash_readwrite.c
> index 4376b099b..615767fb6 100644
> --- a/app/test/test_hash_readwrite.c
> +++ b/app/test/test_hash_readwrite.c
> @@ -298,7 +298,7 @@ test_rw_reader(void *arg)
>   
>   	begin = rte_rdtsc_precise();
>   	for (i = 0; i < read_cnt; i++) {
> -		void *data;
> +		void *data = arg;
>   		rte_hash_lookup_data(tbl_rw_test_param.h,
>   				tbl_rw_test_param.keys + i,
>   				&data);
> diff --git a/app/test/test_link_bonding_mode4.c b/app/test/test_link_bonding_mode4.c
> index bbb4e9cce..8ca376dda 100644
> --- a/app/test/test_link_bonding_mode4.c
> +++ b/app/test/test_link_bonding_mode4.c
> @@ -224,7 +224,7 @@ configure_ethdev(uint16_t port_id, uint8_t start)
>   static int
>   add_slave(struct slave_conf *slave, uint8_t start)
>   {
> -	struct rte_ether_addr addr, addr_check;
> +	struct rte_ether_addr addr, addr_check = { { 0 } };
>   
>   	/* Some sanity check */
>   	RTE_VERIFY(test_params.slave_ports <= slave &&
> @@ -578,7 +578,9 @@ bond_get_update_timeout_ms(void)
>   {
>   	struct rte_eth_bond_8023ad_conf conf;
>   
> -	rte_eth_bond_8023ad_conf_get(test_params.bonded_port_id, &conf);
> +	if (rte_eth_bond_8023ad_conf_get(test_params.bonded_port_id, &conf) < 0)
> +		return 0;
> +

This would return a delay of 0ms, which doesn't feel like it captures 
the intent of conf_get failing. Perhaps a TEST_ASSERT_FAILURE() instead?

>   	return conf.update_timeout_ms;
>   }
>   
> diff --git a/app/test/test_memzone.c b/app/test/test_memzone.c
> index 7501b63c5..c284dcb44 100644
> --- a/app/test/test_memzone.c
> +++ b/app/test/test_memzone.c
> @@ -476,7 +476,8 @@ find_max_block_free_size(unsigned int align, unsigned int socket_id)
>   	struct rte_malloc_socket_stats stats;
>   	size_t len, overhead;
>   
> -	rte_malloc_get_socket_stats(socket_id, &stats);
> +	if (rte_malloc_get_socket_stats(socket_id, &stats) < 0)
> +		return 0;
>   
>   	len = stats.greatest_free_size;
>   	overhead = MALLOC_ELEM_OVERHEAD;
> 

  reply	other threads:[~2019-09-05 13:25 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-05  9:32 [dpdk-dev] [PATCH 00/10] Add an option to use LTO for DPDK build Andrzej Ostruszka
2019-09-05  9:32 ` [dpdk-dev] [PATCH 01/10] build: add an option to enable LTO build Andrzej Ostruszka
2019-09-05  9:36   ` Bruce Richardson
2019-09-05  9:43     ` Andrzej Ostruszka
2019-09-05  9:51       ` Bruce Richardson
2019-09-05  9:32 ` [dpdk-dev] [PATCH 02/10] eventdev: fix possible use of uninitialized var Andrzej Ostruszka
2019-09-05  9:32 ` [dpdk-dev] [PATCH 03/10] app/eventdev: fix maybe-uninitialized warnings for LTO build Andrzej Ostruszka
2019-09-05  9:32 ` [dpdk-dev] [PATCH 04/10] event/octeontx2: " Andrzej Ostruszka
2019-09-05  9:32 ` [dpdk-dev] [PATCH 05/10] app/test: " Andrzej Ostruszka
2019-09-05 13:25   ` Chas Williams [this message]
2019-09-17 10:41     ` Andrzej Ostruszka
2019-09-05  9:32 ` [dpdk-dev] [PATCH 06/10] net/dpaa2: fix possible use of uninitialized vars Andrzej Ostruszka
2019-09-05  9:32 ` [dpdk-dev] [PATCH 07/10] net/e1000: fix maybe-uninitialized warnings for LTO build Andrzej Ostruszka
2019-09-05  9:32 ` [dpdk-dev] [PATCH 08/10] net/i40e: " Andrzej Ostruszka
2019-09-05  9:32 ` [dpdk-dev] [PATCH 09/10] net/ifc: " Andrzej Ostruszka
2019-09-05  9:32 ` [dpdk-dev] [PATCH 10/10] net/qede: " Andrzej Ostruszka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=85b8287e-4396-6cdd-bd24-79ebfd408e3c@gmail.com \
    --to=3chas3@gmail.com \
    --cc=amo@semihalf.com \
    --cc=aostruszka@marvell.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).