From patchwork Tue Feb 23 06:51:11 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cao jin X-Patchwork-Id: 8387801 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 3C64A9F1D4 for ; Tue, 23 Feb 2016 06:50:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9AF7320676 for ; Tue, 23 Feb 2016 06:50:44 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E151120671 for ; Tue, 23 Feb 2016 06:50:43 +0000 (UTC) Received: from localhost ([::1]:54416 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aY6nz-0001Tk-1b for patchwork-qemu-devel@patchwork.kernel.org; Tue, 23 Feb 2016 01:50:43 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44259) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aY6nl-0001TE-BQ for qemu-devel@nongnu.org; Tue, 23 Feb 2016 01:50:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aY6ni-0004IC-4B for qemu-devel@nongnu.org; Tue, 23 Feb 2016 01:50:29 -0500 Received: from [59.151.112.132] (port=32629 helo=heian.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aY6nh-0004Hy-M5 for qemu-devel@nongnu.org; Tue, 23 Feb 2016 01:50:26 -0500 X-IronPort-AV: E=Sophos;i="5.20,346,1444665600"; d="scan'208";a="3819447" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 23 Feb 2016 14:50:23 +0800 Received: from G08CNEXCHPEKD01.g08.fujitsu.local (unknown [10.167.33.80]) by cn.fujitsu.com (Postfix) with ESMTP id 3F28D42AC84A; Tue, 23 Feb 2016 14:48:26 +0800 (CST) Received: from G08FNSTD140223.g08.fujitsu.local (10.167.226.69) by G08CNEXCHPEKD01.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.181.6; Tue, 23 Feb 2016 14:50:20 +0800 From: Cao jin To: Date: Tue, 23 Feb 2016 14:51:11 +0800 Message-ID: <1456210271-8119-1-git-send-email-caoj.fnst@cn.fujitsu.com> X-Mailer: git-send-email 2.1.0 MIME-Version: 1.0 X-Originating-IP: [10.167.226.69] X-yoursite-MailScanner-ID: 3F28D42AC84A.A9748 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: caoj.fnst@cn.fujitsu.com X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 59.151.112.132 Cc: ehabkost@redhat.com, mst@redhat.com Subject: [Qemu-devel] [PATCH] topology.h: cleanup X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP remove useless parameter of several functions Signed-off-by: Cao jin --- include/hw/i386/topology.h | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/include/hw/i386/topology.h b/include/hw/i386/topology.h index 148cc1b..d0f473c 100644 --- a/include/hw/i386/topology.h +++ b/include/hw/i386/topology.h @@ -64,32 +64,31 @@ static unsigned apicid_bitwidth_for_count(unsigned count) /* Bit width of the SMT_ID (thread ID) field on the APIC ID */ -static inline unsigned apicid_smt_width(unsigned nr_cores, unsigned nr_threads) +static inline unsigned apicid_smt_width(unsigned nr_threads) { return apicid_bitwidth_for_count(nr_threads); } /* Bit width of the Core_ID field */ -static inline unsigned apicid_core_width(unsigned nr_cores, unsigned nr_threads) +static inline unsigned apicid_core_width(unsigned nr_cores) { return apicid_bitwidth_for_count(nr_cores); } -/* Bit offset of the Core_ID field +/* Bit offset of the Core_ID field, equals bit width of SMT_ID */ -static inline unsigned apicid_core_offset(unsigned nr_cores, - unsigned nr_threads) +static inline unsigned apicid_core_offset(unsigned nr_threads) { - return apicid_smt_width(nr_cores, nr_threads); + return apicid_smt_width(nr_threads); } /* Bit offset of the Pkg_ID (socket ID) field */ static inline unsigned apicid_pkg_offset(unsigned nr_cores, unsigned nr_threads) { - return apicid_core_offset(nr_cores, nr_threads) + - apicid_core_width(nr_cores, nr_threads); + return apicid_core_offset(nr_threads) + + apicid_core_width(nr_cores); } /* Make APIC ID for the CPU based on Pkg_ID, Core_ID, SMT_ID @@ -101,7 +100,7 @@ static inline apic_id_t apicid_from_topo_ids(unsigned nr_cores, const X86CPUTopoInfo *topo) { return (topo->pkg_id << apicid_pkg_offset(nr_cores, nr_threads)) | - (topo->core_id << apicid_core_offset(nr_cores, nr_threads)) | + (topo->core_id << apicid_core_offset(nr_threads)) | topo->smt_id; }