2facd39dcaca3ad22e4b5e90ac662b020ee9e497
[pti/rtp.git] / meta-oran / recipes-extended / dpdk / dpdk / 0001-examples-Fix-maybe-uninitialized-warning.patch
1 From 41ac64efa5050430b73e0f8813dffc7327083273 Mon Sep 17 00:00:00 2001
2 From: Khem Raj <raj.khem@gmail.com>
3 Date: Tue, 1 Aug 2017 20:18:46 -0700
4 Subject: [PATCH] examples: Fix maybe-uninitialized warning
5
6 Initialize arrays to 0, makes compiler happy about
7
8 error: 'vals[0]' may be used uninitialized in this function [-Werror=maybe-uninitialized]
9
10 Signed-off-by: Khem Raj <raj.khem@gmail.com>
11
12 ---
13  examples/qos_sched/args.c   | 2 +-
14  examples/vhost/virtio_net.c | 2 +-
15  2 files changed, 2 insertions(+), 2 deletions(-)
16
17 diff --git a/examples/qos_sched/args.c b/examples/qos_sched/args.c
18 index 83eee95cc28e..3d2c0fbd6d0a 100644
19 --- a/examples/qos_sched/args.c
20 +++ b/examples/qos_sched/args.c
21 @@ -212,7 +212,7 @@ static int
22  app_parse_flow_conf(const char *conf_str)
23  {
24         int ret;
25 -       uint32_t vals[5];
26 +       uint32_t vals[5] = {0};
27         struct flow_conf *pconf;
28         uint64_t mask;
29  
30 diff --git a/examples/vhost/virtio_net.c b/examples/vhost/virtio_net.c
31 index f6e00674d9af..a4a90704d7b4 100644
32 --- a/examples/vhost/virtio_net.c
33 +++ b/examples/vhost/virtio_net.c
34 @@ -293,7 +293,7 @@ vs_dequeue_pkts(struct vhost_dev *dev, uint16_t queue_id,
35  {
36         struct vhost_queue *queue;
37         struct rte_vhost_vring *vr;
38 -       uint32_t desc_indexes[MAX_PKT_BURST];
39 +       uint32_t desc_indexes[MAX_PKT_BURST] = {0};
40         uint32_t used_idx;
41         uint32_t i = 0;
42         uint16_t free_entries;