All of lore.kernel.org
 help / color / mirror / Atom feed
From: Evgeniy Polyakov <zbr@ioremap.net>
To: Devendra Naga <devendra.aaru@gmail.com>
Cc: linux-kernel@vger.kernel.org, GregKH <greg@kroah.com>
Subject: Re: [PATCH] drivers/w1: cleanup w1_uevent
Date: Sat, 19 May 2012 07:31:54 +0400	[thread overview]
Message-ID: <20120519033154.GA12188@ioremap.net> (raw)
In-Reply-To: <1337330963-20485-1-git-send-email-devendra.aaru@gmail.com>

Hi

On Fri, May 18, 2012 at 02:19:23PM +0530, Devendra Naga (devendra.aaru@gmail.com) wrote:
> There were some return statements around in the w1_uevent, used goto
> to cleanup those return statements with the help of err variable,
> and also removed a semi colon at the end of the w1_uevent's closing
> brace.

I personally do not see whether this is better than what was before
So, Greg, it is up to you to decide :)

If you pull it in, then feel free to add my acked-by.
Thank you.

> Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
> ---
>  drivers/w1/w1.c |   14 ++++++--------
>  1 file changed, 6 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c
> index 9761950..a0d3c59 100644
> --- a/drivers/w1/w1.c
> +++ b/drivers/w1/w1.c
> @@ -557,7 +557,7 @@ static int w1_uevent(struct device *dev, struct kobj_uevent_env *env)
>  	struct w1_master *md = NULL;
>  	struct w1_slave *sl = NULL;
>  	char *event_owner, *name;
> -	int err;
> +	int err = 0;
>  
>  	if (dev->driver == &w1_master_driver) {
>  		md = container_of(dev, struct w1_master, dev);
> @@ -576,19 +576,17 @@ static int w1_uevent(struct device *dev, struct kobj_uevent_env *env)
>  			event_owner, name, dev_name(dev));
>  
>  	if (dev->driver != &w1_slave_driver || !sl)
> -		return 0;
> +		goto end;
>  
>  	err = add_uevent_var(env, "W1_FID=%02X", sl->reg_num.family);
>  	if (err)
> -		return err;
> +		goto end;
>  
>  	err = add_uevent_var(env, "W1_SLAVE_ID=%024LX",
>  			     (unsigned long long)sl->reg_num.id);
> -	if (err)
> -		return err;
> -
> -	return 0;
> -};
> +end:
> +	return err;
> +}
>  #else
>  static int w1_uevent(struct device *dev, struct kobj_uevent_env *env)
>  {
> -- 
> 1.7.9.5

-- 
	Evgeniy Polyakov

  reply	other threads:[~2012-05-19  3:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-18  8:49 [PATCH] drivers/w1: cleanup w1_uevent Devendra Naga
2012-05-19  3:31 ` Evgeniy Polyakov [this message]
2012-06-04 11:45   ` devendra.aaru
2012-06-04 18:05     ` Evgeniy Polyakov
2012-06-04 18:53       ` GregKH
2012-06-04 19:25         ` Evgeniy Polyakov
2012-06-04 21:43           ` devendra.aaru
2012-06-04 21:56             ` Evgeniy Polyakov

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=20120519033154.GA12188@ioremap.net \
    --to=zbr@ioremap.net \
    --cc=devendra.aaru@gmail.com \
    --cc=greg@kroah.com \
    --cc=linux-kernel@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 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.