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: 8020131 Return-Path: X-Original-To: patchwork-linux-acpi@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 6DD6E9F3F6 for ; Tue, 12 Jan 2016 18:32:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 97CF720411 for ; Tue, 12 Jan 2016 18:32:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B7E9F203F3 for ; Tue, 12 Jan 2016 18:32:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758982AbcALScn (ORCPT ); Tue, 12 Jan 2016 13:32:43 -0500 Received: from mail.skyhub.de ([78.46.96.112]:39942 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752823AbcALScm (ORCPT ); Tue, 12 Jan 2016 13:32:42 -0500 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 Cc: Loc Ho , dougthompson@xmission.com, mchehab@osg.samsung.com, Tomasz Nowicki , Fu Wei , rjw@rjwysocki.net, Len Brown , linux-edac@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-acpi@vger.kernel.org, Jon Masters , patches@apm.com, Thomas Gleixner 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) Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,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 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);