public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
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 v3 2/5] toshiba_acpi: Remove "*not supported" feature prints
Date: Wed, 5 Aug 2015 02:38:00 -0700	[thread overview]
Message-ID: <20150805093800.GA12131@vmdeb7> (raw)
In-Reply-To: <1438401496-27744-3-git-send-email-coproscefalo@gmail.com>

On Fri, Jul 31, 2015 at 09:58:13PM -0600, Azael Avalos wrote:
> Currently the driver prints "*not supported" if any of the features
> queried are in fact not supported, let us print the available
> features instead.
> 
> This patch removes all instances pr_info printing "*not supported",
> and add a new function called "print_supported_features", which will
> print the available laptop features.
> 
> Signed-off-by: Azael Avalos <coproscefalo@gmail.com>
> ---
>  drivers/platform/x86/toshiba_acpi.c | 72 +++++++++++++++++++++++--------------
>  1 file changed, 46 insertions(+), 26 deletions(-)
> 
> diff --git a/drivers/platform/x86/toshiba_acpi.c b/drivers/platform/x86/toshiba_acpi.c
> index d983dc4..66b596a 100644
> --- a/drivers/platform/x86/toshiba_acpi.c
> +++ b/drivers/platform/x86/toshiba_acpi.c
> @@ -459,7 +459,7 @@ static void toshiba_illumination_available(struct toshiba_acpi_dev *dev)
>  	if (ACPI_FAILURE(status))
>  		pr_err("ACPI call to query Illumination support failed\n");
>  	else if (out[0] == TOS_NOT_SUPPORTED)
> -		pr_info("Illumination device not available\n");
> +		return;
>  	else if (out[0] == TOS_SUCCESS)
>  		dev->illumination_supported = 1;
>  }
> @@ -483,7 +483,6 @@ static void toshiba_illumination_set(struct led_classdev *cdev,
>  		pr_err("ACPI call for illumination failed\n");
>  		return;
>  	} else if (result == TOS_NOT_SUPPORTED) {
> -		pr_info("Illumination not supported\n");
>  		return;
>  	}

I mentioned this in the previous review. For several of these, we have an if
statement that checks for a condition, and then returns, which is exactly what
would happen if we didn't have the if statement at all.

If the context is important, a comment should be sufficient. Is there a
compelling reason to add the redundant check?

-- 
Darren Hart
Intel Open Source Technology Center

  reply	other threads:[~2015-08-05 20:17 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-01  3:58 [PATCH v3 0/5] toshiba_acpi: Refactor *{get, set} and *available functions Azael Avalos
2015-08-01  3:58 ` [PATCH v3 1/5] toshiba_acpi: Change *available functions return type Azael Avalos
2015-08-01  3:58 ` [PATCH v3 2/5] toshiba_acpi: Remove "*not supported" feature prints Azael Avalos
2015-08-05  9:38   ` Darren Hart [this message]
2015-08-05 22:15     ` Azael Avalos
2015-08-05 22:22       ` Darren Hart
2015-08-01  3:58 ` [PATCH v3 3/5] toshiba_acpi: Refactor *{get, set} functions return value Azael Avalos
2015-08-01  3:58 ` [PATCH v3 4/5] toshiba_acpi: Remove unnecessary checks and returns in HCI/SCI functions Azael Avalos
2015-08-05 20:21   ` Darren Hart
2015-08-05 22:23     ` Azael Avalos
2015-08-05 23:21       ` Darren Hart
2015-08-06 16:21         ` Azael Avalos
2015-08-05 23:36           ` Darren Hart
2015-08-01  3:58 ` [PATCH v3 5/5] toshiba_acpi: Bump driver version to 0.23 Azael Avalos

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=20150805093800.GA12131@vmdeb7 \
    --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