From patchwork Thu Jan 7 07:38:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hongbo Zhang X-Patchwork-Id: 59275 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp394994lbb; Wed, 6 Jan 2016 23:46:53 -0800 (PST) X-Received: by 10.140.178.139 with SMTP id y133mr138368100qhy.92.1452152812962; Wed, 06 Jan 2016 23:46:52 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id 69si9343354qkv.30.2016.01.06.23.46.52; Wed, 06 Jan 2016 23:46:52 -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 8D97461981; Thu, 7 Jan 2016 07:46:52 +0000 (UTC) Authentication-Results: lists.linaro.org; dkim=fail reason="verification failed; unprotected key" header.d=linaro.org header.i=@linaro.org header.b=h3J5pVF7; 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 E12AD61CB4; Thu, 7 Jan 2016 07:41:20 +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 8D28C61C89; Thu, 7 Jan 2016 07:41:14 +0000 (UTC) Received: from mail-pa0-f51.google.com (mail-pa0-f51.google.com [209.85.220.51]) by lists.linaro.org (Postfix) with ESMTPS id 276BD61CB4 for ; Thu, 7 Jan 2016 07:39:20 +0000 (UTC) Received: by mail-pa0-f51.google.com with SMTP id uo6so233769666pac.1 for ; Wed, 06 Jan 2016 23:39:20 -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=6EQFSCO5GyPSKuXTgTzuU4HLVlonw2Tz8NcsS0XpxW0=; b=h3J5pVF701ysTZevcfNR/AwCZ9T5nHiW1b5oikJXPKyVJAN69NfkWnWYgtc+VlZUmm zNf7YVRDVSq7KgxYPxaDsQkgFCF9PlKbpBfCY+nA9NtnMHtxgqwCRR7jJ2dgUzI0WEwN 02xDnY33CObCTGjfrdzMgTgPM7kpOl4kixYLM= 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=6EQFSCO5GyPSKuXTgTzuU4HLVlonw2Tz8NcsS0XpxW0=; b=cbe7YNOg5DsWmeDQLMkW20jz5jIhGC35AEuKIexw+appC2k8ltfEb4XeVe2gn9bguh fTyWt1vWyUaE7+dZpyOLDM5//LZInv/A/DuFBgnAcB37ehvZyhfxS9zZi2vFg8BjZxsj jXWkGysc+xc3hhczrmsbkiNVm1d+3DxzzOsAtb1SU+z+r5UNemNU0JvYYT05SxjKCIwQ VlQhhygrNlqcUl9okbprLZT1W8xtR+5EXOCgPGrzzzjPAYQ5eg4nK1Fe9PP7a9Kgrt79 KNszqo/NMCpFzlNlfXYu7sMylAJglnGhWvuYuxYh4A2vN1rBEwA3bVrtD4CR4sDhcxNu xXrg== X-Gm-Message-State: ALoCoQnOspXDtHEqkyIlCZuMrbeufsAi9btCmSLqs8oal3625aU81i8xP+PhwKTlauTwWy0D9TOixsFXxsDuKvFs8//c1aKUVQ== X-Received: by 10.66.233.73 with SMTP id tu9mr149081094pac.52.1452152359545; Wed, 06 Jan 2016 23:39:19 -0800 (PST) Received: from ubuntu1504.ap.freescale.net (gate-zmy3.freescale.com. [192.88.167.1]) by smtp.gmail.com with ESMTPSA id tb8sm150067484pab.22.2016.01.06.23.39.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 06 Jan 2016 23:39:19 -0800 (PST) From: hongbo.zhang@linaro.org To: lng-odp@lists.linaro.org Date: Thu, 7 Jan 2016 15:38:33 +0800 Message-Id: <1452152313-27276-13-git-send-email-hongbo.zhang@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1452152313-27276-1-git-send-email-hongbo.zhang@linaro.org> References: <1452152313-27276-1-git-send-email-hongbo.zhang@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCH v4 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 | 3 ++- platform/linux-generic/include/odp_internal.h | 2 +- platform/linux-generic/odp_system_info.c | 4 ++-- 5 files changed, 7 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 868bd09..731e54c 100644 --- a/platform/linux-generic/arch/mips64/odp_sysinfo_parse.c +++ b/platform/linux-generic/arch/mips64/odp_sysinfo_parse.c @@ -25,7 +25,7 @@ int odp_cpuinfo_parser(FILE *file, odp_system_info_t *sysinfo) if (pos) { sscanf(pos, "BogoMIPS : %lf", &mhz); /* bogomips seems to be 2x freq */ - sysinfo->cpu_hz[id] = \ + sysinfo->cpu_hz_max[id] = \ (uint64_t)(mhz * 1000000.0 / 2.0); count--; } diff --git a/platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c b/platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c index 2baed1e..9515757 100644 --- a/platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c +++ b/platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c @@ -24,7 +24,7 @@ int odp_cpuinfo_parser(FILE *file, odp_system_info_t *sysinfo) if (pos) { sscanf(pos, "clock : %lf", &mhz); - sysinfo->cpu_hz[id] = \ + sysinfo->cpu_hz_max[id] = \ (uint64_t)(mhz * 1000000.0); count--; } diff --git a/platform/linux-generic/arch/x86/odp_sysinfo_parse.c b/platform/linux-generic/arch/x86/odp_sysinfo_parse.c index 02ec9ea..49e7f93 100644 --- a/platform/linux-generic/arch/x86/odp_sysinfo_parse.c +++ b/platform/linux-generic/arch/x86/odp_sysinfo_parse.c @@ -26,7 +26,8 @@ int odp_cpuinfo_parser(FILE *file, odp_system_info_t *sysinfo) pos = strchr(sysinfo->model_str[id], '@'); *(pos - 1) = '\0'; if (sscanf(pos, "@ %lfGHz", &ghz) == 1) - sysinfo->cpu_hz[id] = (uint64_t)(ghz * 1000000000.0); + sysinfo->cpu_hz_max[id] = \ + (uint64_t)(ghz * 1000000000.0); id++; } diff --git a/platform/linux-generic/include/odp_internal.h b/platform/linux-generic/include/odp_internal.h index 2eeba42..c6b98b0 100644 --- a/platform/linux-generic/include/odp_internal.h +++ b/platform/linux-generic/include/odp_internal.h @@ -26,7 +26,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 ed0897d..6df529e 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"); } @@ -232,7 +232,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; }