From patchwork Tue Jan 19 10:17:13 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hongbo Zhang X-Patchwork-Id: 59975 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp2485833lbb; Tue, 19 Jan 2016 02:25:59 -0800 (PST) X-Received: by 10.140.25.169 with SMTP id 38mr36640044qgt.73.1453199159889; Tue, 19 Jan 2016 02:25:59 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id n6si36798002qge.102.2016.01.19.02.25.59; Tue, 19 Jan 2016 02:25:59 -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 776F5610A8; Tue, 19 Jan 2016 10:25:59 +0000 (UTC) Authentication-Results: lists.linaro.org; dkim=fail reason="verification failed; unprotected key" header.d=linaro.org header.i=@linaro.org header.b=Eqz8EAHA; 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 195D561784; Tue, 19 Jan 2016 10:19:54 +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 0B22561782; Tue, 19 Jan 2016 10:19:39 +0000 (UTC) Received: from mail-pf0-f179.google.com (mail-pf0-f179.google.com [209.85.192.179]) by lists.linaro.org (Postfix) with ESMTPS id 7DAC06177D for ; Tue, 19 Jan 2016 10:17:57 +0000 (UTC) Received: by mail-pf0-f179.google.com with SMTP id 65so173082950pff.2 for ; Tue, 19 Jan 2016 02:17:57 -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=8BhCtFzAxT3sVJ1EeVoCmDK+wGNcvXABInwgk0OscOQ=; b=Eqz8EAHAvyiAh2iAQH3LPGc1q2RziWHt3TMUxPN1T2iKJOv9+Fo0PwB7tp8LPy/9XN OzETrVgCUUiE/XwNXQ2kjIJf/z4vCzNMvpcOjJ4o6hlhb2LiBEiw4UmTBLOJh0hfY+T+ AbMgY0dsQXkWkVdrhZqhxAevez0AIu08/yGiI= 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=8BhCtFzAxT3sVJ1EeVoCmDK+wGNcvXABInwgk0OscOQ=; b=kBTaQjNGyVN3qnrUYCjybtdrjIwuS9mrzFbRnd0uHQSjo+lZkUowUuJXhI9591X70e pOQ/WT6+cVtHa1sG9XKEwhMvGGkxPRsbv2kCqA6Wq0nvccEUL2g38tsBJfNCxThw3pI9 ukn2Q2w/40/JHtRsejZs2VfHjiq/nBnwR95X4NSdZ1SHUUSKreV1/zkAvGw3QkBc49Tf EkESmBXOZCfx8DE61tAeRAuQLSCqNZwuq9NYdfleLi1Fs5FEzqK1prvi+T46IbIDtxdc fNz+JhJpSaXBFRZqwWTwIQw53ECGrkDkXx4vMCdbFVxBD+uR5wly9TP9Nir1K6uDa21J 4rCg== X-Gm-Message-State: AG10YOQrpWvnlxb94wNITY+zWgwbRYwUz4nHfhxIgWcw9vLqxs5dz8LAXadai13o0Hjty/41o6E= X-Received: by 10.98.40.131 with SMTP id o125mr22459053pfo.83.1453198676914; Tue, 19 Jan 2016 02:17:56 -0800 (PST) Received: from ubuntu1504.ap.freescale.net (gate-zmy3.freescale.com. [192.88.167.1]) by smtp.gmail.com with ESMTPSA id k74sm40313374pfb.30.2016.01.19.02.17.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 19 Jan 2016 02:17:56 -0800 (PST) From: hongbo.zhang@linaro.org To: lng-odp@lists.linaro.org Date: Tue, 19 Jan 2016 18:17:13 +0800 Message-Id: <1453198633-24365-13-git-send-email-hongbo.zhang@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1453198633-24365-1-git-send-email-hongbo.zhang@linaro.org> References: <1453198633-24365-1-git-send-email-hongbo.zhang@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCH v6 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 c632352..5aec335 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 a3734cf..82a5f05 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 de187a0..2e602a3 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"); } @@ -239,7 +239,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; }