All of lore.kernel.org
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: Loc Ho <lho@apm.com>
Cc: dougthompson@xmission.com, mchehab@osg.samsung.com,
	tomasz.nowicki@linaro.org, fu.wei@linaro.org, rjw@rjwysocki.net,
	lenb@kernel.org, linux-edac@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, linux-acpi@vger.kernel.org,
	jcm@redhat.com, patches@apm.com, Tuan Phan <tphan@apm.com>
Subject: Re: [PATCH v3 1/2] acpi: Fix proper return code for function acpi_gsi_to_irq
Date: Sun, 10 Jan 2016 12:07:14 +0100	[thread overview]
Message-ID: <20160110110714.GA22896@pd.tnic> (raw)
In-Reply-To: <1446857519-5908-2-git-send-email-lho@apm.com>

On Fri, Nov 06, 2015 at 05:51:58PM -0700, Loc Ho wrote:
> The function acpi_gsi_to_irq should returns 0 on success as upper function
> caller expect an 0 for sucesss.
> 
> Signed-off-by: Tuan Phan <tphan@apm.com>
> Signed-off-by: Loc Ho <lho@apm.com>
> ---
>  drivers/acpi/gsi.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/acpi/gsi.c b/drivers/acpi/gsi.c
> index fa4585a..0ed1003 100644
> --- a/drivers/acpi/gsi.c
> +++ b/drivers/acpi/gsi.c
> @@ -43,7 +43,7 @@ static unsigned int acpi_gsi_get_irq_type(int trigger, int polarity)
>   *
>   * irq location updated with irq value [>0 on success, 0 on failure]
>   *
> - * Returns: linux IRQ number on success (>0)
> + * Returns: 0 on success
>   *          -EINVAL on failure
>   */
>  int acpi_gsi_to_irq(u32 gsi, unsigned int *irq)
> @@ -56,7 +56,7 @@ int acpi_gsi_to_irq(u32 gsi, unsigned int *irq)
>  	 * *irq == 0 means no mapping, that should
>  	 * be reported as a failure
>  	 */
> -	return (*irq > 0) ? *irq : -EINVAL;
> +	return (*irq > 0) ? 0 : -EINVAL;
>  }
>  EXPORT_SYMBOL_GPL(acpi_gsi_to_irq);

That function can be simplified. It should be made to return the irq
number on success and 0 on failure. No need for that *irq output
argument.

-- 
Regards/Gruss,
    Boris.

ECO tip #101: Trim your mails when you reply.

WARNING: multiple messages have this Message-ID (diff)
From: bp@alien8.de (Borislav Petkov)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 1/2] acpi: Fix proper return code for function acpi_gsi_to_irq
Date: Sun, 10 Jan 2016 12:07:14 +0100	[thread overview]
Message-ID: <20160110110714.GA22896@pd.tnic> (raw)
In-Reply-To: <1446857519-5908-2-git-send-email-lho@apm.com>

On Fri, Nov 06, 2015 at 05:51:58PM -0700, Loc Ho wrote:
> The function acpi_gsi_to_irq should returns 0 on success as upper function
> caller expect an 0 for sucesss.
> 
> Signed-off-by: Tuan Phan <tphan@apm.com>
> Signed-off-by: Loc Ho <lho@apm.com>
> ---
>  drivers/acpi/gsi.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/acpi/gsi.c b/drivers/acpi/gsi.c
> index fa4585a..0ed1003 100644
> --- a/drivers/acpi/gsi.c
> +++ b/drivers/acpi/gsi.c
> @@ -43,7 +43,7 @@ static unsigned int acpi_gsi_get_irq_type(int trigger, int polarity)
>   *
>   * irq location updated with irq value [>0 on success, 0 on failure]
>   *
> - * Returns: linux IRQ number on success (>0)
> + * Returns: 0 on success
>   *          -EINVAL on failure
>   */
>  int acpi_gsi_to_irq(u32 gsi, unsigned int *irq)
> @@ -56,7 +56,7 @@ int acpi_gsi_to_irq(u32 gsi, unsigned int *irq)
>  	 * *irq == 0 means no mapping, that should
>  	 * be reported as a failure
>  	 */
> -	return (*irq > 0) ? *irq : -EINVAL;
> +	return (*irq > 0) ? 0 : -EINVAL;
>  }
>  EXPORT_SYMBOL_GPL(acpi_gsi_to_irq);

That function can be simplified. It should be made to return the irq
number on success and 0 on failure. No need for that *irq output
argument.

-- 
Regards/Gruss,
    Boris.

ECO tip #101: Trim your mails when you reply.

  reply	other threads:[~2016-01-10 11:07 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 [this message]
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
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=20160110110714.GA22896@pd.tnic \
    --to=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=tomasz.nowicki@linaro.org \
    --cc=tphan@apm.com \
    /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.