From patchwork Wed Sep 9 10:06:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 53312 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by patches.linaro.org (Postfix) with ESMTPS id 672B322B19 for ; Wed, 9 Sep 2015 10:11:19 +0000 (UTC) Received: by lamp12 with SMTP id p12sf1954710lam.2 for ; Wed, 09 Sep 2015 03:11:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:delivered-to:from:to:date :message-id:in-reply-to:references:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :mime-version:content-type:content-transfer-encoding:errors-to :sender:x-original-sender:x-original-authentication-results :mailing-list; bh=3FiziC2RhzVW9VMeR4xk20H/UKPP05fOWLTI5vNo7ck=; b=EJq6LzluP9VC17E4TusCJ0rlUGKK2c1LZHtKIGtauyVlp8rvZaqSWmha3D31ffsHLH PK72dgFxLuZvxc3bSuG15IY0FqwEUbzNaXepCH4S+yjmHuiDBcPIocw85UP3i692dDOw TsvxlusVwPLYBhNUgSA2X/tzdeo4cQREH0OrIsWTrvYHqQmA5XwEBOad/izYItkecP45 nDKtp/pEYp+ieWq1ZkjXsFQM14vNi+uRlZFW6Tka1dANmGtQJH3D58QUw2p/Ao/OjwGF S2QCtOQGlIYhV/7Q3XhUEUofS1VQ4W2+VdCubFBnhZlLp5HFGuICzXRnwtAFzVzyR5My 2MFA== X-Gm-Message-State: ALoCoQnc0Nutm240dMzJpphiqqb8VYHEVZIXjZN1kcsR8zU5TO7kZYlM3gipc7FhO+dtaHlPiDrx X-Received: by 10.112.99.37 with SMTP id en5mr7938271lbb.7.1441793478348; Wed, 09 Sep 2015 03:11:18 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.178.163 with SMTP id cz3ls24109lac.45.gmail; Wed, 09 Sep 2015 03:11:18 -0700 (PDT) X-Received: by 10.112.171.227 with SMTP id ax3mr27211417lbc.118.1441793478196; Wed, 09 Sep 2015 03:11:18 -0700 (PDT) Received: from mail-lb0-f180.google.com (mail-lb0-f180.google.com. [209.85.217.180]) by mx.google.com with ESMTPS id w6si6196990law.165.2015.09.09.03.11.18 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Sep 2015 03:11:18 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.180 as permitted sender) client-ip=209.85.217.180; Received: by lbcao8 with SMTP id ao8so2851093lbc.3 for ; Wed, 09 Sep 2015 03:11:18 -0700 (PDT) X-Received: by 10.152.170.230 with SMTP id ap6mr28042887lac.73.1441793477970; Wed, 09 Sep 2015 03:11:17 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp228226lbq; Wed, 9 Sep 2015 03:11:16 -0700 (PDT) X-Received: by 10.55.195.86 with SMTP id a83mr42102690qkj.72.1441793476649; Wed, 09 Sep 2015 03:11:16 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id 20si7522604qgh.33.2015.09.09.03.11.15; Wed, 09 Sep 2015 03:11:16 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Received: by lists.linaro.org (Postfix, from userid 109) id 7617161E11; Wed, 9 Sep 2015 10:11:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 84EE361E53; Wed, 9 Sep 2015 10:07:16 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id E3EDA61CC2; Wed, 9 Sep 2015 10:06:55 +0000 (UTC) Received: from mail-la0-f43.google.com (mail-la0-f43.google.com [209.85.215.43]) by lists.linaro.org (Postfix) with ESMTPS id C5A2461D66 for ; Wed, 9 Sep 2015 10:06:50 +0000 (UTC) Received: by laeb10 with SMTP id b10so3445065lae.1 for ; Wed, 09 Sep 2015 03:06:49 -0700 (PDT) X-Received: by 10.152.170.230 with SMTP id ap6mr28019913lac.73.1441793209780; Wed, 09 Sep 2015 03:06:49 -0700 (PDT) Received: from localhost.localdomain (ppp91-76-161-180.pppoe.mtu-net.ru. [91.76.161.180]) by smtp.gmail.com with ESMTPSA id qu6sm1654092lbb.27.2015.09.09.03.06.48 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 09 Sep 2015 03:06:49 -0700 (PDT) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Wed, 9 Sep 2015 13:06:39 +0300 Message-Id: <1441793199-30966-7-git-send-email-maxim.uvarov@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1441793199-30966-1-git-send-email-maxim.uvarov@linaro.org> References: <1441793199-30966-1-git-send-email-maxim.uvarov@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCH 6/6] linux-generic: ring_test.c fix code style errors X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: maxim.uvarov@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.180 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Fix codestyle errors reported by checkpatch.pl Signed-off-by: Maxim Uvarov --- platform/linux-generic/test/ring/ring_test.c | 32 +++++++++++++--------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/platform/linux-generic/test/ring/ring_test.c b/platform/linux-generic/test/ring/ring_test.c index 7b9a81e..c4b2cde 100644 --- a/platform/linux-generic/test/ring/ring_test.c +++ b/platform/linux-generic/test/ring/ring_test.c @@ -37,7 +37,6 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - /** * @file * @@ -64,24 +63,24 @@ static int test_ring_basic(shm_ring_t *r) unsigned i, num_elems; /* alloc dummy object pointers */ - src = malloc(RING_SIZE*2*sizeof(void *)); - if (src == NULL) { + src = malloc(RING_SIZE * 2 * sizeof(void *)); + if (!src) { LOG_ERR("failed to allocate test ring src memory\n"); goto fail; } - for (i = 0; i < RING_SIZE*2; i++) + for (i = 0; i < RING_SIZE * 2; i++) src[i] = (void *)(unsigned long)i; cur_src = src; /* alloc some room for copied objects */ - dst = malloc(RING_SIZE*2*sizeof(void *)); - if (dst == NULL) { + dst = malloc(RING_SIZE * 2 * sizeof(void *)); + if (!dst) { LOG_ERR("failed to allocate test ring dst memory\n"); goto fail; } - memset(dst, 0, RING_SIZE*2*sizeof(void *)); + memset(dst, 0, RING_SIZE * 2 * sizeof(void *)); cur_dst = dst; printf("Test SP & SC basic functions\n"); @@ -251,8 +250,8 @@ static int producer_fn(void) void **src = NULL; /* alloc dummy object pointers */ - src = malloc(MAX_BULK*2*sizeof(void *)); - if (src == NULL) { + src = malloc(MAX_BULK * 2 * sizeof(void *)); + if (!src) { LOG_ERR("failed to allocate producer memory.\n"); return -1; } @@ -275,8 +274,8 @@ static int consumer_fn(void) void **src = NULL; /* alloc dummy object pointers */ - src = malloc(MAX_BULK*2*sizeof(void *)); - if (src == NULL) { + src = malloc(MAX_BULK * 2 * sizeof(void *)); + if (!src) { LOG_ERR("failed to allocate consumer memory.\n"); return -1; } @@ -298,7 +297,6 @@ static int consumer_fn(void) } while (1); } - /* * Note : make sure that both enqueue and dequeue * operation starts at same time so to avoid data corruption @@ -319,6 +317,7 @@ typedef enum { static void test_ring_stress(stress_type_t type) { int thr; + thr = odp_thread_id(); switch (type) { @@ -331,7 +330,7 @@ static void test_ring_stress(stress_type_t type) break; case multi_enq_multi_deq: - if (thr%2 == 0) + if (thr % 2 == 0) producer_fn(); else consumer_fn(); @@ -417,7 +416,6 @@ static void *test_ring(void *arg) return parg; } - int main(int argc __attribute__((__unused__)), char *argv[] __attribute__((__unused__))) { @@ -445,9 +443,9 @@ int main(int argc __attribute__((__unused__)), snprintf(ring_name, sizeof(ring_name), "test_ring_stress"); r_stress = shm_ring_create(ring_name, RING_SIZE, - 0 /* not used, alignement - taken care inside func : todo */); - if (r_stress == NULL) { + 0 /* not used, alignement + taken care inside func : todo */); + if (!r_stress) { LOG_ERR("ring create failed\n"); goto fail; }