From patchwork Wed May 8 13:14:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 10935649 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2F0191390 for ; Wed, 8 May 2019 13:15:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1D20E283BF for ; Wed, 8 May 2019 13:15:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0F25C284FF; Wed, 8 May 2019 13:15:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B2BDD283BF for ; Wed, 8 May 2019 13:15:47 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hOMOk-0007yZ-2S; Wed, 08 May 2019 13:14:14 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hOMOi-0007yN-Sg for xen-devel@lists.xenproject.org; Wed, 08 May 2019 13:14:12 +0000 X-Inumbo-ID: 29d8ce08-7193-11e9-8199-4b334b65a014 Received: from prv1-mh.provo.novell.com (unknown [137.65.248.33]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 29d8ce08-7193-11e9-8199-4b334b65a014; Wed, 08 May 2019 13:14:09 +0000 (UTC) Received: from INET-PRV1-MTA by prv1-mh.provo.novell.com with Novell_GroupWise; Wed, 08 May 2019 07:14:08 -0600 Message-Id: <5CD2D61E020000780022CD88@prv1-mh.provo.novell.com> X-Mailer: Novell GroupWise Internet Agent 18.1.0 Date: Wed, 08 May 2019 07:14:06 -0600 From: "Jan Beulich" To: "xen-devel" References: <5CC6DD090200007800229E80@prv1-mh.provo.novell.com> <5CD2D2C8020000780022CCF2@prv1-mh.provo.novell.com> In-Reply-To: <5CD2D2C8020000780022CCF2@prv1-mh.provo.novell.com> Mime-Version: 1.0 Content-Disposition: inline Subject: [Xen-devel] [PATCH v2 12/12] x86/IRQ: simplify and rename pirq_acktype() X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Andrew Cooper , Wei Liu , Roger Pau Monne Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Its only caller already has the IRQ descriptor in its hands, so there's no need for the function to re-obtain it. As a result the leading p of its name is no longer appropriate and hence gets dropped. Signed-off-by: Jan Beulich Reviewed-by: Roger Pau Monné --- v2: New. --- a/xen/arch/x86/irq.c +++ b/xen/arch/x86/irq.c @@ -1550,17 +1550,8 @@ int pirq_guest_unmask(struct domain *d) return 0; } -static int pirq_acktype(struct domain *d, int pirq) +static int irq_acktype(const struct irq_desc *desc) { - struct irq_desc *desc; - int irq; - - irq = domain_pirq_to_irq(d, pirq); - if ( irq <= 0 ) - return ACKTYPE_NONE; - - desc = irq_to_desc(irq); - if ( desc->handler == &no_irq_type ) return ACKTYPE_NONE; @@ -1591,7 +1582,8 @@ static int pirq_acktype(struct domain *d if ( !strcmp(desc->handler->typename, "XT-PIC") ) return ACKTYPE_UNMASK; - printk("Unknown PIC type '%s' for IRQ %d\n", desc->handler->typename, irq); + printk("Unknown PIC type '%s' for IRQ%d\n", + desc->handler->typename, desc->irq); BUG(); return 0; @@ -1668,7 +1660,7 @@ int pirq_guest_bind(struct vcpu *v, stru action->nr_guests = 0; action->in_flight = 0; action->shareable = will_share; - action->ack_type = pirq_acktype(v->domain, pirq->pirq); + action->ack_type = irq_acktype(desc); init_timer(&action->eoi_timer, irq_guest_eoi_timer_fn, desc, 0); desc->status |= IRQ_GUEST;