event/dsw: fix gcc 4.8 false positive warning
authorMattias Rönnblom <mattias.ronnblom@ericsson.com>
Wed, 15 Apr 2020 18:15:37 +0000 (20:15 +0200)
committerDavid Marchand <david.marchand@redhat.com>
Wed, 15 Apr 2020 19:45:36 +0000 (21:45 +0200)
Add redundant stack variable initialization to work around
false-positive warnings in older versions of GCC.

Fixes: 1f2b99e8d9b1 ("event/dsw: improve migration mechanism")

Signed-off-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>
drivers/event/dsw/dsw_event.c

index 94c8efd..8323903 100644 (file)
@@ -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)