From patchwork Wed Jan 27 08:56:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hongbo Zhang X-Patchwork-Id: 60607 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp2468746lbb; Wed, 27 Jan 2016 01:23:11 -0800 (PST) X-Received: by 10.140.221.70 with SMTP id r67mr35524123qhb.84.1453886591791; Wed, 27 Jan 2016 01:23:11 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id r204si5208947qhr.54.2016.01.27.01.23.11; Wed, 27 Jan 2016 01:23:11 -0800 (PST) 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; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dkim=neutral (body hash did not verify) header.i=@linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 45B54615C7; Wed, 27 Jan 2016 09:23:11 +0000 (UTC) Authentication-Results: lists.linaro.org; dkim=fail reason="verification failed; unprotected key" header.d=linaro.org header.i=@linaro.org header.b=XWinp1ID; dkim-adsp=none (unprotected policy); dkim-atps=neutral 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.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2,T_DKIM_INVALID,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 80E3161D30; Wed, 27 Jan 2016 09:17:45 +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 A1C4A6195A; Wed, 27 Jan 2016 09:17:36 +0000 (UTC) Received: from mail-pf0-f181.google.com (mail-pf0-f181.google.com [209.85.192.181]) by lists.linaro.org (Postfix) with ESMTPS id 745216195A for ; Wed, 27 Jan 2016 09:16:10 +0000 (UTC) Received: by mail-pf0-f181.google.com with SMTP id n128so1766752pfn.3 for ; Wed, 27 Jan 2016 01:16:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=FG23rSv4yVRbbjQlbMBDb0sLrcLo+UooFUqiQvJSVLI=; b=XWinp1IDR8gYj4c6nB6QiEtqJPurpZ2dVxGiaULmX3P2k74zhDWWcx382/vQeNoSPw pVoZ5tn2fuLC0lcU7Yjsvtc6t2VZXzV/nt7OOJiz9Nl/XTm/LRycpc4Guf7VMtxCsqMm qqiW0zSPJxVte46xgx+MDiHMM9es2rIrDoYhA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=FG23rSv4yVRbbjQlbMBDb0sLrcLo+UooFUqiQvJSVLI=; b=H4NZiN4p2kxAt0cQ7OmwMUEdh9NReuljQXh+5vTGY1mHEdcALgFF/z40FZPHOinJu6 UP8TGbyd7zy6JjPLrHIuy1dpI6gr7OGy/VbCaZC1O/me2dtxw9k1RoYtqNdTolVqoHcE MQAWjYOI6K0GMaxwf4+E9jStrwJk4xQ4s1Mj9/19ZynHjESVduBjLU04FVloF0zUz1zk jZ5dl9j1t9W+EytluOlBauSfgGD4H2WMB/TlTkj8IE0OGqkBpun8yzRnEwNy6mvbdayz DBVCZpvD8wXsy/EVfPz2wV8ttQA0mege4HU+U1AZON3fx/WnahczisVYDcCNyBv22tSG /mMA== X-Gm-Message-State: AG10YOQ3AdrqWyiW7QGCuAryWk1hylbGlZVBXM351UbjJNwo4j5rJrvUkoUBJBlTTK33Tduhj50= X-Received: by 10.98.76.149 with SMTP id e21mr41330481pfj.89.1453886169827; Wed, 27 Jan 2016 01:16:09 -0800 (PST) Received: from ubuntu1504.ap.freescale.net (gate-zmy3.freescale.com. [192.88.167.1]) by smtp.gmail.com with ESMTPSA id f27sm7407314pfj.0.2016.01.27.01.16.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 27 Jan 2016 01:16:09 -0800 (PST) From: hongbo.zhang@linaro.org To: lng-odp@lists.linaro.org Date: Wed, 27 Jan 2016 16:56:14 +0800 Message-Id: <1453884974-24724-13-git-send-email-hongbo.zhang@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1453884974-24724-1-git-send-email-hongbo.zhang@linaro.org> References: <1453884974-24724-1-git-send-email-hongbo.zhang@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCH v8 API-NEXT 12/12] linux-generic: sysinfo: rename variable cpu_hz to cpu_hz_max X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" 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" From: Hongbo Zhang The legacy variable cpu_hz holds the max frequency for odp_cpu_hz_max(), so rename it to cpu_hz_max for better meaning. Signed-off-by: Hongbo Zhang --- platform/linux-generic/arch/mips64/odp_sysinfo_parse.c | 2 +- platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c | 2 +- platform/linux-generic/arch/x86/odp_sysinfo_parse.c | 2 +- platform/linux-generic/include/odp_internal.h | 2 +- platform/linux-generic/odp_system_info.c | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/platform/linux-generic/arch/mips64/odp_sysinfo_parse.c b/platform/linux-generic/arch/mips64/odp_sysinfo_parse.c index 64d65d2..53074f7 100644 --- a/platform/linux-generic/arch/mips64/odp_sysinfo_parse.c +++ b/platform/linux-generic/arch/mips64/odp_sysinfo_parse.c @@ -26,7 +26,7 @@ int odp_cpuinfo_parser(FILE *file, odp_system_info_t *sysinfo) if (sscanf(pos, "BogoMIPS : %lf", &mhz) == 1) { /* bogomips seems to be 2x freq */ hz = (uint64_t)(mhz * 1000000.0 / 2.0); - sysinfo->cpu_hz[id] = hz; + sysinfo->cpu_hz_max[id] = hz; count--; } } diff --git a/platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c b/platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c index 62c3ae3..99457ce 100644 --- a/platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c +++ b/platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c @@ -25,7 +25,7 @@ int odp_cpuinfo_parser(FILE *file, odp_system_info_t *sysinfo) if (pos) if (sscanf(pos, "clock : %lf", &mhz) == 1) { hz = (uint64_t)(mhz * 1000000.0); - sysinfo->cpu_hz[id] = hz; + sysinfo->cpu_hz_max[id] = hz; count--; } } diff --git a/platform/linux-generic/arch/x86/odp_sysinfo_parse.c b/platform/linux-generic/arch/x86/odp_sysinfo_parse.c index d2b3c80..816629d 100644 --- a/platform/linux-generic/arch/x86/odp_sysinfo_parse.c +++ b/platform/linux-generic/arch/x86/odp_sysinfo_parse.c @@ -27,7 +27,7 @@ int odp_cpuinfo_parser(FILE *file, odp_system_info_t *sysinfo) *(pos - 1) = '\0'; if (sscanf(pos, "@ %lfGHz", &ghz) == 1) { hz = (uint64_t)(ghz * 1000000000.0); - sysinfo->cpu_hz[id] = hz; + sysinfo->cpu_hz_max[id] = hz; } id++; } diff --git a/platform/linux-generic/include/odp_internal.h b/platform/linux-generic/include/odp_internal.h index b527438..aac2ba9 100644 --- a/platform/linux-generic/include/odp_internal.h +++ b/platform/linux-generic/include/odp_internal.h @@ -27,7 +27,7 @@ extern __thread int __odp_errno; #define MAX_CPU_NUMBER 128 typedef struct { - uint64_t cpu_hz[MAX_CPU_NUMBER]; + uint64_t cpu_hz_max[MAX_CPU_NUMBER]; uint64_t huge_page_size; uint64_t page_size; int cache_line_size; diff --git a/platform/linux-generic/odp_system_info.c b/platform/linux-generic/odp_system_info.c index 727053a..42aef8a 100644 --- a/platform/linux-generic/odp_system_info.c +++ b/platform/linux-generic/odp_system_info.c @@ -169,7 +169,7 @@ static int systemcpu(odp_system_info_t *sysinfo) ODP_DBG("Warning: use dummy values for freq and model string\n"); ODP_DBG("Refer to https://bugs.linaro.org/show_bug.cgi?id=1870\n"); for (i = 0; i < MAX_CPU_NUMBER; i++) { - sysinfo->cpu_hz[i] = 1400000000; + sysinfo->cpu_hz_max[i] = 1400000000; strcpy(sysinfo->model_str[i], "UNKNOWN"); } @@ -240,7 +240,7 @@ uint64_t odp_cpu_hz_max(void) uint64_t odp_cpu_hz_max_id(int id) { if (id >= 0 && id < MAX_CPU_NUMBER) - return odp_global_data.system_info.cpu_hz[id]; + return odp_global_data.system_info.cpu_hz_max[id]; else return 0; }