linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] i2c: octeon: remove unused signal handling
@ 2015-06-11 14:12 Nicholas Mc Guire
  2015-06-12 12:38 ` Alexander Sverdlin
  0 siblings, 1 reply; 2+ messages in thread
From: Nicholas Mc Guire @ 2015-06-11 14:12 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: linux-i2c, linux-kernel, Nicholas Mc Guire

'commit 2637e5fd232d ("i2c: octeon: Fix i2c fail problem when a process is
terminated by a signal")' removed the wait_event_interruptible_timeout to 
prevent half/mixed i2c messages from being sent/recievd but forgot to 
drop the signal handling case in the return handling. This just removes 
this dead code. While at it the return variable is adjusted to the type 
expected.

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
---

V2: Thanks to Wolfram Sang <wsa@the-dreams.de> for clarifying the intent
    (and how I should have found this by properly checking the git log).

Patch was compile tested with cavium_octeon_defconfig
(implies CONFIG_I2C_OCTEON=y)

Patch is against 4.1-rc7 (localversion-next is -next-20150611)

 drivers/i2c/busses/i2c-octeon.c |    7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/i2c/busses/i2c-octeon.c b/drivers/i2c/busses/i2c-octeon.c
index 6e75e01..32914ab 100644
--- a/drivers/i2c/busses/i2c-octeon.c
+++ b/drivers/i2c/busses/i2c-octeon.c
@@ -200,7 +200,7 @@ static int octeon_i2c_test_iflg(struct octeon_i2c *i2c)
  */
 static int octeon_i2c_wait(struct octeon_i2c *i2c)
 {
-	int result;
+	long result;
 
 	octeon_i2c_int_enable(i2c);
 
@@ -210,10 +210,7 @@ static int octeon_i2c_wait(struct octeon_i2c *i2c)
 
 	octeon_i2c_int_disable(i2c);
 
-	if (result < 0) {
-		dev_dbg(i2c->dev, "%s: wait interrupted\n", __func__);
-		return result;
-	} else if (result == 0) {
+	if (result == 0) {
 		dev_dbg(i2c->dev, "%s: timeout\n", __func__);
 		return -ETIMEDOUT;
 	}
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] i2c: octeon: remove unused signal handling
  2015-06-11 14:12 [PATCH] i2c: octeon: remove unused signal handling Nicholas Mc Guire
@ 2015-06-12 12:38 ` Alexander Sverdlin
  0 siblings, 0 replies; 2+ messages in thread
From: Alexander Sverdlin @ 2015-06-12 12:38 UTC (permalink / raw)
  To: ext Nicholas Mc Guire, Wolfram Sang; +Cc: linux-i2c, linux-kernel

Hi!

On 11/06/15 16:12, ext Nicholas Mc Guire wrote:
> 'commit 2637e5fd232d ("i2c: octeon: Fix i2c fail problem when a process is
> terminated by a signal")' removed the wait_event_interruptible_timeout to 
> prevent half/mixed i2c messages from being sent/recievd but forgot to 
> drop the signal handling case in the return handling. This just removes 
> this dead code. While at it the return variable is adjusted to the type 
> expected.
> 
> Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>

Looks good,

Reviewed-by: Alexander Sverdlin <alexander.sverdlin@nokia.com>

> ---
> 
> V2: Thanks to Wolfram Sang <wsa@the-dreams.de> for clarifying the intent
>     (and how I should have found this by properly checking the git log).
> 
> Patch was compile tested with cavium_octeon_defconfig
> (implies CONFIG_I2C_OCTEON=y)
> 
> Patch is against 4.1-rc7 (localversion-next is -next-20150611)
> 
>  drivers/i2c/busses/i2c-octeon.c |    7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-octeon.c b/drivers/i2c/busses/i2c-octeon.c
> index 6e75e01..32914ab 100644
> --- a/drivers/i2c/busses/i2c-octeon.c
> +++ b/drivers/i2c/busses/i2c-octeon.c
> @@ -200,7 +200,7 @@ static int octeon_i2c_test_iflg(struct octeon_i2c *i2c)
>   */
>  static int octeon_i2c_wait(struct octeon_i2c *i2c)
>  {
> -	int result;
> +	long result;
>  
>  	octeon_i2c_int_enable(i2c);
>  
> @@ -210,10 +210,7 @@ static int octeon_i2c_wait(struct octeon_i2c *i2c)
>  
>  	octeon_i2c_int_disable(i2c);
>  
> -	if (result < 0) {
> -		dev_dbg(i2c->dev, "%s: wait interrupted\n", __func__);
> -		return result;
> -	} else if (result == 0) {
> +	if (result == 0) {
>  		dev_dbg(i2c->dev, "%s: timeout\n", __func__);
>  		return -ETIMEDOUT;
>  	}

-- 
Best regards,
Alexander Sverdlin.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-06-12 12:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-11 14:12 [PATCH] i2c: octeon: remove unused signal handling Nicholas Mc Guire
2015-06-12 12:38 ` Alexander Sverdlin

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).