From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 87A0A5A35 for ; Wed, 9 Sep 2015 20:31:21 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 09 Sep 2015 11:31:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,498,1437462000"; d="scan'208";a="801682162" Received: from irsmsx107.ger.corp.intel.com ([163.33.3.99]) by fmsmga002.fm.intel.com with ESMTP; 09 Sep 2015 11:31:15 -0700 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.12]) by IRSMSX107.ger.corp.intel.com ([169.254.10.97]) with mapi id 14.03.0224.002; Wed, 9 Sep 2015 19:31:13 +0100 From: "Dumitrescu, Cristian" To: Stephen Hemminger Thread-Topic: [PATCH 4/5] examples_ip_pipeline: remove useless code Thread-Index: AQHQ5FnHcrhRNTmO70+t4Kqs/kPS8Z40kTwg Date: Wed, 9 Sep 2015 18:31:12 +0000 Message-ID: <3EB4FA525960D640B5BDFFD6A3D89126478B9561@IRSMSX108.ger.corp.intel.com> References: <1441072746-29174-1-git-send-email-stephen@networkplumber.org> <1441072746-29174-5-git-send-email-stephen@networkplumber.org> In-Reply-To: <1441072746-29174-5-git-send-email-stephen@networkplumber.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [163.33.239.181] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH 4/5] examples_ip_pipeline: remove useless code X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Sep 2015 18:31:22 -0000 > -----Original Message----- > From: Stephen Hemminger [mailto:stephen@networkplumber.org] > Sent: Tuesday, September 1, 2015 4:59 AM > To: Dumitrescu, Cristian > Cc: dev@dpdk.org; Stephen Hemminger > Subject: [PATCH 4/5] examples_ip_pipeline: remove useless code >=20 > Code here checks return from strdup() in only one place in this > whole module, and then does nothing useful by setting one > value that is then cleared. Just remove the check. >=20 > Signed-off-by: Stephen Hemminger > --- > examples/ip_pipeline/config_parse.c | 3 --- > 1 file changed, 3 deletions(-) >=20 > diff --git a/examples/ip_pipeline/config_parse.c > b/examples/ip_pipeline/config_parse.c > index 6b651a8..81ec33b 100644 > --- a/examples/ip_pipeline/config_parse.c > +++ b/examples/ip_pipeline/config_parse.c > @@ -1483,9 +1483,6 @@ parse_tm(struct app_params *app, > ret =3D -ESRCH; > if (strcmp(ent->name, "cfg") =3D=3D 0) { > param->file_name =3D strdup(ent->value); > - if (param->file_name =3D=3D NULL) > - ret =3D -EINVAL; > - > ret =3D 0; The required implementation would actually be: if (param->file_name =3D=3D NULL) ret =3D -EINVAL; else ret =3D 0; The TM parameter file_name is used by function app_config_parse_tm() in fil= e config_parse_tm.c. Regarding the way the error management (including the error messages) is do= ne in our parser (currently done by repeatedly setting the ret variable), I= would like to improve (replace) when I get the time to take another look a= t this. > } else if (strcmp(ent->name, "burst_read") =3D=3D 0) > ret =3D parser_read_uint32(¶m->burst_read, > -- > 2.1.4