Linux-Tegra Archive on lore.kernel.org
 help / color / Atom feed
* acpi: fix 'return' with no value build warning
@ 2020-07-31  3:39 Neal Liu
  2020-07-31  3:39 ` [PATCH] " Neal Liu
  0 siblings, 1 reply; 4+ messages in thread
From: Neal Liu @ 2020-07-31  3:39 UTC (permalink / raw)
  To: Rafael J. Wysocki, Len Brown, Daniel Lezcano, Thierry Reding,
	Jonathan Hunter, Jacob Pan, Matthias Brugger, Sami Tolvanen
  Cc: Neal Liu, linux-acpi, linux-pm, linux-tegra, linux-arm-kernel,
	linux-mediatek, lkml, wsd_upstream

*** BLURB HERE ***

Neal Liu (1):
  acpi: fix 'return' with no value build warning

 drivers/acpi/processor_idle.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

-- 
2.18.0

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] acpi: fix 'return' with no value build warning
  2020-07-31  3:39 acpi: fix 'return' with no value build warning Neal Liu
@ 2020-07-31  3:39 ` Neal Liu
  2020-07-31 11:33   ` Rafael J. Wysocki
  0 siblings, 1 reply; 4+ messages in thread
From: Neal Liu @ 2020-07-31  3:39 UTC (permalink / raw)
  To: Rafael J. Wysocki, Len Brown, Daniel Lezcano, Thierry Reding,
	Jonathan Hunter, Jacob Pan, Matthias Brugger, Sami Tolvanen
  Cc: Neal Liu, linux-acpi, linux-pm, linux-tegra, linux-arm-kernel,
	linux-mediatek, lkml, wsd_upstream

Fixing CFI issue which introduced by commit efe9711214e6 is
incomplete.
Add return value to fix return-type build warning.

Signed-off-by: Neal Liu <neal.liu@mediatek.com>
---
 drivers/acpi/processor_idle.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
index 6ffb6c9..6870020 100644
--- a/drivers/acpi/processor_idle.c
+++ b/drivers/acpi/processor_idle.c
@@ -664,11 +664,11 @@ static int acpi_idle_enter_s2idle(struct cpuidle_device *dev,
 		struct acpi_processor *pr = __this_cpu_read(processors);
 
 		if (unlikely(!pr))
-			return;
+			return -EFAULT;
 
 		if (pr->flags.bm_check) {
 			acpi_idle_enter_bm(pr, cx, false);
-			return;
+			return 0;
 		} else {
 			ACPI_FLUSH_CPU_CACHE();
 		}
-- 
1.7.9.5

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] acpi: fix 'return' with no value build warning
  2020-07-31  3:39 ` [PATCH] " Neal Liu
@ 2020-07-31 11:33   ` Rafael J. Wysocki
  2020-08-03  2:40     ` Neal Liu
  0 siblings, 1 reply; 4+ messages in thread
From: Rafael J. Wysocki @ 2020-07-31 11:33 UTC (permalink / raw)
  To: Neal Liu
  Cc: Rafael J. Wysocki, Len Brown, Daniel Lezcano, Thierry Reding,
	Jonathan Hunter, Jacob Pan, Matthias Brugger, Sami Tolvanen,
	ACPI Devel Maling List, Linux PM, linux-tegra, Linux ARM,
	moderated list:ARM/Mediatek SoC...,
	lkml, wsd_upstream

On Fri, Jul 31, 2020 at 5:39 AM Neal Liu <neal.liu@mediatek.com> wrote:
>
> Fixing CFI issue which introduced by commit efe9711214e6 is
> incomplete.
> Add return value to fix return-type build warning.
>
> Signed-off-by: Neal Liu <neal.liu@mediatek.com>

Applied with edited subject and changelog, but ->

> ---
>  drivers/acpi/processor_idle.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
> index 6ffb6c9..6870020 100644
> --- a/drivers/acpi/processor_idle.c
> +++ b/drivers/acpi/processor_idle.c
> @@ -664,11 +664,11 @@ static int acpi_idle_enter_s2idle(struct cpuidle_device *dev,
>                 struct acpi_processor *pr = __this_cpu_read(processors);
>
>                 if (unlikely(!pr))
> -                       return;
> +                       return -EFAULT;

-> there is no point returning an error code here, so I've made it
just return 0.

>
>                 if (pr->flags.bm_check) {
>                         acpi_idle_enter_bm(pr, cx, false);
> -                       return;
> +                       return 0;
>                 } else {
>                         ACPI_FLUSH_CPU_CACHE();
>                 }
> --

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] acpi: fix 'return' with no value build warning
  2020-07-31 11:33   ` Rafael J. Wysocki
@ 2020-08-03  2:40     ` Neal Liu
  0 siblings, 0 replies; 4+ messages in thread
From: Neal Liu @ 2020-08-03  2:40 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Neal Liu, Rafael J. Wysocki, Len Brown, Daniel Lezcano,
	Thierry Reding, Jonathan Hunter, Jacob Pan, Matthias Brugger,
	Sami Tolvanen, ACPI Devel Maling List, Linux PM, linux-tegra,
	Linux ARM, moderated list:ARM/Mediatek SoC...,
	lkml, wsd_upstream

On Fri, 2020-07-31 at 13:33 +0200, Rafael J. Wysocki wrote:
> On Fri, Jul 31, 2020 at 5:39 AM Neal Liu <neal.liu@mediatek.com> wrote:
> >
> > Fixing CFI issue which introduced by commit efe9711214e6 is
> > incomplete.
> > Add return value to fix return-type build warning.
> >
> > Signed-off-by: Neal Liu <neal.liu@mediatek.com>
> 
> Applied with edited subject and changelog, but ->
> 
> > ---
> >  drivers/acpi/processor_idle.c |    4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
> > index 6ffb6c9..6870020 100644
> > --- a/drivers/acpi/processor_idle.c
> > +++ b/drivers/acpi/processor_idle.c
> > @@ -664,11 +664,11 @@ static int acpi_idle_enter_s2idle(struct cpuidle_device *dev,
> >                 struct acpi_processor *pr = __this_cpu_read(processors);
> >
> >                 if (unlikely(!pr))
> > -                       return;
> > +                       return -EFAULT;
> 
> -> there is no point returning an error code here, so I've made it
> just return 0.

return 0 is not matched with the meaning of contexts, but it's fine for
this patch.
Thanks !

> 
> >
> >                 if (pr->flags.bm_check) {
> >                         acpi_idle_enter_bm(pr, cx, false);
> > -                       return;
> > +                       return 0;
> >                 } else {
> >                         ACPI_FLUSH_CPU_CACHE();
> >                 }
> > --


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-31  3:39 acpi: fix 'return' with no value build warning Neal Liu
2020-07-31  3:39 ` [PATCH] " Neal Liu
2020-07-31 11:33   ` Rafael J. Wysocki
2020-08-03  2:40     ` Neal Liu

Linux-Tegra Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-tegra/0 linux-tegra/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-tegra linux-tegra/ https://lore.kernel.org/linux-tegra \
		linux-tegra@vger.kernel.org
	public-inbox-index linux-tegra

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-tegra


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git