linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH linux-next] ACPI: EC: Remove the unneeded result variable
@ 2022-08-25  7:27 cgel.zte
  2022-09-03 18:33 ` Rafael J. Wysocki
  0 siblings, 1 reply; 2+ messages in thread
From: cgel.zte @ 2022-08-25  7:27 UTC (permalink / raw)
  To: rafael; +Cc: lenb, linux-acpi, linux-kernel, ye xingchen, Zeal Robot

From: ye xingchen <ye.xingchen@zte.com.cn>

Return the value acpi_ec_write() directly instead of storing it in
another redundant variable.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
---
 drivers/acpi/ec.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index c95e535035a0..9b42628cf21b 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -917,14 +917,10 @@ EXPORT_SYMBOL(ec_read);
 
 int ec_write(u8 addr, u8 val)
 {
-	int err;
-
 	if (!first_ec)
 		return -ENODEV;
 
-	err = acpi_ec_write(first_ec, addr, val);
-
-	return err;
+	return acpi_ec_write(first_ec, addr, val);
 }
 EXPORT_SYMBOL(ec_write);
 
-- 
2.25.1

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

* Re: [PATCH linux-next] ACPI: EC: Remove the unneeded result variable
  2022-08-25  7:27 [PATCH linux-next] ACPI: EC: Remove the unneeded result variable cgel.zte
@ 2022-09-03 18:33 ` Rafael J. Wysocki
  0 siblings, 0 replies; 2+ messages in thread
From: Rafael J. Wysocki @ 2022-09-03 18:33 UTC (permalink / raw)
  To: cgel.zte
  Cc: Rafael J. Wysocki, Len Brown, ACPI Devel Maling List,
	Linux Kernel Mailing List, ye xingchen, Zeal Robot

On Thu, Aug 25, 2022 at 9:27 AM <cgel.zte@gmail.com> wrote:
>
> From: ye xingchen <ye.xingchen@zte.com.cn>
>
> Return the value acpi_ec_write() directly instead of storing it in
> another redundant variable.
>
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
> ---
>  drivers/acpi/ec.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
> index c95e535035a0..9b42628cf21b 100644
> --- a/drivers/acpi/ec.c
> +++ b/drivers/acpi/ec.c
> @@ -917,14 +917,10 @@ EXPORT_SYMBOL(ec_read);
>
>  int ec_write(u8 addr, u8 val)
>  {
> -       int err;
> -
>         if (!first_ec)
>                 return -ENODEV;
>
> -       err = acpi_ec_write(first_ec, addr, val);
> -
> -       return err;
> +       return acpi_ec_write(first_ec, addr, val);
>  }
>  EXPORT_SYMBOL(ec_write);
>
> --

Applied as 6.1 material with some edits in the subject and changelog.

Thanks!

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

end of thread, other threads:[~2022-09-03 18:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-25  7:27 [PATCH linux-next] ACPI: EC: Remove the unneeded result variable cgel.zte
2022-09-03 18:33 ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).