From: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
To: dev@dpdk.org
Cc: vladimir.medvedkin@intel.com
Subject: [dpdk-dev] [PATCH 1/4] app/testfib: fix possible uninitialized warning
Date: Mon, 9 Mar 2020 12:42:20 +0000 [thread overview]
Message-ID: <1583757743-375198-2-git-send-email-vladimir.medvedkin@intel.com> (raw)
In-Reply-To: <1583757743-375198-1-git-send-email-vladimir.medvedkin@intel.com>
Compiller can throw warning message for routes and lookup files.
Fixes: 103809d032cd ("app/test-fib: add test application for FIB")
Cc: vladimir.medvedkin@intel.com
Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
---
app/test-fib/main.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/app/test-fib/main.c b/app/test-fib/main.c
index 3c29ca4..aa83f76 100644
--- a/app/test-fib/main.c
+++ b/app/test-fib/main.c
@@ -362,7 +362,7 @@ complete_v6_addr(uint32_t *addr, uint32_t rnd, int n)
static void
gen_random_rt_6(struct rt_rule_6 *rt, int nh_sz)
{
- uint32_t i, j, k = 0;
+ uint32_t a, i, j, k = 0;
if (config.nb_routes_per_depth[0] != 0) {
memset(rt[k].addr, 0, 16);
@@ -370,7 +370,7 @@ gen_random_rt_6(struct rt_rule_6 *rt, int nh_sz)
rt[k++].nh = rte_rand() & get_max_nh(nh_sz);
}
- for (int a = 0; a < 4; a++) {
+ for (a = 0; a < 4; a++) {
for (i = 1; i <= 32; i++) {
uint32_t rnd;
double edge = 0;
@@ -1145,7 +1145,8 @@ int
main(int argc, char **argv)
{
int ret, af, rt_ent_sz, lookup_ent_sz;
- FILE *fr, *fl;
+ FILE *fr = NULL;
+ FILE *fl = NULL;
uint8_t depth_lim;
ret = rte_eal_init(argc, argv);
@@ -1207,7 +1208,7 @@ main(int argc, char **argv)
rte_exit(-ENOMEM, "Can not alloc lookup table\n");
/* Fill routes table */
- if (config.routes_file == NULL) {
+ if (fr == NULL) {
if (distrib_string != NULL)
ret = parse_distrib(depth_lim, config.nb_routes);
else {
@@ -1243,7 +1244,7 @@ main(int argc, char **argv)
}
/* Fill lookup table with ip's*/
- if (config.lookup_ips_file == NULL)
+ if (fl == NULL)
gen_rnd_lookup_tbl(af);
else {
ret = parse_lookup(fl, af);
--
2.7.4
next prev parent reply other threads:[~2020-03-09 12:42 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-09 12:42 [dpdk-dev] [PATCH 0/4] app/testfib: testfib app various fixes Vladimir Medvedkin
2020-03-09 12:42 ` Vladimir Medvedkin [this message]
2020-03-09 12:42 ` [dpdk-dev] [PATCH 2/4] app/testfib: fix format string Vladimir Medvedkin
2020-03-09 12:42 ` [dpdk-dev] [PATCH 3/4] app/testfib: get rid of libresolv dependency Vladimir Medvedkin
2020-03-09 12:42 ` [dpdk-dev] [PATCH 4/4] app: enable test-fib application Vladimir Medvedkin
2020-04-10 9:46 ` [dpdk-dev] [PATCH 0/4] app/testfib: testfib app various fixes David Marchand
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=1583757743-375198-2-git-send-email-vladimir.medvedkin@intel.com \
--to=vladimir.medvedkin@intel.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).