All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johan Hovold <johan-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Octavian Purdila
	<octavian.purdila-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
	laurentiu.palcu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
	johan-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org,
	julia.lawall-L2FTfq7BK8M@public.gmane.org,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 1/2] mfd: dln2: fix _dln2_transfer return code
Date: Tue, 11 Nov 2014 13:23:51 +0100	[thread overview]
Message-ID: <20141111122351.GE29789@localhost> (raw)
In-Reply-To: <1415708457-18798-2-git-send-email-octavian.purdila-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

On Tue, Nov 11, 2014 at 02:20:56PM +0200, Octavian Purdila wrote:
> If wait_for_completion_interruptible_timeout returns a positive value
> it may be propagated as the return value of _dln2_transfer. This
> contradicts the documentation of the function and exposes unnecessary
> internals to the callers.
> 
> This patch makes sure to set the return value to 0 in that case.
> 
> Reported-by: Julia Lawall <julia.lawall-L2FTfq7BK8M@public.gmane.org>
> Signed-off-by: Octavian Purdila <octavian.purdila-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> ---
>  drivers/mfd/dln2.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mfd/dln2.c b/drivers/mfd/dln2.c
> index 9765a17..f0747a1 100644
> --- a/drivers/mfd/dln2.c
> +++ b/drivers/mfd/dln2.c
> @@ -462,7 +462,8 @@ static int _dln2_transfer(struct dln2_dev *dln2, u16 handle, u16 cmd,
>  		if (!ret)
>  			ret = -ETIMEDOUT;
>  		goto out_free_rx_slot;
> -	}
> +	} else
> +		ret = 0;

You need braces on both branches (without commenting on the fix itself).

Johan

WARNING: multiple messages have this Message-ID (diff)
From: Johan Hovold <johan@kernel.org>
To: Octavian Purdila <octavian.purdila@intel.com>
Cc: lee.jones@linaro.org, laurentiu.palcu@intel.com,
	johan@kernel.org, wsa@the-dreams.de, julia.lawall@lip6.fr,
	linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] mfd: dln2: fix _dln2_transfer return code
Date: Tue, 11 Nov 2014 13:23:51 +0100	[thread overview]
Message-ID: <20141111122351.GE29789@localhost> (raw)
In-Reply-To: <1415708457-18798-2-git-send-email-octavian.purdila@intel.com>

On Tue, Nov 11, 2014 at 02:20:56PM +0200, Octavian Purdila wrote:
> If wait_for_completion_interruptible_timeout returns a positive value
> it may be propagated as the return value of _dln2_transfer. This
> contradicts the documentation of the function and exposes unnecessary
> internals to the callers.
> 
> This patch makes sure to set the return value to 0 in that case.
> 
> Reported-by: Julia Lawall <julia.lawall@lip6.fr>
> Signed-off-by: Octavian Purdila <octavian.purdila@intel.com>
> ---
>  drivers/mfd/dln2.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mfd/dln2.c b/drivers/mfd/dln2.c
> index 9765a17..f0747a1 100644
> --- a/drivers/mfd/dln2.c
> +++ b/drivers/mfd/dln2.c
> @@ -462,7 +462,8 @@ static int _dln2_transfer(struct dln2_dev *dln2, u16 handle, u16 cmd,
>  		if (!ret)
>  			ret = -ETIMEDOUT;
>  		goto out_free_rx_slot;
> -	}
> +	} else
> +		ret = 0;

You need braces on both branches (without commenting on the fix itself).

Johan

  parent reply	other threads:[~2014-11-11 12:23 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-11 12:20 [PATCH 0/2] fixes for ib-mfd-gpio-i2c-3.19 Octavian Purdila
2014-11-11 12:20 ` Octavian Purdila
2014-11-11 12:20 ` [PATCH 1/2] mfd: dln2: fix _dln2_transfer return code Octavian Purdila
     [not found]   ` <1415708457-18798-2-git-send-email-octavian.purdila-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2014-11-11 12:23     ` Johan Hovold [this message]
2014-11-11 12:23       ` Johan Hovold
2014-11-11 16:18     ` Julia Lawall
2014-11-11 16:18       ` Julia Lawall
2014-11-11 16:32       ` Octavian Purdila
2014-11-11 12:20 ` [PATCH 2/2] i2c: dln2: simplify return flow for dln2_i2c_enable Octavian Purdila
     [not found]   ` <1415708457-18798-3-git-send-email-octavian.purdila-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2014-11-11 12:26     ` Johan Hovold
2014-11-11 12:26       ` Johan Hovold
2014-11-11 12:49       ` Octavian Purdila
2014-11-11 12:49         ` Octavian Purdila
2014-11-11 16:20         ` Julia Lawall
     [not found]           ` <alpine.DEB.2.02.1411111718460.2047-bi+AKbBUZKagILUCTcTcHdKyNwTtLsGr@public.gmane.org>
2014-11-12 10:39             ` Johan Hovold
2014-11-12 10:39               ` Johan Hovold
2014-11-13 16:23     ` Wolfram Sang
2014-11-13 16:23       ` Wolfram Sang
2014-11-17 14:56       ` Lee Jones
2014-11-17 15:12         ` Octavian Purdila
2014-11-17 15:12           ` Octavian Purdila

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=20141111122351.GE29789@localhost \
    --to=johan-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
    --cc=julia.lawall-L2FTfq7BK8M@public.gmane.org \
    --cc=laurentiu.palcu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=octavian.purdila-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=wsa-z923LK4zBo2bacvFa/9K2g@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 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.