Skip to contentSkip to conversation

iio:prox:sx9500 trivial simplification of return path in init function.

PATCH In review Jonathan Cameron 3 participants 5 messages May 2, 2015 – May 4, 2015 IIO

lore
Share & tools
lore

Jonathan Cameron

author maintainer
#0 lore raw

PATCH 1/1 iio:prox:sx9500 trivial simplification of return path in init function.

---
 drivers/iio/proximity/sx9500.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/iio/proximity/sx9500.c +1 -3
index f1e9d734b6b6..323de9510ba5 100644
@@ -860,10 +860,8 @@ static int sx9500_init_device(struct iio_dev *indio_dev)
 	}
 
 	ret = sx9500_init_compensation(indio_dev);
-	if (ret < 0)
-		return ret;
 
-	return 0;
+	return ret;
 }
 
 static void sx9500_gpio_probe(struct i2c_client *client,
Signature · 1 line
2.3.5
#1 lore raw
Quoted 6 lines · Jonathan Cameron
---
 drivers/iio/proximity/sx9500.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Not sure if changes like this need a review, but this looks good to me.

Quoted 19 lines
drivers/iio/proximity/sx9500.c +1 -3
index f1e9d734b6b6..323de9510ba5 100644
@@ -860,10 +860,8 @@ static int sx9500_init_device(struct iio_dev *indio_dev)
 	}
 
 	ret = sx9500_init_compensation(indio_dev);
-	if (ret < 0)
-		return ret;
 
-	return 0;
+	return ret;
 }
 
 static void sx9500_gpio_probe(struct i2c_client *client,
Signature · 1 line
2.3.5
#2 lore raw
In reply to Jonathan Cameron
Quoted 12 lines · Jonathan Cameron
---
 drivers/iio/proximity/sx9500.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/iio/proximity/sx9500.c +0 -0
index f1e9d734b6b6..323de9510ba5 100644

drivers/iio/proximity/sx9500.c static int sx9500_init_device(struct iio_dev *indio_dev) · line 865

Quoted 9 lines
drivers/iio/proximity/sx9500.c +1 -3
@@ -860,10 +860,8 @@ static int sx9500_init_device(struct iio_dev *indio_dev)
        }
 
        ret = sx9500_init_compensation(indio_dev);
-       if (ret < 0)
-               return ret;
 
-       return 0;
+       return ret;
 }

Or, better directly return sx9500_init_comp...

Daniel.

author maintainer
#3 lore raw
Quoted 19 lines · Daniel Baluta
Quoted 18 lines · Jonathan Cameron
---
 drivers/iio/proximity/sx9500.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/iio/proximity/sx9500.c +0 -2
index f1e9d734b6b6..323de9510ba5 100644
@@ -860,10 +860,8 @@ static int sx9500_init_device(struct iio_dev *indio_dev)
        }
 
        ret = sx9500_init_compensation(indio_dev);
-       if (ret < 0)
-               return ret;
 
Quoted 5 lines

drivers/iio/proximity/sx9500.c static int sx9500_init_device(struct iio_dev *indio_dev) · line 865

Quoted 3 lines
drivers/iio/proximity/sx9500.c +1 -1
-       return 0;
+       return ret;
 }

Or, better directly return sx9500_init_comp...

oops. Good point ;)

Quoted 7 lines

Daniel.
--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

author maintainer
#4 lore raw
Quoted 20 lines · Jonathan Cameron
Quoted 19 lines · Daniel Baluta
Quoted 18 lines · Jonathan Cameron
---
 drivers/iio/proximity/sx9500.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/iio/proximity/sx9500.c +0 -2
index f1e9d734b6b6..323de9510ba5 100644
@@ -860,10 +860,8 @@ static int sx9500_init_device(struct iio_dev *indio_dev)
        }
 
        ret = sx9500_init_compensation(indio_dev);
-       if (ret < 0)
-               return ret;
 
Quoted 6 lines
Quoted 5 lines

drivers/iio/proximity/sx9500.c static int sx9500_init_device(struct iio_dev *indio_dev) · line 865

Quoted 3 lines
drivers/iio/proximity/sx9500.c +1 -1
-       return 0;
+       return ret;
 }

Or, better directly return sx9500_init_comp...

oops. Good point ;)

Applied with the entirely obvious change that I'd missed and Vlad hadn't noticed made!

Btw Vlad, this is why even stupidly simple patches ideally get a review. Often they have the silliest mistakes in them.

Thanks All,

I'm travelling for a few days so not sure when I'll push out my local tree.

Quoted 13 lines
Quoted 7 lines

Daniel.
--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html