From patchwork Sun Feb 23 03:23:01 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Holmes X-Patchwork-Id: 25142 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ig0-f200.google.com (mail-ig0-f200.google.com [209.85.213.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id CB497203C6 for ; Sun, 23 Feb 2014 03:23:11 +0000 (UTC) Received: by mail-ig0-f200.google.com with SMTP id y6sf5922985igj.3 for ; Sat, 22 Feb 2014 19:23:11 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:to:subject:date:message-id :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe:content-type; bh=q24Tq0F7ZCv1ReRD75oqICwW7/+c6FvNClkOfNXkieA=; b=LZ0BKXm8ySKxG1h2NFlZ/Q7zfNBYuKLGYqafEzjlTYN6HHZIcRtX86Zj1Gw28TD/l3 jJVLt2YGGwUudSW9LHuv9ujdHqsiC+iykkXWUosmsiMHniR/saMx7zkelbzU9CMIKvqV NeOHrDARS2GoXwLJqkASJpV7xXiPN9AouDk/+yvI1mJpdRXzKG3OX3L6FES0tYlI5cVP Jxx3i+YhTkoQm1DAttG+F23cbx2JF+9bFp2X5tylcDLzaumwAb7zLHJE+hL+84A8BJRQ onfd9ER3SF2jcfSvrpgmZQEXBt/RZ+eE7428FNtYfZsU3PBAZnFiBMV3PZCsUYep4hIP e2Lw== X-Gm-Message-State: ALoCoQnydakcVr9ocFJ3ghHraGTe0n55/7OvCkENpu6tppjONkGZCqMSZBaw1ABTf9UsRQ4dpUkU X-Received: by 10.182.11.70 with SMTP id o6mr5630995obb.19.1393125791000; Sat, 22 Feb 2014 19:23:11 -0800 (PST) MIME-Version: 1.0 X-BeenThere: lng-odp@linaro.org Received: by 10.140.27.117 with SMTP id 108ls1609740qgw.77.gmail; Sat, 22 Feb 2014 19:23:10 -0800 (PST) X-Received: by 10.224.28.131 with SMTP id m3mr20990964qac.101.1393125790769; Sat, 22 Feb 2014 19:23:10 -0800 (PST) Received: from mail-qc0-f182.google.com (mail-qc0-f182.google.com [209.85.216.182]) by mx.google.com with ESMTPS id ep5si3282161qcb.70.2014.02.22.19.23.10 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 22 Feb 2014 19:23:10 -0800 (PST) Received-SPF: neutral (google.com: 209.85.216.182 is neither permitted nor denied by best guess record for domain of mike.holmes@linaro.org) client-ip=209.85.216.182; Received: by mail-qc0-f182.google.com with SMTP id w7so5499198qcr.41 for ; Sat, 22 Feb 2014 19:23:10 -0800 (PST) X-Received: by 10.224.166.210 with SMTP id n18mr20956239qay.32.1393125790595; Sat, 22 Feb 2014 19:23:10 -0800 (PST) Received: from fedora1.holmesfamily.ws (c-98-221-136-245.hsd1.nj.comcast.net. [98.221.136.245]) by mx.google.com with ESMTPSA id z9sm19445471qgz.20.2014.02.22.19.23.09 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 22 Feb 2014 19:23:10 -0800 (PST) From: Mike Holmes To: lng-odp@linaro.org Subject: [lng-odp] [PATCH] add static where possible Date: Sat, 22 Feb 2014 22:23:01 -0500 Message-Id: <1393125781-44443-1-git-send-email-mike.holmes@linaro.org> X-Mailer: git-send-email 1.8.3.2 X-Original-Sender: mike.holmes@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.216.182 is neither permitted nor denied by best guess record for domain of mike.holmes@linaro.org) smtp.mail=mike.holmes@linaro.org Precedence: list Mailing-list: list lng-odp@linaro.org; contact lng-odp+owners@linaro.org List-ID: X-Google-Group-Id: 474323889996 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Signed-off-by: Mike Holmes --- platform/linux-generic/source/odp_ring.c | 4 ++-- test/api_test/odp_atomic_test.c | 14 ++++++++++---- test/api_test/odp_atomic_test.h | 4 ---- test/api_test/odp_common.c | 4 ++-- 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/platform/linux-generic/source/odp_ring.c b/platform/linux-generic/source/odp_ring.c index 2326846..25ff66a 100644 --- a/platform/linux-generic/source/odp_ring.c +++ b/platform/linux-generic/source/odp_ring.c @@ -82,7 +82,7 @@ #include #include -TAILQ_HEAD(, odp_ring) odp_ring_list; +static TAILQ_HEAD(, odp_ring) odp_ring_list; /* * the enqueue of pointers on the ring. @@ -142,7 +142,7 @@ TAILQ_HEAD(, odp_ring) odp_ring_list; } \ } while (0) -odp_rwlock_t qlock; /* rings tailq lock */ +static odp_rwlock_t qlock; /* rings tailq lock */ /* init tailq_ring */ void odp_ring_tailq_init(void) diff --git a/test/api_test/odp_atomic_test.c b/test/api_test/odp_atomic_test.c index 561cb34..ea443a0 100644 --- a/test/api_test/odp_atomic_test.c +++ b/test/api_test/odp_atomic_test.c @@ -10,7 +10,13 @@ #include "odp_common.h" #include "odp_atomic_test.h" -const char * const test_name[] = { +static odp_atomic_int_t a32; +static odp_atomic_u32_t a32u; +static odp_atomic_u64_t a64u; + +static odp_atomic_int_t numthrds; + +static const char * const test_name[] = { "test atomic basic ops add/sub/inc/dec", "test atomic inc/dec of signed word", "test atomic add/sub of signed word", @@ -20,7 +26,7 @@ const char * const test_name[] = { "test atomic add/sub of unsigned double word" }; -struct timeval tv0[MAX_WORKERS], tv1[MAX_WORKERS]; +static struct timeval tv0[MAX_WORKERS], tv1[MAX_WORKERS]; static void usage(void) { @@ -246,7 +252,7 @@ static void *run_thread(void *arg) while (*(volatile int *)&numthrds < parg->numthrds) ; - gettimeofday(&tv0[thr], 0); + gettimeofday(&tv0[thr], NULL); switch (parg->testcase) { case TEST_MIX: @@ -271,7 +277,7 @@ static void *run_thread(void *arg) test_atomic_add_sub_64(); break; } - gettimeofday(&tv1[thr], 0); + gettimeofday(&tv1[thr], NULL); fflush(NULL); printf("Time taken in thread %02d to complete op is %lld usec\n", thr, diff --git a/test/api_test/odp_atomic_test.h b/test/api_test/odp_atomic_test.h index c6795a5..04dde72 100644 --- a/test/api_test/odp_atomic_test.h +++ b/test/api_test/odp_atomic_test.h @@ -30,11 +30,7 @@ #define TEST_INC_DEC_64 6 #define TEST_ADD_SUB_64 7 #define TEST_MAX 7 /* This must match the last test case num */ -odp_atomic_int_t a32; -odp_atomic_u32_t a32u; -odp_atomic_u64_t a64u; -odp_atomic_int_t numthrds; void test_atomic_inc_dec_32(void); void test_atomic_add_sub_32(void); diff --git a/test/api_test/odp_common.c b/test/api_test/odp_common.c index 5ead65e..5c7a487 100644 --- a/test/api_test/odp_common.c +++ b/test/api_test/odp_common.c @@ -19,8 +19,8 @@ /* Globals */ -odp_linux_pthread_t thread_tbl[MAX_WORKERS]; -int num_workers; +static odp_linux_pthread_t thread_tbl[MAX_WORKERS]; +static int num_workers; __thread test_shared_data_t *test_shared_data; void odp_print_system_info(void)