From: Wolfram Sang <wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>
To: Kiran Padwal <kiran.padwal-edOiRQu9Xnj5XLMNweQjbQ@public.gmane.org>
Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] i2c: remove unnecessary 'else' after 'return' statement
Date: Wed, 6 Aug 2014 20:55:40 +0200 [thread overview]
Message-ID: <20140806185539.GA2736@katana> (raw)
In-Reply-To: <1407308765-13869-1-git-send-email-kiran.padwal-edOiRQu9Xnj5XLMNweQjbQ@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 2795 bytes --]
On Wed, Aug 06, 2014 at 12:36:05PM +0530, Kiran Padwal wrote:
> Fix the following warning reported by checkpatch.pl:
>
> WARNING: else is not generally useful after a break or return
>
> Signed-off-by: Kiran Padwal <kiran.padwal-edOiRQu9Xnj5XLMNweQjbQ@public.gmane.org>
Technically true, yet I think the original code is a tad more readable,
so I'll keep it like it is.
> ---
> drivers/i2c/i2c-core.c | 28 ++++++++++++++--------------
> 1 file changed, 14 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
> index 632057a..228bd04 100644
> --- a/drivers/i2c/i2c-core.c
> +++ b/drivers/i2c/i2c-core.c
> @@ -351,8 +351,8 @@ static int i2c_device_pm_suspend(struct device *dev)
>
> if (pm)
> return pm_generic_suspend(dev);
> - else
> - return i2c_legacy_suspend(dev, PMSG_SUSPEND);
> +
> + return i2c_legacy_suspend(dev, PMSG_SUSPEND);
> }
>
> static int i2c_device_pm_resume(struct device *dev)
> @@ -361,8 +361,8 @@ static int i2c_device_pm_resume(struct device *dev)
>
> if (pm)
> return pm_generic_resume(dev);
> - else
> - return i2c_legacy_resume(dev);
> +
> + return i2c_legacy_resume(dev);
> }
>
> static int i2c_device_pm_freeze(struct device *dev)
> @@ -371,8 +371,8 @@ static int i2c_device_pm_freeze(struct device *dev)
>
> if (pm)
> return pm_generic_freeze(dev);
> - else
> - return i2c_legacy_suspend(dev, PMSG_FREEZE);
> +
> + return i2c_legacy_suspend(dev, PMSG_FREEZE);
> }
>
> static int i2c_device_pm_thaw(struct device *dev)
> @@ -381,8 +381,8 @@ static int i2c_device_pm_thaw(struct device *dev)
>
> if (pm)
> return pm_generic_thaw(dev);
> - else
> - return i2c_legacy_resume(dev);
> +
> + return i2c_legacy_resume(dev);
> }
>
> static int i2c_device_pm_poweroff(struct device *dev)
> @@ -391,8 +391,8 @@ static int i2c_device_pm_poweroff(struct device *dev)
>
> if (pm)
> return pm_generic_poweroff(dev);
> - else
> - return i2c_legacy_suspend(dev, PMSG_HIBERNATE);
> +
> + return i2c_legacy_suspend(dev, PMSG_HIBERNATE);
> }
>
> static int i2c_device_pm_restore(struct device *dev)
> @@ -401,8 +401,8 @@ static int i2c_device_pm_restore(struct device *dev)
>
> if (pm)
> return pm_generic_restore(dev);
> - else
> - return i2c_legacy_resume(dev);
> +
> + return i2c_legacy_resume(dev);
> }
> #else /* !CONFIG_PM_SLEEP */
> #define i2c_device_pm_suspend NULL
> @@ -622,8 +622,8 @@ static int i2c_trylock_adapter(struct i2c_adapter *adapter)
>
> if (parent)
> return i2c_trylock_adapter(parent);
> - else
> - return rt_mutex_trylock(&adapter->bus_lock);
> +
> + return rt_mutex_trylock(&adapter->bus_lock);
> }
>
> /**
> --
> 1.7.9.5
>
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
prev parent reply other threads:[~2014-08-06 18:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-06 7:06 [PATCH] i2c: remove unnecessary 'else' after 'return' statement Kiran Padwal
[not found] ` <1407308765-13869-1-git-send-email-kiran.padwal-edOiRQu9Xnj5XLMNweQjbQ@public.gmane.org>
2014-08-06 18:55 ` Wolfram Sang [this message]
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=20140806185539.GA2736@katana \
--to=wsa-z923lk4zbo2bacvfa/9k2g@public.gmane.org \
--cc=kiran.padwal-edOiRQu9Xnj5XLMNweQjbQ@public.gmane.org \
--cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.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;
as well as URLs for NNTP newsgroup(s).