From patchwork Tue Feb 9 20:01:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 8265411 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 83D57BEEE5 for ; Tue, 9 Feb 2016 20:04:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A32992022D for ; Tue, 9 Feb 2016 20:04:42 +0000 (UTC) Received: from lists.xen.org (lists.xenproject.org [50.57.142.19]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B1644201BC for ; Tue, 9 Feb 2016 20:04:41 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aTEU1-0001d0-9K; Tue, 09 Feb 2016 20:01:57 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aTETz-0001bz-26 for xen-devel@lists.xen.org; Tue, 09 Feb 2016 20:01:55 +0000 Received: from [85.158.137.68] by server-2.bemta-3.messagelabs.com id 64/E3-21201-2B54AB65; Tue, 09 Feb 2016 20:01:54 +0000 X-Env-Sender: prvs=8403a2554=Andrew.Cooper3@citrix.com X-Msg-Ref: server-5.tower-31.messagelabs.com!1455048112!21355650!1 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 7.35.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 45660 invoked from network); 9 Feb 2016 20:01:53 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-5.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 9 Feb 2016 20:01:53 -0000 X-IronPort-AV: E=Sophos;i="5.22,422,1449532800"; d="scan'208";a="330665317" From: Andrew Cooper To: Xen-devel Date: Tue, 9 Feb 2016 20:01:42 +0000 Message-ID: <1455048108-5045-3-git-send-email-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1455048108-5045-1-git-send-email-andrew.cooper3@citrix.com> References: <1455048108-5045-1-git-send-email-andrew.cooper3@citrix.com> MIME-Version: 1.0 X-DLP: MIA2 Cc: Andrew Cooper , Tim Deegan , Ian Campbell , Jan Beulich Subject: [Xen-devel] [PATCH 2/8] xen/misc: Remove or annotate possibly-unused functions X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 Clang notices more unused functions than GCC. * sh_next_page() is only used at GUEST_PAGING_LEVELS=2, so remove it from the other guest level translation units * rcu_batch_after() is completely unused. * Various of the COMPAT() generated functions are used only for their BUILD_BUG_ON() properties. Annotate them all as __maybe_used. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Tim Deegan CC: Ian Campbell --- xen/arch/x86/mm/shadow/multi.c | 2 ++ xen/common/rcupdate.c | 6 ------ xen/include/xen/compat.h | 14 ++++++++------ 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c index 4d0b317..aaf8db7 100644 --- a/xen/arch/x86/mm/shadow/multi.c +++ b/xen/arch/x86/mm/shadow/multi.c @@ -436,6 +436,7 @@ sh_cmpxchg_guest_entry(struct vcpu *v, intpte_t *p, intpte_t *old, * space.) */ +#if GUEST_PAGING_LEVELS == 2 /* From one page of a multi-page shadow, find the next one */ static inline mfn_t sh_next_page(mfn_t smfn) { @@ -454,6 +455,7 @@ static inline mfn_t sh_next_page(mfn_t smfn) ASSERT(!next->u.sh.head); return page_to_mfn(next); } +#endif static inline u32 guest_index(void *ptr) diff --git a/xen/common/rcupdate.c b/xen/common/rcupdate.c index f13b87b..8cc5a82 100644 --- a/xen/common/rcupdate.c +++ b/xen/common/rcupdate.c @@ -141,12 +141,6 @@ static inline int rcu_batch_before(long a, long b) return (a - b) < 0; } -/* Is batch a after batch b ? */ -static inline int rcu_batch_after(long a, long b) -{ - return (a - b) > 0; -} - static void force_quiescent_state(struct rcu_data *rdp, struct rcu_ctrlblk *rcp) { diff --git a/xen/include/xen/compat.h b/xen/include/xen/compat.h index e5c23e2..3f4cef6 100644 --- a/xen/include/xen/compat.h +++ b/xen/include/xen/compat.h @@ -134,14 +134,16 @@ #define CHECK_NAME_(k, n, tag) __check ## tag ## k ## _ ## n #define CHECK_TYPE(name) \ -static inline int CHECK_NAME(name, T)(xen_ ## name ## _t *x, \ - compat_ ## name ## _t *c) \ +static inline int __maybe_unused \ +CHECK_NAME(name, T)(xen_ ## name ## _t *x, \ + compat_ ## name ## _t *c) \ { \ return x == c; \ } #define CHECK_TYPE_(k, n) \ -static inline int CHECK_NAME_(k, n, T)(k xen_ ## n *x, \ - k compat_ ## n *c) \ +static inline int __maybe_unused \ +CHECK_NAME_(k, n, T)(k xen_ ## n *x, \ + k compat_ ## n *c) \ { \ return x == c; \ } @@ -154,14 +156,14 @@ static inline int CHECK_NAME_(k, n, T)(k xen_ ## n *x, \ sizeof(k compat_ ## n)) * 2] #define CHECK_FIELD_COMMON(name, t, f) \ -static inline int name(xen_ ## t ## _t *x, compat_ ## t ## _t *c) \ +static inline int __maybe_unused name(xen_ ## t ## _t *x, compat_ ## t ## _t *c) \ { \ BUILD_BUG_ON(offsetof(xen_ ## t ## _t, f) != \ offsetof(compat_ ## t ## _t, f)); \ return &x->f == &c->f; \ } #define CHECK_FIELD_COMMON_(k, name, n, f) \ -static inline int name(k xen_ ## n *x, k compat_ ## n *c) \ +static inline int __maybe_unused name(k xen_ ## n *x, k compat_ ## n *c) \ { \ BUILD_BUG_ON(offsetof(k xen_ ## n, f) != \ offsetof(k compat_ ## n, f)); \