2014-06-28 15:13:26

by Guillaume Morin

[permalink] [raw]
Subject: [PATCH v3 1/1] staging: iio: ad9850.c: code cleanup

checkpath.pl was complaining about value_mask:
ERROR: Macros with complex values should be enclosed in parenthesis

I fixed this by simply removing it since it's not used (as well as another macro).
Got rid of the un-necessary error_ret label as well. Both changes were suggested
by Michael Welling.

Signed-off-by: Guillaume Morin <[email protected]>
---
Changes since v2:
- Got rid of the macro altogether since it's unused
- removed unused addr_shit
- remove error_ret since it's not needed

drivers/staging/iio/frequency/ad9850.c | 6 ------
1 file changed, 6 deletions(-)

diff --git a/drivers/staging/iio/frequency/ad9850.c b/drivers/staging/iio/frequency/ad9850.c
index af877ff..8727933 100644
--- a/drivers/staging/iio/frequency/ad9850.c
+++ b/drivers/staging/iio/frequency/ad9850.c
@@ -21,9 +21,6 @@

#define DRV_NAME "ad9850"

-#define value_mask (u16)0xf000
-#define addr_shift 12
-
/* Register format: 4 bits addr + 12 bits value */
struct ad9850_config {
u8 control[5];
@@ -50,9 +47,6 @@ static ssize_t ad9850_set_parameter(struct device *dev,
mutex_lock(&st->lock);

ret = spi_sync_transfer(st->sdev, &xfer, 1);
- if (ret)
- goto error_ret;
-error_ret:
mutex_unlock(&st->lock);

return ret ? ret : len;
--
1.7.10.4


2014-06-28 15:30:43

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH v3 1/1] staging: iio: ad9850.c: code cleanup

On Sat, Jun 28, 2014 at 05:13:19PM +0200, Guillaume Morin wrote:
> checkpath.pl was complaining about value_mask:
> ERROR: Macros with complex values should be enclosed in parenthesis
>
> I fixed this by simply removing it since it's not used (as well as another macro).
> Got rid of the un-necessary error_ret label as well. Both changes were suggested
> by Michael Welling.

Very good. But (you knew there was a but, right?)

When giving credit to someone else like this, you can just do it with a
simple:

Reported-by: Michael Welling <[email protected]>

in the signed-off-by area, no need to write a sentance about it.

Care to try a 4th time here?

thanks,

greg k-h