All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: "Rafael J . Wysocki" <rjw@rjwysocki.net>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-pm@vger.kernel.org
Subject: Re: [PATCH v1 2/3] PM / sysfs: Remove redundant 'else' keyword.
Date: Wed, 15 Nov 2017 13:01:46 +0100	[thread overview]
Message-ID: <20171115120146.GB8336@amd> (raw)
In-Reply-To: <20171110182809.85953-2-andriy.shevchenko@linux.intel.com>

[-- Attachment #1: Type: text/plain, Size: 2044 bytes --]

On Fri 2017-11-10 20:28:08, Andy Shevchenko wrote:
> There is no need to use 'else' if in main branch 'return' is present.
> 
> No functional change intended.

Acked-by: Pavel Machek <pavel@ucw.cz>

> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/base/power/sysfs.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/base/power/sysfs.c b/drivers/base/power/sysfs.c
> index 662632ac5e0e..1bf5e163ef1f 100644
> --- a/drivers/base/power/sysfs.c
> +++ b/drivers/base/power/sysfs.c
> @@ -216,7 +216,7 @@ static ssize_t pm_qos_resume_latency_show(struct device *dev,
>  
>  	if (value == 0)
>  		return sprintf(buf, "n/a\n");
> -	else if (value == PM_QOS_RESUME_LATENCY_NO_CONSTRAINT)
> +	if (value == PM_QOS_RESUME_LATENCY_NO_CONSTRAINT)
>  		value = 0;
>  
>  	return sprintf(buf, "%d\n", value);
> @@ -261,7 +261,7 @@ static ssize_t pm_qos_latency_tolerance_show(struct device *dev,
>  
>  	if (value < 0)
>  		return sprintf(buf, "auto\n");
> -	else if (value == PM_QOS_LATENCY_ANY)
> +	if (value == PM_QOS_LATENCY_ANY)
>  		return sprintf(buf, "any\n");
>  
>  	return sprintf(buf, "%d\n", value);
> @@ -527,11 +527,11 @@ static ssize_t rtpm_children_show(struct device *dev,
>  static ssize_t rtpm_enabled_show(struct device *dev,
>  				 struct device_attribute *attr, char *buf)
>  {
> -	if ((dev->power.disable_depth) && (dev->power.runtime_auto == false))
> +	if (dev->power.disable_depth && (dev->power.runtime_auto == false))
>  		return sprintf(buf, "disabled & forbidden\n");
> -	else if (dev->power.disable_depth)
> +	if (dev->power.disable_depth)
>  		return sprintf(buf, "disabled\n");
> -	else if (dev->power.runtime_auto == false)
> +	if (dev->power.runtime_auto == false)
>  		return sprintf(buf, "forbidden\n");
>  	return sprintf(buf, "enabled\n");
>  }

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

  reply	other threads:[~2017-11-15 12:01 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-10 18:28 [PATCH v1 1/3] PM / sysfs: Convert to use sysfs_streq() Andy Shevchenko
2017-11-10 18:28 ` [PATCH v1 2/3] PM / sysfs: Remove redundant 'else' keyword Andy Shevchenko
2017-11-15 12:01   ` Pavel Machek [this message]
2017-11-10 18:28 ` [PATCH v1 3/3] PM / sysfs: Convert to use DEVICE_ATTR_RO / DEVICE_ATTR_RW Andy Shevchenko
2017-11-15 12:04   ` Pavel Machek
2017-11-15 10:32 ` [PATCH v1 1/3] PM / sysfs: Convert to use sysfs_streq() Pavel Machek
2017-11-15 11:41   ` Andy Shevchenko
2017-11-15 12:01 ` Pavel Machek
2017-12-06  1:00 ` Rafael J. Wysocki

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=20171115120146.GB8336@amd \
    --to=pavel@ucw.cz \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.