lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 6 Jul 2010 17:29:52 -0700
From:	Dmitry Torokhov <dmitry.torokhov@...il.com>
To:	Axel Lin <axel.lin@...il.com>
Cc:	linux-kernel <linux-kernel@...r.kernel.org>,
	Harald Welte <laforge@...monks.org>,
	Matthew Garrett <mjg@...hat.com>,
	Richard Purdie <rpurdie@...ux.intel.com>,
	Márton Németh <nm127@...email.hu>,
	Jiri Kosina <jkosina@...e.cz>,
	platform-driver-x86@...r.kernel.org
Subject: Re: [PATCH v2] panasonic-laptop: fix acpi_pcc_write_sset return value

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@...il.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,
>  				      &params, 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@...l.ru>

Thanks.

-- 
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ