Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1032557AbcJQVRh (ORCPT ); Mon, 17 Oct 2016 17:17:37 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:38488 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964894AbcJQVR3 (ORCPT ); Mon, 17 Oct 2016 17:17:29 -0400 DMARC-Filter: OpenDMARC Filter v1.3.1 smtp.codeaurora.org 52F8F612CA Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=pass smtp.mailfrom=timur@codeaurora.org Subject: Re: [PATCH V4 1/2] ACPI: Add support for ResourceSource/IRQ domain mapping To: Agustin Vega-Frias , linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, rjw@rjwysocki.net, lenb@kernel.org, tglx@linutronix.de, jason@lakedaemon.net, marc.zyngier@arm.com Cc: cov@codeaurora.org, agross@codeaurora.org, harba@codeaurora.org, jcm@redhat.com, msalter@redhat.com, mlangsdo@redhat.com, ahs3@redhat.com, astone@redhat.com, graeme.gregory@linaro.org, guohanjun@huawei.com, charles.garcia-tobin@arm.com References: <1476738177-24979-1-git-send-email-agustinv@codeaurora.org> <1476738177-24979-2-git-send-email-agustinv@codeaurora.org> From: Timur Tabi Message-ID: <58053FE5.3020208@codeaurora.org> Date: Mon, 17 Oct 2016 16:17:25 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:43.0) Gecko/20100101 Firefox/43.0 SeaMonkey/2.40 MIME-Version: 1.0 In-Reply-To: <1476738177-24979-2-git-send-email-agustinv@codeaurora.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2006 Lines: 68 Just a few nits: Agustin Vega-Frias wrote: > +int acpi_irq_domain_register_irq(struct acpi_resource_source *source, u32 hwirq, > + int trigger, int polarity) > +{ > + struct irq_fwspec fwspec; > + struct acpi_device *device; > + acpi_handle handle; > + acpi_status status; > + int ret; > + > + if (source->string_length == 0) Would (!source->string_length) be more meaningful? > + return acpi_register_gsi(NULL, hwirq, trigger, polarity); > + > + status = acpi_get_handle(NULL, source->string_ptr, &handle); > + if (ACPI_FAILURE(status)) > + return -ENODEV; > + > + device = acpi_bus_get_acpi_device(handle); > + if (!device) > + return -ENODEV; > + > + if (acpi_irq_domain_ensure_probed(device)) > + return -ENODEV; > + > + fwspec.fwnode = &device->fwnode; > + fwspec.param[0] = hwirq; > + fwspec.param[1] = acpi_dev_get_irq_type(trigger, polarity); > + fwspec.param_count = 2; > + > + ret = irq_create_fwspec_mapping(&fwspec); > + acpi_bus_put_acpi_device(device); > + return ret; Blank line before 'return'. > -static void acpi_dev_get_irqresource(struct resource *res, u32 gsi, > +static void acpi_dev_get_irqresource(struct resource *res, u32 hwirq, > + struct acpi_resource_source *source, This should probably be a 'const', because ... > @@ -448,6 +449,7 @@ bool acpi_dev_resource_interrupt(struct acpi_resource *ares, int index, > { > struct acpi_resource_irq *irq; > struct acpi_resource_extended_irq *ext_irq; > + struct acpi_resource_source dummy = { 0, 0, NULL }; ... then you can make this a static const, which will reduce code size and improve performance. > @@ -1024,6 +1030,43 @@ struct acpi_probe_entry { > (&ACPI_PROBE_TABLE_END(t) - \ > &ACPI_PROBE_TABLE(t))); \ > }) > + > +#define ACPI_HID_LEN 9 Please add a comment for this. -- Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.