From patchwork Tue Aug 18 11:01:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 52503 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f199.google.com (mail-lb0-f199.google.com [209.85.217.199]) by patches.linaro.org (Postfix) with ESMTPS id 38BBC22DB1 for ; Tue, 18 Aug 2015 11:11:44 +0000 (UTC) Received: by lbcue2 with SMTP id ue2sf5668499lbc.1 for ; Tue, 18 Aug 2015 04:11:43 -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=JjsgdkU35706rexFCGrpxQBPUkRk6EFHkVGA0zZc9zQgg1+LMlaqHyeFZfIy5lZ8us gYhv2+a1Ly5mN91d1ZRHbiNMbVMWPiioMxLMtgFPrEEtDzUG2lhOZGJNev1iIn7gkR86 ISNVEkKz6NCmEBYZ2gGyJw/VYJlQaaLk2k0+ShfR1o4H6VRWLXwkVzNuZFbh/JwOjWYB kp+5rjkpHqOQ4xzk6QNGhgYJq3qKnLkPxvJsYAUwOttgkY9B7eETAYH/k+Yqaym3ZAcP GC6vr10lYX08z8dITuM7HgZzXRIN8lFxlwD3LqT9Kzn5SITMaLZTjk9ahmvE9kskKxxD kbQQ== X-Gm-Message-State: ALoCoQkR2KbubOVcb9TqoZ49KbM8ApNlZtj2Au+DVI6l4ISJyfa0uD397vkcMm4O0JrDbQ05lWtl X-Received: by 10.180.77.105 with SMTP id r9mr6182220wiw.0.1439896303223; Tue, 18 Aug 2015 04:11:43 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.6.130 with SMTP id b2ls103288laa.58.gmail; Tue, 18 Aug 2015 04:11:42 -0700 (PDT) X-Received: by 10.152.23.167 with SMTP id n7mr5850535laf.108.1439896302808; Tue, 18 Aug 2015 04:11:42 -0700 (PDT) Received: from mail-lb0-f173.google.com (mail-lb0-f173.google.com. [209.85.217.173]) by mx.google.com with ESMTPS id e8si13869735laa.121.2015.08.18.04.11.42 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Aug 2015 04:11:42 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.173 as permitted sender) client-ip=209.85.217.173; Received: by lbbtg9 with SMTP id tg9so101198821lbb.1 for ; Tue, 18 Aug 2015 04:11:42 -0700 (PDT) X-Received: by 10.112.166.106 with SMTP id zf10mr5757478lbb.36.1439896302680; Tue, 18 Aug 2015 04:11:42 -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.162.200 with SMTP id yc8csp409686lbb; Tue, 18 Aug 2015 04:11:41 -0700 (PDT) X-Received: by 10.140.135.197 with SMTP id 188mr12226669qhh.89.1439896301496; Tue, 18 Aug 2015 04:11:41 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id t89si30697679qge.110.2015.08.18.04.11.40; Tue, 18 Aug 2015 04:11:41 -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 329BF61E89; Tue, 18 Aug 2015 11:11:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252.ec2.internal 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 ip-10-142-244-252.ec2.internal (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id EE9AF61F94; Tue, 18 Aug 2015 11:03:15 +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 BD1AF61F6E; Tue, 18 Aug 2015 11:03:12 +0000 (UTC) Received: from mail-wi0-f178.google.com (mail-wi0-f178.google.com [209.85.212.178]) by lists.linaro.org (Postfix) with ESMTPS id 7099861F6E for ; Tue, 18 Aug 2015 11:01:58 +0000 (UTC) Received: by wibhh20 with SMTP id hh20so105160966wib.0 for ; Tue, 18 Aug 2015 04:01:57 -0700 (PDT) X-Received: by 10.194.6.37 with SMTP id x5mr12895160wjx.73.1439895717680; Tue, 18 Aug 2015 04:01:57 -0700 (PDT) Received: from localhost.localdomain ([87.120.178.39]) by smtp.gmail.com with ESMTPSA id e8sm20892047wiz.0.2015.08.18.04.01.56 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 18 Aug 2015 04:01:57 -0700 (PDT) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Tue, 18 Aug 2015 14:01:36 +0300 Message-Id: <1439895698-18597-11-git-send-email-maxim.uvarov@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1439895698-18597-1-git-send-email-maxim.uvarov@linaro.org> References: <1439895698-18597-1-git-send-email-maxim.uvarov@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCHv8 10/12] 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.173 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; }