2020-07-31 03:39:46

by Neal Liu

[permalink] [raw]
Subject: acpi: fix 'return' with no value build warning

*** 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


2020-07-31 03:40:39

by Neal Liu

[permalink] [raw]
Subject: [PATCH] acpi: fix 'return' with no value build warning

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

Signed-off-by: Neal Liu <[email protected]>
---
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

2020-07-31 11:34:12

by Rafael J. Wysocki

[permalink] [raw]
Subject: Re: [PATCH] acpi: fix 'return' with no value build warning

On Fri, Jul 31, 2020 at 5:39 AM Neal Liu <[email protected]> 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 <[email protected]>

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();
> }
> --

2020-08-03 02:59:16

by Neal Liu

[permalink] [raw]
Subject: Re: [PATCH] acpi: fix 'return' with no value build warning

On Fri, 2020-07-31 at 13:33 +0200, Rafael J. Wysocki wrote:
> On Fri, Jul 31, 2020 at 5:39 AM Neal Liu <[email protected]> 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 <[email protected]>
>
> 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();
> > }
> > --