[v2] event/dsw: fix gcc 4.8 false positive warning

Message ID 20200415181537.30087-1-mattias.ronnblom@ericsson.com (mailing list archive)
State Accepted, archived
Delegated to: David Marchand
Headers
Series [v2] event/dsw: fix gcc 4.8 false positive warning |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-testing success Testing PASS
ci/Intel-compilation success Compilation OK

Commit Message

Mattias Rönnblom April 15, 2020, 6:15 p.m. UTC
  Add redundant stack variable initialization to work around
false-positive warnings in older versions of GCC.

Fixes: bba7a1aeef46 ("event/dsw: improve migration mechanism")
Cc: stable@dpdk.org

Signed-off-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>
---
 drivers/event/dsw/dsw_event.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
  

Comments

David Marchand April 15, 2020, 7:45 p.m. UTC | #1
On Wed, Apr 15, 2020 at 8:15 PM Mattias Rönnblom
<mattias.ronnblom@ericsson.com> wrote:
>
> Add redundant stack variable initialization to work around
> false-positive warnings in older versions of GCC.
>
> Fixes: bba7a1aeef46 ("event/dsw: improve migration mechanism")

The commitid in master is 1f2b99e8d.

> Cc: stable@dpdk.org

Original commit is not a fix and is only in master, dropped stable.


Applied directly in master to avoid build failures in the CI.
  
Mattias Rönnblom April 16, 2020, 6:15 a.m. UTC | #2
On 2020-04-15 21:45, David Marchand wrote:
> On Wed, Apr 15, 2020 at 8:15 PM Mattias Rönnblom
> <mattias.ronnblom@ericsson.com> wrote:
>> Add redundant stack variable initialization to work around
>> false-positive warnings in older versions of GCC.
>>
>> Fixes: bba7a1aeef46 ("event/dsw: improve migration mechanism")
> The commitid in master is 1f2b99e8d.
>
>> Cc: stable@dpdk.org
> Original commit is not a fix and is only in master, dropped stable.
>
>
> Applied directly in master to avoid build failures in the CI.
>
Thanks.
  

Patch

diff --git a/drivers/event/dsw/dsw_event.c b/drivers/event/dsw/dsw_event.c
index 73a9d38cb..e5e3597aa 100644
--- a/drivers/event/dsw/dsw_event.c
+++ b/drivers/event/dsw/dsw_event.c
@@ -442,10 +442,10 @@  dsw_select_emigration_target(struct dsw_evdev *dsw,
 			    uint8_t *targets_len)
 {
 	int16_t source_port_load = port_loads[source_port_id];
-	struct dsw_queue_flow *candidate_qf;
-	uint8_t candidate_port_id;
+	struct dsw_queue_flow *candidate_qf = NULL;
+	uint8_t candidate_port_id = 0;
 	int16_t candidate_weight = -1;
-	int16_t candidate_flow_load;
+	int16_t candidate_flow_load = -1;
 	uint16_t i;
 
 	if (source_port_load < DSW_MIN_SOURCE_LOAD_FOR_MIGRATION)