X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=meta-oran%2Frecipes-extended%2Fdpdk%2Fdpdk%2F0001-examples-Fix-maybe-uninitialized-warning.patch;fp=meta-oran%2Frecipes-extended%2Fdpdk%2Fdpdk%2F0001-examples-Fix-maybe-uninitialized-warning.patch;h=2facd39dcaca3ad22e4b5e90ac662b020ee9e497;hb=ada32bb68d867cf6e768a252c56a0259e3075ecb;hp=0000000000000000000000000000000000000000;hpb=73acc91cf12856a26eb6b946242af0fa7dee6403;p=pti%2Frtp.git diff --git a/meta-oran/recipes-extended/dpdk/dpdk/0001-examples-Fix-maybe-uninitialized-warning.patch b/meta-oran/recipes-extended/dpdk/dpdk/0001-examples-Fix-maybe-uninitialized-warning.patch new file mode 100644 index 0000000..2facd39 --- /dev/null +++ b/meta-oran/recipes-extended/dpdk/dpdk/0001-examples-Fix-maybe-uninitialized-warning.patch @@ -0,0 +1,42 @@ +From 41ac64efa5050430b73e0f8813dffc7327083273 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Tue, 1 Aug 2017 20:18:46 -0700 +Subject: [PATCH] examples: Fix maybe-uninitialized warning + +Initialize arrays to 0, makes compiler happy about + +error: 'vals[0]' may be used uninitialized in this function [-Werror=maybe-uninitialized] + +Signed-off-by: Khem Raj + +--- + examples/qos_sched/args.c | 2 +- + examples/vhost/virtio_net.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/examples/qos_sched/args.c b/examples/qos_sched/args.c +index 83eee95cc28e..3d2c0fbd6d0a 100644 +--- a/examples/qos_sched/args.c ++++ b/examples/qos_sched/args.c +@@ -212,7 +212,7 @@ static int + app_parse_flow_conf(const char *conf_str) + { + int ret; +- uint32_t vals[5]; ++ uint32_t vals[5] = {0}; + struct flow_conf *pconf; + uint64_t mask; + +diff --git a/examples/vhost/virtio_net.c b/examples/vhost/virtio_net.c +index f6e00674d9af..a4a90704d7b4 100644 +--- a/examples/vhost/virtio_net.c ++++ b/examples/vhost/virtio_net.c +@@ -293,7 +293,7 @@ vs_dequeue_pkts(struct vhost_dev *dev, uint16_t queue_id, + { + struct vhost_queue *queue; + struct rte_vhost_vring *vr; +- uint32_t desc_indexes[MAX_PKT_BURST]; ++ uint32_t desc_indexes[MAX_PKT_BURST] = {0}; + uint32_t used_idx; + uint32_t i = 0; + uint16_t free_entries;