All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tuan Phan <tphan@apm.com>
To: Borislav Petkov <bp@alien8.de>
Cc: Loc Ho <lho@apm.com>,
	dougthompson@xmission.com, mchehab@osg.samsung.com,
	Tomasz Nowicki <tomasz.nowicki@linaro.org>,
	Fu Wei <fu.wei@linaro.org>,
	rjw@rjwysocki.net, Len Brown <lenb@kernel.org>,
	linux-edac@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-acpi@vger.kernel.org, Jon Masters <jcm@redhat.com>,
	patches@apm.com, Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH v3 1/2] acpi: Fix proper return code for function acpi_gsi_to_irq
Date: Tue, 12 Jan 2016 10:46:15 -0800	[thread overview]
Message-ID: <CAGDN=zbbfr8HVKhg4YEieyxzb6jT6eMJ2mTyn6zV9HFD_AA3aA@mail.gmail.com> (raw)
In-Reply-To: <20160112183228.GK30558@pd.tnic>

On Tue, Jan 12, 2016 at 10:32 AM, Borislav Petkov <bp@alien8.de> wrote:
> 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);

Well, it basically the same as old code except the change of API
interface. And it requires some changes in ACPI core and X86/I64 arch
code. Do we really want to go with this solution instead of just
return 0 on success and -EINVAL on failure?

-- 
CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, is 
for the sole use of the intended recipient(s) and contains information that 
is confidential and proprietary to Applied Micro Circuits Corporation or 
its subsidiaries. It is to be used solely for the purpose of furthering the 
parties' business relationship. All unauthorized review, use, disclosure or 
distribution is prohibited. If you are not the intended recipient, please 
contact the sender by reply e-mail and destroy all copies of the original 
message.

WARNING: multiple messages have this Message-ID (diff)
From: tphan@apm.com (Tuan Phan)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 1/2] acpi: Fix proper return code for function acpi_gsi_to_irq
Date: Tue, 12 Jan 2016 10:46:15 -0800	[thread overview]
Message-ID: <CAGDN=zbbfr8HVKhg4YEieyxzb6jT6eMJ2mTyn6zV9HFD_AA3aA@mail.gmail.com> (raw)
In-Reply-To: <20160112183228.GK30558@pd.tnic>

On Tue, Jan 12, 2016 at 10:32 AM, Borislav Petkov <bp@alien8.de> wrote:
> 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);

Well, it basically the same as old code except the change of API
interface. And it requires some changes in ACPI core and X86/I64 arch
code. Do we really want to go with this solution instead of just
return 0 on success and -EINVAL on failure?

-- 
CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, is 
for the sole use of the intended recipient(s) and contains information that 
is confidential and proprietary to Applied Micro Circuits Corporation or 
its subsidiaries. It is to be used solely for the purpose of furthering the 
parties' business relationship. All unauthorized review, use, disclosure or 
distribution is prohibited. If you are not the intended recipient, please 
contact the sender by reply e-mail and destroy all copies of the original 
message.

  reply	other threads:[~2016-01-12 18:46 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-07  0:51 [PATCH v3 0/2] acpi: apei: Bug fix to enable APEI support for ARMv8 Loc Ho
2015-11-07  0:51 ` Loc Ho
2015-11-07  0:51 ` [PATCH v3 1/2] acpi: Fix proper return code for function acpi_gsi_to_irq Loc Ho
2015-11-07  0:51   ` Loc Ho
2016-01-10 11:07   ` Borislav Petkov
2016-01-10 11:07     ` Borislav Petkov
2016-01-11 22:04     ` Tuan Phan
2016-01-11 22:04       ` Tuan Phan
2016-01-11 22:13       ` Borislav Petkov
2016-01-11 22:13         ` Borislav Petkov
2016-01-11 22:41         ` Tuan Phan
2016-01-11 22:41           ` Tuan Phan
2016-01-12 14:36           ` Borislav Petkov
2016-01-12 14:36             ` Borislav Petkov
2016-01-12 18:26             ` Tuan Phan
2016-01-12 18:26               ` Tuan Phan
2016-01-12 18:32               ` Borislav Petkov
2016-01-12 18:32                 ` Borislav Petkov
2016-01-12 18:46                 ` Tuan Phan [this message]
2016-01-12 18:46                   ` Tuan Phan
2016-01-12 19:21                   ` Borislav Petkov
2016-01-12 19:21                     ` Borislav Petkov
2016-01-12 18:59   ` Marc Zyngier
2016-01-12 18:59     ` Marc Zyngier
2016-01-12 19:13     ` Tuan Phan
2016-01-12 19:13       ` Tuan Phan
2016-01-12 19:32       ` Marc Zyngier
2016-01-12 19:32         ` Marc Zyngier
2016-01-12 20:01         ` Tuan Phan
2016-01-12 20:01           ` Tuan Phan
2016-01-13  8:40           ` Marc Zyngier
2016-01-13  8:40             ` Marc Zyngier
2015-11-07  0:51 ` [PATCH v3 2/2] acpi: apei: Enable APEI multiple GHES source to share an single external IRQ Loc Ho
2015-11-07  0:51   ` Loc Ho
2016-01-09  0:30 ` [PATCH v3 0/2] acpi: apei: Bug fix to enable APEI support for ARMv8 Loc Ho
2016-01-09  0:30   ` Loc Ho
2016-01-10 11:08   ` Borislav Petkov
2016-01-10 11:08     ` Borislav Petkov

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='CAGDN=zbbfr8HVKhg4YEieyxzb6jT6eMJ2mTyn6zV9HFD_AA3aA@mail.gmail.com' \
    --to=tphan@apm.com \
    --cc=bp@alien8.de \
    --cc=dougthompson@xmission.com \
    --cc=fu.wei@linaro.org \
    --cc=jcm@redhat.com \
    --cc=lenb@kernel.org \
    --cc=lho@apm.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-edac@vger.kernel.org \
    --cc=mchehab@osg.samsung.com \
    --cc=patches@apm.com \
    --cc=rjw@rjwysocki.net \
    --cc=tglx@linutronix.de \
    --cc=tomasz.nowicki@linaro.org \
    /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: link
Be 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.