[dpdk-dev] [PATCH v2] app/testpmd: fix return value in portlist parser
Ferruh Yigit
ferruh.yigit at intel.com
Thu Feb 20 18:01:39 CET 2020
On 2/20/2020 3:43 PM, Hariprasad Govindharajan wrote:
> The function parse_port_list() is designed to return
> unsigned int value. After sanitizing the inputs,
> it is returning -1. Changed it to return 0.
>
> Fixes: 2df00d562d20 ("app/testpmd: add --portlist option")
> Cc: hariprasad.govindharajan at intel.com
>
> Signed-off-by: Hariprasad Govindharajan <hariprasad.govindharajan at intel.com>
> ---
> app/test-pmd/config.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
> index 9d95202..91db508 100644
> --- a/app/test-pmd/config.c
> +++ b/app/test-pmd/config.c
> @@ -2642,7 +2642,7 @@ parse_port_list(const char *list, unsigned int *values, unsigned int maxsize)
> unsigned int marked[maxsize];
>
> if (list == NULL || values == NULL)
> - return -1;
> + return 0;
Can you please clarify what is the expected return value on error in the
function comment?
>
> for (i = 0; i < (int)maxsize; i++)
> marked[i] = 0;
>
More information about the dev
mailing list