From patchwork Wed Jan 20 09:21:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hongbo Zhang X-Patchwork-Id: 60024 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp3069086lbb; Wed, 20 Jan 2016 01:42:22 -0800 (PST) X-Received: by 10.140.86.85 with SMTP id o79mr43503732qgd.3.1453282942639; Wed, 20 Jan 2016 01:42:22 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id f137si42749578qhc.116.2016.01.20.01.42.22; Wed, 20 Jan 2016 01:42:22 -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 36AD16177C; Wed, 20 Jan 2016 09:42:22 +0000 (UTC) Authentication-Results: lists.linaro.org; dkim=fail reason="verification failed; unprotected key" header.d=linaro.org header.i=@linaro.org header.b=KrB5sDXQ; 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_H3, RCVD_IN_MSPIKE_WL, 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 D263A617B0; Wed, 20 Jan 2016 09:36:49 +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 CD9446178C; Wed, 20 Jan 2016 09:36:36 +0000 (UTC) Received: from mail-pa0-f46.google.com (mail-pa0-f46.google.com [209.85.220.46]) by lists.linaro.org (Postfix) with ESMTPS id 80ABD61793 for ; Wed, 20 Jan 2016 09:35:47 +0000 (UTC) Received: by mail-pa0-f46.google.com with SMTP id yy13so1963414pab.3 for ; Wed, 20 Jan 2016 01:35:47 -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=/y+nNJR9wT4iyxCCNbt9f13Xx/hG4+JzaC6VtfLdI2E=; b=KrB5sDXQGO0WWSmDimNppNACYOX+3ajgIypQdNNMVuFOoW8agBV5+LDUSblVLpLOK4 X7wCBkqptFtTffxq3QbxZjCAMl0Vvt1avKwOLaPPiy5JLTp33VENDcYSWdrWqnhjGNJx 4llChOPjw2qW0zFSU1a5BcmzTESXvBzWYitOc= 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=/y+nNJR9wT4iyxCCNbt9f13Xx/hG4+JzaC6VtfLdI2E=; b=dPkqbnUNdz0VnhKvEajdnmxqQr4lbRjULPfnhDhFL2IKWu7r6AaSVhV7xXYLaG9sWW KXhotDpI80DhlTAd6AqoUmhCO6gBhjMocXoSh7bBlvLqwK7jn1fIzETAR5hmB/XFdjIR gc0fd6X7WRyZw/xosAiXWeVVgkdcSG7d70h4JorEEA0cZLy/a/8qr9/ju+Bs6WJ7iGov 8tUd2SlunqMJCrWzT+I34RsjP2YMj67rRr+0L510dmgjk3sQd7HjcRFIZQu4bqcs5eHY I9a1NWfNfufZ0cMY5rLyc7F04AFZk3K/+CirtS9nqYPUWeX0jkxQyM4c1gN1xlvMuI1K /t6w== X-Gm-Message-State: ALoCoQljyLpNEmPAsU4O2iyYvNGVLyZ1I8OdiTTkjKDzz8hVpfe1k21sMlDCh4wKNe5py8+5roAJdG1iRQdmnJHMDWEAmJOwQw== X-Received: by 10.66.141.142 with SMTP id ro14mr50413436pab.112.1453282546877; Wed, 20 Jan 2016 01:35:46 -0800 (PST) Received: from ubuntu1504.ap.freescale.net (gate-zmy3.freescale.com. [192.88.167.1]) by smtp.gmail.com with ESMTPSA id xz6sm47592797pab.42.2016.01.20.01.35.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 20 Jan 2016 01:35:46 -0800 (PST) From: hongbo.zhang@linaro.org To: lng-odp@lists.linaro.org Date: Wed, 20 Jan 2016 17:21:02 +0800 Message-Id: <1453281662-31499-13-git-send-email-hongbo.zhang@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1453281662-31499-1-git-send-email-hongbo.zhang@linaro.org> References: <1453281662-31499-1-git-send-email-hongbo.zhang@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCH v7 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 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; }