From patchwork Mon Jan 18 10:10:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hongbo Zhang X-Patchwork-Id: 59922 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp1913488lbb; Mon, 18 Jan 2016 02:27:57 -0800 (PST) X-Received: by 10.140.132.212 with SMTP id 203mr30593245qhe.102.1453112877811; Mon, 18 Jan 2016 02:27:57 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id f15si30341005qge.123.2016.01.18.02.27.57; Mon, 18 Jan 2016 02:27:57 -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 6B68561709; Mon, 18 Jan 2016 10:27:57 +0000 (UTC) Authentication-Results: lists.linaro.org; dkim=fail reason="verification failed; unprotected key" header.d=linaro.org header.i=@linaro.org header.b=KB2+QZHU; 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 321A861715; Mon, 18 Jan 2016 10:22:42 +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 0E73061729; Mon, 18 Jan 2016 10:22:29 +0000 (UTC) Received: from mail-pf0-f180.google.com (mail-pf0-f180.google.com [209.85.192.180]) by lists.linaro.org (Postfix) with ESMTPS id E780861729 for ; Mon, 18 Jan 2016 10:20:32 +0000 (UTC) Received: by mail-pf0-f180.google.com with SMTP id e65so156232251pfe.0 for ; Mon, 18 Jan 2016 02:20:32 -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=XH3FqMWaVeb0oTuyFx4gk8cPBo5lKNhdJKeUsfivsQ0=; b=KB2+QZHUhoFVZlNXfz+kwGjcrotdqmTyorCWPCP5KjTuenN0SLSxiA2tuXaKyLgMJS IL7vXAFe26GCIYGAjD3q2SltDSy0lyEXbNy3mYHmsZq0bL+lYl37WgTDxnAFhelMkXcc YnIWDEXI+40+PnWIaveeDVoBBZHwl5Q//r7Sw= 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=XH3FqMWaVeb0oTuyFx4gk8cPBo5lKNhdJKeUsfivsQ0=; b=M6voxRGaAkniSVnDi7Ehy4W3gWE4C6p2uL4OBvQsfQYHaZk2cBWf4swH4nDWqQElP6 pX/2mr5XpxAsNj+5m98C0+iiFXK++aPWrayQ0uvWH6FfFd1qPGs3fzdKZiZpISzyspuw /2F+05nIDhNkM9s+i8aXplznDgHlAuNl+5KD9FOwRKxtlUu9xF4DE/Kf7CpxlnjVG5tk ozliHMCAOzBotEJQCvYv3XLO1Au+6vJALpaMznnccsd9R48OGLYorVhtKNkjZMoHqnK+ 3li+JMpSNSHhOauaVCwX4Rx++MhLmM3W/RimTOjD0oy5KII6RwI+hLjNwoy8kI68cQm8 BZew== X-Gm-Message-State: ALoCoQkM50Rhzdbaye3EPMk1IO1bI+SlHsKsILY7S0dPtdPRz4MQWvcZeQHnk7Dw2BM8nrgljn0JOJVtrkLyJUfZfW237hxBAg== X-Received: by 10.98.70.90 with SMTP id t87mr35251411pfa.110.1453112432284; Mon, 18 Jan 2016 02:20:32 -0800 (PST) Received: from ubuntu1504.ap.freescale.net (gate-zmy3.freescale.com. [192.88.167.1]) by smtp.gmail.com with ESMTPSA id x10sm32844521pas.37.2016.01.18.02.20.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 18 Jan 2016 02:20:31 -0800 (PST) From: hongbo.zhang@linaro.org To: lng-odp@lists.linaro.org Date: Mon, 18 Jan 2016 18:10:08 +0800 Message-Id: <1453111808-15762-13-git-send-email-hongbo.zhang@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1453111808-15762-1-git-send-email-hongbo.zhang@linaro.org> References: <1453111808-15762-1-git-send-email-hongbo.zhang@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCH v5 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 88c2066..c83d1d1 100644 --- a/platform/linux-generic/arch/mips64/odp_sysinfo_parse.c +++ b/platform/linux-generic/arch/mips64/odp_sysinfo_parse.c @@ -24,7 +24,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 1d122cc..9995b05 100644 --- a/platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c +++ b/platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c @@ -23,7 +23,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 aeb3d8f..e20ffcc 100644 --- a/platform/linux-generic/arch/x86/odp_sysinfo_parse.c +++ b/platform/linux-generic/arch/x86/odp_sysinfo_parse.c @@ -25,7 +25,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 d3cde5f..b30c0b3 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 c9cdcb4..36c1a77 100644 --- a/platform/linux-generic/odp_system_info.c +++ b/platform/linux-generic/odp_system_info.c @@ -168,7 +168,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"); } @@ -231,7 +231,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; }