From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 36F0FA09E4; Tue, 23 Mar 2021 12:19:19 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F12A140683; Tue, 23 Mar 2021 12:19:18 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mails.dpdk.org (Postfix) with ESMTP id 48E324014D for ; Tue, 23 Mar 2021 12:19:17 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616498356; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hGubHv3P4k0X3X7ljft8F+U7kzbpL6oiEgD1ac1+IjA=; b=VsxRrnWBqyrZl+ruAYEzUz2nUO3+395NZQVvCI8afQl7M7UYN64iDgy29SN9oondABi6MQ 91diERqN+cG9aNS2Pn5o3FJW0e7OwkSnABmajXlT2wd+0zHBxCS6XJwAkJpT9Kg4cPeb4Q OTMroX3f0dIQhCvY28QI8J12qd7I/II= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-113-4rF42DMPM9SglIdowlaprw-1; Tue, 23 Mar 2021 07:19:14 -0400 X-MC-Unique: 4rF42DMPM9SglIdowlaprw-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9B5EE800D53; Tue, 23 Mar 2021 11:19:12 +0000 (UTC) Received: from [10.36.110.41] (unknown [10.36.110.41]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E7D0C1045EB9; Tue, 23 Mar 2021 11:19:09 +0000 (UTC) To: Ibtisam Tariq , chenbo.xia@intel.com, cristian.dumitrescu@intel.com, jasvinder.singh@intel.com, john.mcnamara@intel.com, reshma.pattan@intel.com, konstantin.ananyev@intel.com, marko.kovacevic@intel.com Cc: dev@dpdk.org, jiayu.hu@intel.com, huawei.xie@intel.com References: <20210204073420.2421-1-ibtisam.tariq@emumba.com> <20210204073420.2421-6-ibtisam.tariq@emumba.com> From: Maxime Coquelin Message-ID: Date: Tue, 23 Mar 2021 12:19:07 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20210204073420.2421-6-ibtisam.tariq@emumba.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=maxime.coquelin@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v4 6/7] examples/vhost: enhance getopt_long usage X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 2/4/21 8:34 AM, Ibtisam Tariq wrote: > Instead of using getopt_long return value, strcmp was used to > compare the input parameters with the struct option array. This > patch get rid of all those strcmp by directly binding each longopt > with an int enum. This is to improve readability and consistency in > all examples. > > Bugzilla ID: 238 > Cc: jiayu.hu@intel.com > Cc: huawei.xie@intel.com > > Reported-by: David Marchand > Signed-off-by: Ibtisam Tariq > --- > v4: > * Set indentation of preprocessor directives. > * Add enums for OPT_BUILTIN_NET_DRIVER and OPT_CLIENT in getopt_long. > > v3: > * None. > > v2: > * Remove extra indentations. > * Remove extra block brackets in switch statement. > * Change enum names to start with OPT_ and remove KEYWORD from enum names. > > v1: > * enhance getopt_long usage. > --- > examples/vhost/main.c | 288 +++++++++++++++++++++++------------------- > 1 file changed, 155 insertions(+), 133 deletions(-) > Reviewed-by: Maxime Coquelin Thanks, Maxime