From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 409ACA04B0; Sat, 24 Oct 2020 02:29:29 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D35B86CAA; Sat, 24 Oct 2020 02:29:27 +0200 (CEST) Received: from mail-pl1-f193.google.com (mail-pl1-f193.google.com [209.85.214.193]) by dpdk.org (Postfix) with ESMTP id 3F7446C97 for ; Sat, 24 Oct 2020 02:29:25 +0200 (CEST) Received: by mail-pl1-f193.google.com with SMTP id h2so1880289pll.11 for ; Fri, 23 Oct 2020 17:29:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=GSBAEpeIXQOoWYs5XCEHn7iceHrbQYCGW5INzrPfXEU=; b=Lhedqx3MJYO03nmeZ5FIfYZk0hPLCk00RIuWxwYgz/M4IuYKDjWXh9QR69EJ6yBnXg g32QgTa+lKbdcIFqZFTSQE9/f5GAwYfEiH16iDxbP6jtLPVkKw3wYlOAz4E/08/kwOdT F3BbyXXT7gYHI+co9MPA0T5UIsLb0xsAvKjYow6HDgNo9arq8w4sFx5z3+VZxF1GI+WC jsNLWQN5g0UOfVLodi5/XWCN5jJyNquCvsdDFCu6PjdTwA5aSoPyS0lZ8B1rKf5gSUUz 1kf4mu3aUGAvz3bHEc8rx+3c36IxW+8Mut1+4mvhKqOLkJ/iVGQfGoRZ6h1QRU8qOoT5 qNFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=GSBAEpeIXQOoWYs5XCEHn7iceHrbQYCGW5INzrPfXEU=; b=LE/HNFvBv93pxIOEPmjaeyXnJd1HZ659T2fSd91vMbZ5LxXMklLg2GTNS+OTt8s2qW n83evZheQo85m61cBIjgEo0ofsKH5lXKnM3GMPrFFc8Cg17NBBGFQyMTPnB1+rvqu4ju oJBhTovgWulEAjPfFyjZD0VlUmd/afoMpHG1v7JWf2/Fk0nfz1aKKjvzpvWkUrmpePhj 5H5FFyBBXRJbBM7asBQ/waaVaIFUmMhVdB/0/wfOdtvSpnS+lVFL+lLLpNqUwExNxyvU uTufAGOz0qxHr57x5Ly/4eFHVr1fI6qFt33bn1Th1y+Lw6OV3uhQujg4TpTvxxgRvE57 j9uA== X-Gm-Message-State: AOAM533ses8yODN+qqbvgyGojXpgfCdXKvgSY0TymsxArg5Ha6Mbuf4U re3V+f7BWSwpN7cpA/kjQtUcuA== X-Google-Smtp-Source: ABdhPJxGYOa4vQEDs3F2IxLrGs6Te0Dq1z1kGlU73Vbl5wuORmRAQilPwQ4UHZgvR45RXMJ47iV4eA== X-Received: by 2002:a17:902:7d86:b029:d5:cfb6:15e7 with SMTP id a6-20020a1709027d86b02900d5cfb615e7mr1425375plm.83.1603499363243; Fri, 23 Oct 2020 17:29:23 -0700 (PDT) Received: from hermes.local (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id v3sm2902096pfu.165.2020.10.23.17.29.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Oct 2020 17:29:22 -0700 (PDT) Date: Fri, 23 Oct 2020 17:29:14 -0700 From: Stephen Hemminger To: Honnappa Nagarahalli Cc: "Ananyev, Konstantin" , "dev@dpdk.org" , "olivier.matz@6wind.com" , "david.marchand@redhat.com" , Dharmik Thakkar , Ruifeng Wang , nd Message-ID: <20201023172914.63484d9f@hermes.local> In-Reply-To: References: <20200224203931.21256-1-honnappa.nagarahalli@arm.com> <20201023044343.13462-1-honnappa.nagarahalli@arm.com> <20201023044343.13462-4-honnappa.nagarahalli@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v3 3/5] test/ring: move common function to header file X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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 Fri, 23 Oct 2020 23:54:22 +0000 Honnappa Nagarahalli wrote: > > > > > > > Move test_ring_inc_ptr to header file so that it can be used by > > > functions in other files. > > > > > > Signed-off-by: Honnappa Nagarahalli > > > Reviewed-by: Dharmik Thakkar > > > --- > > > app/test/test_ring.c | 11 ----------- app/test/test_ring.h | 11 > > > +++++++++++ > > > 2 files changed, 11 insertions(+), 11 deletions(-) > > > > > > diff --git a/app/test/test_ring.c b/app/test/test_ring.c index > > > a62cb263b..329d538a9 100644 > > > --- a/app/test/test_ring.c > > > +++ b/app/test/test_ring.c > > > @@ -243,17 +243,6 @@ test_ring_deq_impl(struct rte_ring *r, void **obj, > > int esize, unsigned int n, > > > NULL); > > > } > > > > > > -static void** > > > -test_ring_inc_ptr(void **obj, int esize, unsigned int n) -{ > > > - /* Legacy queue APIs? */ > > > - if ((esize) == -1) > > > - return ((void **)obj) + n; > > > - else > > > - return (void **)(((uint32_t *)obj) + > > > - (n * esize / sizeof(uint32_t))); > > > -} > > > - > > > static void > > > test_ring_mem_init(void *obj, unsigned int count, int esize) { diff > > > --git a/app/test/test_ring.h b/app/test/test_ring.h index > > > d4b15af7c..16697ee02 100644 > > > --- a/app/test/test_ring.h > > > +++ b/app/test/test_ring.h > > > @@ -42,6 +42,17 @@ test_ring_create(const char *name, int esize, > > unsigned int count, > > > (socket_id), (flags)); > > > } > > > > > > +static inline void** > > > +test_ring_inc_ptr(void **obj, int esize, unsigned int n) { > > > + /* Legacy queue APIs? */ > > > + if ((esize) == -1) > > > + return ((void **)obj) + n; > > > + else > > > + return (void **)(((uint32_t *)obj) + > > > + (n * esize / sizeof(uint32_t))); } > > > > In all these pointer arithemetics, why do you need 'void **'? > > Why just not 'void*', or even uintptr_t? > I will change it as follows: > > static inline void* > test_ring_inc_ptr(void *obj, int esize, unsigned int n) > { > int sz; > > sz = esize; > /* Legacy queue APIs? */ > if ((esize) == -1) Extra (paren) doesn't help readability either