From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Axel Lin <axel.lin@gmail.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
"Harald Welte" <laforge@gnumonks.org>,
"Matthew Garrett" <mjg@redhat.com>,
"Richard Purdie" <rpurdie@linux.intel.com>,
"Márton Németh" <nm127@freemail.hu>,
"Jiri Kosina" <jkosina@suse.cz>,
platform-driver-x86@vger.kernel.org
Subject: Re: [PATCH v2] panasonic-laptop: fix acpi_pcc_write_sset return value
Date: Tue, 6 Jul 2010 17:29:52 -0700 [thread overview]
Message-ID: <20100707002952.GA7035@core.coreip.homeip.net> (raw)
In-Reply-To: <1278462108.12801.23.camel@mola>
On Wed, Jul 07, 2010 at 08:21:48AM +0800, Axel Lin wrote:
> In current implementation, acpi_pcc_write_sset return 1
> if write is successful, 0 if write is failed.
> But all the callers consider acpi_pcc_write_sset return 0
> if write is successful and return negtive if write is failed.
>
> This patch changes the implementation of acpi_pcc_write_sset to
> return 0 if write is successful, -EIO if write is failed.
>
> Signed-off-by: Axel Lin <axel.lin@gmail.com>
> ---
> drivers/platform/x86/panasonic-laptop.c | 7 ++-----
> 1 files changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/platform/x86/panasonic-laptop.c b/drivers/platform/x86/panasonic-laptop.c
> index 2fb9a32..ec01c3d 100644
> --- a/drivers/platform/x86/panasonic-laptop.c
> +++ b/drivers/platform/x86/panasonic-laptop.c
> @@ -248,7 +248,7 @@ static int acpi_pcc_write_sset(struct pcc_acpi *pcc, int func, int val)
> status = acpi_evaluate_object(pcc->handle, METHOD_HKEY_SSET,
> ¶ms, NULL);
>
> - return status == AE_OK;
> + return (status == AE_OK) ? 0 : -EIO;
> }
>
> static inline int acpi_pcc_get_sqty(struct acpi_device *device)
> @@ -586,7 +586,6 @@ static int acpi_pcc_init_input(struct pcc_acpi *pcc)
> static int acpi_pcc_hotkey_resume(struct acpi_device *device)
> {
> struct pcc_acpi *pcc = acpi_driver_data(device);
> - acpi_status status = AE_OK;
>
> if (device == NULL || pcc == NULL)
> return -EINVAL;
Looks good, but why don't you also kill these useless checks while you
are at it? Otherwise:
Acked-by: Dmitry Torokhov <dtor@mail.ru>
Thanks.
--
Dmitry
next prev parent reply other threads:[~2010-07-07 0:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-07 0:21 [PATCH v2] panasonic-laptop: fix acpi_pcc_write_sset return value Axel Lin
2010-07-07 0:29 ` Dmitry Torokhov [this message]
2010-07-07 5:40 ` Harald Welte
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=20100707002952.GA7035@core.coreip.homeip.net \
--to=dmitry.torokhov@gmail.com \
--cc=axel.lin@gmail.com \
--cc=jkosina@suse.cz \
--cc=laforge@gnumonks.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mjg@redhat.com \
--cc=nm127@freemail.hu \
--cc=platform-driver-x86@vger.kernel.org \
--cc=rpurdie@linux.intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox