From patchwork Tue Jan 12 18:32:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Borislav Petkov X-Patchwork-Id: 8020141 Return-Path: X-Original-To: patchwork-linux-arm@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 CE91B9F716 for ; Tue, 12 Jan 2016 18:35:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EB523203F7 for ; Tue, 12 Jan 2016 18:35:17 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2985A203F3 for ; Tue, 12 Jan 2016 18:35:17 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aJ3ki-0002Hf-0K; Tue, 12 Jan 2016 18:33:08 +0000 Received: from mail.skyhub.de ([2a01:4f8:120:8448::d00d]) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aJ3ke-0002BZ-RG for linux-arm-kernel@lists.infradead.org; Tue, 12 Jan 2016 18:33:05 +0000 X-Virus-Scanned: Nedap ESD1 at mail.skyhub.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alien8.de; s=alien8; t=1452623560; bh=m5PR87N1BDt5s6R6QnW3dPRlvunPd2JQXYMizRPHBJA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:In-Reply-To; b=QwhCRH126y0xlnYEx8LzLijWssC4Np7tWzRvRT dUWweaFtabR/6aT28OXIh+e01P6NyHq0akKT6PeTKPQuHOB7sMoUhDC6fHiMNiN9yoP AzGpGUd7dAIQBS6FFdDvFU9wzAbDTPsvN8SCU+i85mNj57FZ07tVOIuZkU5CoDLhY4= Received: from mail.skyhub.de ([127.0.0.1]) by localhost (door.skyhub.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 1h-4SAZqYMdG; Tue, 12 Jan 2016 19:32:40 +0100 (CET) Received: from pd.tnic (p5DDC51E5.dip0.t-ipconnect.de [93.220.81.229]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 51A6B1DA245; Tue, 12 Jan 2016 19:32:40 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alien8.de; s=alien8; t=1452623560; bh=m5PR87N1BDt5s6R6QnW3dPRlvunPd2JQXYMizRPHBJA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:In-Reply-To; b=QwhCRH126y0xlnYEx8LzLijWssC4Np7tWzRvRT dUWweaFtabR/6aT28OXIh+e01P6NyHq0akKT6PeTKPQuHOB7sMoUhDC6fHiMNiN9yoP AzGpGUd7dAIQBS6FFdDvFU9wzAbDTPsvN8SCU+i85mNj57FZ07tVOIuZkU5CoDLhY4= Received: by pd.tnic (Postfix, from userid 1000) id 61F181606FB; Tue, 12 Jan 2016 19:32:28 +0100 (CET) Date: Tue, 12 Jan 2016 19:32:28 +0100 From: Borislav Petkov To: Tuan Phan Subject: Re: [PATCH v3 1/2] acpi: Fix proper return code for function acpi_gsi_to_irq Message-ID: <20160112183228.GK30558@pd.tnic> References: <1446857519-5908-1-git-send-email-lho@apm.com> <1446857519-5908-2-git-send-email-lho@apm.com> <20160110110714.GA22896@pd.tnic> <20160111221305.GH4665@pd.tnic> <20160112143653.GB30558@pd.tnic> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160112_103305_169401_A37C6EB3 X-CRM114-Status: GOOD ( 11.40 ) X-Spam-Score: -2.0 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-kernel@lists.infradead.org, mchehab@osg.samsung.com, Jon Masters , rjw@rjwysocki.net, Tomasz Nowicki , linux-acpi@vger.kernel.org, patches@apm.com, Loc Ho , dougthompson@xmission.com, Thomas Gleixner , linux-edac@vger.kernel.org, Fu Wei , Len Brown Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham 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 On Tue, Jan 12, 2016 at 10:26:04AM -0800, Tuan Phan wrote: > So are you good with it? How about this instead: diff --git a/drivers/acpi/gsi.c b/drivers/acpi/gsi.c index fa4585a6914e..e42f6b7eac13 100644 --- a/drivers/acpi/gsi.c +++ b/drivers/acpi/gsi.c @@ -46,17 +46,22 @@ static unsigned int acpi_gsi_get_irq_type(int trigger, int polarity) * Returns: linux IRQ number on success (>0) * -EINVAL on failure */ -int acpi_gsi_to_irq(u32 gsi, unsigned int *irq) +int acpi_gsi_to_irq(u32 gsi) { + unsigned int irq; + struct irq_domain *d = irq_find_matching_fwnode(acpi_gsi_domain_id, DOMAIN_BUS_ANY); - *irq = irq_find_mapping(d, gsi); + irq = irq_find_mapping(d, gsi); /* * *irq == 0 means no mapping, that should * be reported as a failure */ - return (*irq > 0) ? *irq : -EINVAL; + if (irq > 0) + return irq; + else + return -EINVAL; } EXPORT_SYMBOL_GPL(acpi_gsi_to_irq);