From patchwork Wed Jan 14 22:48:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anders Roxell X-Patchwork-Id: 43131 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f70.google.com (mail-ee0-f70.google.com [74.125.83.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7C421240B9 for ; Wed, 14 Jan 2015 22:49:31 +0000 (UTC) Received: by mail-ee0-f70.google.com with SMTP id b57sf6457588eek.1 for ; Wed, 14 Jan 2015 14:49:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state: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=Es5g3i1hQX72oY4zpdMiiq+K39Mpn/++M3/Slip5GXA=; b=gtr07OU1+9iCh+wNKipwHZke+R+kWMSoNmXwGr+rQoxk/hP9Rs0gOEyJeoDlPxBDUs +WyCLuJTYxqiznePtUIKnOHv4OLuyvCtonMvsodKE1f5BveIHJwXjj4K4QpEXafWb5k1 6bQHDKsqQGOLTCsB7ACcbmWJUkOaYdqD2lgaZpKO0og4VIdZJEFNwTsNzmfbJSXDIfDN UUvpVBjS/4yb8Euf94V+wLxaj5RS9znzrVsx3c1OusNhJlpuqQs0/szeVzneynjzlnax 46BkHQuACC0DrTcN0axrj04pMf5ru3nRSNgQZ/zOwQ9mdAiDHrJF+QjC0LbTYFgeALul tF5g== X-Gm-Message-State: ALoCoQmroXeKZUGUhYmwGzxaXvGDtYbzjx2bK5sSBqp1JGvo8CNBe7xnWjATaiC74MLVKTmqYRJG X-Received: by 10.152.181.138 with SMTP id dw10mr44749lac.1.1421275770600; Wed, 14 Jan 2015 14:49:30 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.161.198 with SMTP id xu6ls155677lab.86.gmail; Wed, 14 Jan 2015 14:49:30 -0800 (PST) X-Received: by 10.112.62.194 with SMTP id a2mr6451459lbs.73.1421275770453; Wed, 14 Jan 2015 14:49:30 -0800 (PST) Received: from mail-lb0-f178.google.com (mail-lb0-f178.google.com. [209.85.217.178]) by mx.google.com with ESMTPS id qp3si28549853lbb.81.2015.01.14.14.49.30 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 14 Jan 2015 14:49:30 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.178 as permitted sender) client-ip=209.85.217.178; Received: by mail-lb0-f178.google.com with SMTP id u14so10442530lbd.9 for ; Wed, 14 Jan 2015 14:49:30 -0800 (PST) X-Received: by 10.152.87.12 with SMTP id t12mr6531659laz.31.1421275770372; Wed, 14 Jan 2015 14:49:30 -0800 (PST) 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.9.200 with SMTP id c8csp1845593lbb; Wed, 14 Jan 2015 14:49:29 -0800 (PST) X-Received: by 10.229.65.133 with SMTP id j5mr11401687qci.27.1421275769043; Wed, 14 Jan 2015 14:49:29 -0800 (PST) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id o9si32982877qaa.96.2015.01.14.14.49.27 (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 14 Jan 2015 14:49:29 -0800 (PST) Received-SPF: none (google.com: lng-odp-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-35-177-41.ec2.internal) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YBWkg-0000DI-Fd; Wed, 14 Jan 2015 22:49:26 +0000 Received: from mail-lb0-f173.google.com ([209.85.217.173]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YBWkX-0000B1-M6 for lng-odp@lists.linaro.org; Wed, 14 Jan 2015 22:49:17 +0000 Received: by mail-lb0-f173.google.com with SMTP id z12so10503093lbi.4 for ; Wed, 14 Jan 2015 14:49:12 -0800 (PST) X-Received: by 10.112.72.98 with SMTP id c2mr6504588lbv.95.1421275752085; Wed, 14 Jan 2015 14:49:12 -0800 (PST) Received: from localhost (c-853670d5.07-21-73746f28.cust.bredbandsbolaget.se. [213.112.54.133]) by mx.google.com with ESMTPSA id yf10sm6310105lbb.9.2015.01.14.14.49.11 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Jan 2015 14:49:11 -0800 (PST) From: Anders Roxell To: lng-odp@lists.linaro.org Date: Wed, 14 Jan 2015 23:48:19 +0100 Message-Id: <1421275706-11176-3-git-send-email-anders.roxell@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1421275706-11176-1-git-send-email-anders.roxell@linaro.org> References: <1421275706-11176-1-git-send-email-anders.roxell@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCHv3 2/9] api: cpumask: reorder the input vars to match convention X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.14 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-bounces@lists.linaro.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: anders.roxell@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.178 as permitted sender) smtp.mail=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 From: Robbie King Have the destination variable as the first parameter to match the rest of the ODP API. Signed-off-by: Robbie King Signed-off-by: Anders Roxell --- platform/linux-generic/include/api/odp_cpumask.h | 20 ++++++++++---------- platform/linux-generic/odp_cpumask.c | 12 ++++++------ test/api_test/odp_common.c | 4 ++-- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/platform/linux-generic/include/api/odp_cpumask.h b/platform/linux-generic/include/api/odp_cpumask.h index e421d4d..2e10c4e 100644 --- a/platform/linux-generic/include/api/odp_cpumask.h +++ b/platform/linux-generic/include/api/odp_cpumask.h @@ -40,20 +40,20 @@ typedef struct odp_cpumask_t { /** * Add CPU mask bits from a string * + * @param mask CPU mask to modify * @param str Hexadecimal digits in a string. CPU #0 is located * at the least significant bit (0x1). - * @param mask CPU mask to modify */ -void odp_cpumask_from_str(const char *str, odp_cpumask_t *mask); +void odp_cpumask_from_str(odp_cpumask_t *mask, const char *str); /** * Write CPU mask as a string of hexadecimal digits * + * @param mask CPU mask * @param str String for output * @param len Size of string length (incl. ending zero) - * @param mask CPU mask */ -void odp_cpumask_to_str(char *str, int len, const odp_cpumask_t *mask); +void odp_cpumask_to_str(const odp_cpumask_t *mask, char *str, int len); /** * Clear entire mask @@ -63,25 +63,25 @@ void odp_cpumask_zero(odp_cpumask_t *mask); /** * Add cpu to mask - * @param cpu CPU number * @param mask add cpu number in CPU mask + * @param cpu CPU number */ -void odp_cpumask_set(int cpu, odp_cpumask_t *mask); +void odp_cpumask_set(odp_cpumask_t *mask, int cpu); /** * Remove cpu from mask - * @param cpu CPU number * @param mask clear cpu number from CPU mask + * @param cpu CPU number */ -void odp_cpumask_clr(int cpu, odp_cpumask_t *mask); +void odp_cpumask_clr(odp_cpumask_t *mask, int cpu); /** * Test if cpu is a member of mask - * @param cpu CPU number * @param mask CPU mask to check if cpu num set or not + * @param cpu CPU number * @return non-zero if set otherwise 0 */ -int odp_cpumask_isset(int cpu, const odp_cpumask_t *mask); +int odp_cpumask_isset(const odp_cpumask_t *mask, int cpu); /** * Count number of cpus in mask diff --git a/platform/linux-generic/odp_cpumask.c b/platform/linux-generic/odp_cpumask.c index 1f9d73b..0f383da 100644 --- a/platform/linux-generic/odp_cpumask.c +++ b/platform/linux-generic/odp_cpumask.c @@ -18,7 +18,7 @@ #define MAX_CORE_NUM 64 -void odp_cpumask_from_str(const char *str_in, odp_cpumask_t *mask) +void odp_cpumask_from_str(odp_cpumask_t *mask, const char *str_in) { cpu_set_t cpuset; const char *str = str_in; @@ -68,12 +68,12 @@ static int _odp_cpumask_last(const odp_cpumask_t *mask) int cpu; for (cpu = CPU_SETSIZE - 1; cpu >= 0; cpu--) - if (odp_cpumask_isset(cpu, mask)) + if (odp_cpumask_isset(mask, cpu)) return cpu; return -1; } -void odp_cpumask_to_str(char *str, int len, const odp_cpumask_t *mask) +void odp_cpumask_to_str(const odp_cpumask_t *mask, char *str, int len) { char *p = str; int cpu = _odp_cpumask_last(mask); @@ -130,17 +130,17 @@ void odp_cpumask_zero(odp_cpumask_t *mask) CPU_ZERO(&mask->set); } -void odp_cpumask_set(int cpu, odp_cpumask_t *mask) +void odp_cpumask_set(odp_cpumask_t *mask, int cpu) { CPU_SET(cpu, &mask->set); } -void odp_cpumask_clr(int cpu, odp_cpumask_t *mask) +void odp_cpumask_clr(odp_cpumask_t *mask, int cpu) { CPU_CLR(cpu, &mask->set); } -int odp_cpumask_isset(int cpu, const odp_cpumask_t *mask) +int odp_cpumask_isset(const odp_cpumask_t *mask, int cpu) { return CPU_ISSET(cpu, &mask->set); } diff --git a/test/api_test/odp_common.c b/test/api_test/odp_common.c index 7449a52..3ea815e 100644 --- a/test/api_test/odp_common.c +++ b/test/api_test/odp_common.c @@ -36,8 +36,8 @@ void odp_print_system_info(void) odp_cpumask_zero(&cpumask); - odp_cpumask_from_str("0x1", &cpumask); - odp_cpumask_to_str(str, sizeof(str), &cpumask); + odp_cpumask_from_str(&cpumask, "0x1"); + odp_cpumask_to_str(&cpumask, str, sizeof(str)); printf("\n"); printf("ODP system info\n");