From: Timur Tabi <timur@codeaurora.org> To: Agustin Vega-Frias <agustinv@codeaurora.org>, 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 Subject: Re: [PATCH V4 1/2] ACPI: Add support for ResourceSource/IRQ domain mapping Date: Mon, 17 Oct 2016 16:17:25 -0500 [thread overview] Message-ID: <58053FE5.3020208@codeaurora.org> (raw) In-Reply-To: <1476738177-24979-2-git-send-email-agustinv@codeaurora.org> 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.
WARNING: multiple messages have this Message-ID (diff)
From: timur@codeaurora.org (Timur Tabi) To: linux-arm-kernel@lists.infradead.org Subject: [PATCH V4 1/2] ACPI: Add support for ResourceSource/IRQ domain mapping Date: Mon, 17 Oct 2016 16:17:25 -0500 [thread overview] Message-ID: <58053FE5.3020208@codeaurora.org> (raw) In-Reply-To: <1476738177-24979-2-git-send-email-agustinv@codeaurora.org> 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.
next prev parent reply other threads:[~2016-10-17 21:17 UTC|newest] Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top 2016-10-17 21:02 [PATCH V4 0/2] irqchip: qcom: Add IRQ combiner driver Agustin Vega-Frias 2016-10-17 21:02 ` Agustin Vega-Frias 2016-10-17 21:02 ` [PATCH V4 1/2] ACPI: Add support for ResourceSource/IRQ domain mapping Agustin Vega-Frias 2016-10-17 21:02 ` Agustin Vega-Frias 2016-10-17 21:17 ` Timur Tabi [this message] 2016-10-17 21:17 ` Timur Tabi 2016-10-17 21:02 ` [PATCH V4 2/2] irqchip: qcom: Add IRQ combiner driver Agustin Vega-Frias 2016-10-17 21:02 ` Agustin Vega-Frias
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=58053FE5.3020208@codeaurora.org \ --to=timur@codeaurora.org \ --cc=agross@codeaurora.org \ --cc=agustinv@codeaurora.org \ --cc=ahs3@redhat.com \ --cc=astone@redhat.com \ --cc=charles.garcia-tobin@arm.com \ --cc=cov@codeaurora.org \ --cc=graeme.gregory@linaro.org \ --cc=guohanjun@huawei.com \ --cc=harba@codeaurora.org \ --cc=jason@lakedaemon.net \ --cc=jcm@redhat.com \ --cc=lenb@kernel.org \ --cc=linux-acpi@vger.kernel.org \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-kernel@vger.kernel.org \ --cc=marc.zyngier@arm.com \ --cc=mlangsdo@redhat.com \ --cc=msalter@redhat.com \ --cc=rjw@rjwysocki.net \ --cc=tglx@linutronix.de \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.