From: Darren Hart <dvhart@infradead.org>
To: Azael Avalos <coproscefalo@gmail.com>
Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] toshiba_acpi: Change error checking logic from TCI functions
Date: Sun, 28 Aug 2016 09:56:54 -0700 [thread overview]
Message-ID: <20160828165654.GB96930@f23x64.localdomain> (raw)
In-Reply-To: <20160816180617.1743-3-coproscefalo@gmail.com>
On Tue, Aug 16, 2016 at 12:06:16PM -0600, Azael Avalos wrote:
> Currently the success/error checking logic is intermixed, making the
> code a bit cumbersome to understand.
>
> This patch changes the affected functions to first check for errors
> and take appropriate actions, then check for the supported features.
>
> This patch also separates the error check from the acpi_status and
> the tci_raw function call error check, as those two are completely
> unrelated and were nested in if/else statements.
Thanks, this is a good improvement. One questions below...
>
> Signed-off-by: Azael Avalos <coproscefalo@gmail.com>
> ---
> drivers/platform/x86/toshiba_acpi.c | 222 ++++++++++++++++++++++--------------
> 1 file changed, 135 insertions(+), 87 deletions(-)
>
> diff --git a/drivers/platform/x86/toshiba_acpi.c b/drivers/platform/x86/toshiba_acpi.c
> index c6fc5cc..2256cf5 100644
> --- a/drivers/platform/x86/toshiba_acpi.c
> +++ b/drivers/platform/x86/toshiba_acpi.c
> @@ -476,10 +476,15 @@ static void toshiba_illumination_available(struct toshiba_acpi_dev *dev)
>
> status = tci_raw(dev, in, out);
> sci_close(dev);
> - if (ACPI_FAILURE(status))
> + if (ACPI_FAILURE(status)) {
> pr_err("ACPI call to query Illumination support failed\n");
> - else if (out[0] == TOS_SUCCESS)
> - dev->illumination_supported = 1;
> + return;
> + }
> +
> + if (out[0] != TOS_SUCCESS)
Does this condition not merit a pr_err message? It reads like an error...
There are several similar situations below which are equally silent. Is this a
deliberate decision?
--
Darren Hart
Intel Open Source Technology Center
next prev parent reply other threads:[~2016-08-28 16:56 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-16 18:06 [PATCH 0/3] toshiba_acpi: Functions cleanup Azael Avalos
2016-08-16 18:06 ` [PATCH 1/3] toshiba_acpi: Cleanup variable declaration Azael Avalos
2016-08-28 16:49 ` Darren Hart
2016-08-29 15:33 ` Azael Avalos
2016-08-16 18:06 ` [PATCH 2/3] toshiba_acpi: Change error checking logic from TCI functions Azael Avalos
2016-08-28 16:56 ` Darren Hart [this message]
2016-08-29 15:32 ` Azael Avalos
2016-08-16 18:06 ` [PATCH 3/3] toshiba_acpi: Fix typo in *_cooling_method_set function Azael Avalos
2016-08-28 17:05 ` Darren Hart
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=20160828165654.GB96930@f23x64.localdomain \
--to=dvhart@infradead.org \
--cc=coproscefalo@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=platform-driver-x86@vger.kernel.org \
/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
all inboxes | Powered by JetHome®