[PATCH] staging: iio: ad7150: use ternary operating to ensure 0/1 value

2019-06-14 Thread Melissa Wen
Remove idiom and use ternary operator for consistently trigger 0/1 value on variable declaration. Signed-off-by: Melissa Wen --- drivers/staging/iio/cdc/ad7150.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/iio/cdc/ad7150.c b/drivers/staging/iio/cdc

[PATCH v2 3/3] staging: iio: ad7150: clean up of comments

2019-06-14 Thread Melissa Wen
General cleaning of comments to remove useless information or improve description. Signed-off-by: Melissa Wen --- drivers/staging/iio/cdc/ad7150.c | 11 ++- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/drivers/staging/iio/cdc/ad7150.c b/drivers/staging/iio/cdc/ad7150.c

[PATCH v2 2/3] staging: iio: ad7150: simplify i2c SMBus return treatment

2019-06-14 Thread Melissa Wen
Since i2c_smbus_write_byte_data returns no-positive value, this commit making the treatment of its return value less verbose. Signed-off-by: Melissa Wen --- drivers/staging/iio/cdc/ad7150.c | 9 ++--- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/staging/iio/cdc

[PATCH v2 1/3] staging: iio: ad7150: use FIELD_GET and GENMASK

2019-06-14 Thread Melissa Wen
Use the bitfield macro FIELD_GET, and GENMASK to do the shift and mask in one go. This makes the code more readable than explicit masking followed by a shift. Signed-off-by: Melissa Wen --- drivers/staging/iio/cdc/ad7150.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git

[PATCH v2 0/3] staging: iio: ad7150: improve driver readability

2019-06-14 Thread Melissa Wen
This patchset solves readability issues in AD7150 code: use of FIELD_GET to fashion improvement, make operation more succint and remove useless comments. Changes in v2: - Remove noisy patch that reorganized registers definitions - Remove else to improve i2c return operation. Melissa Wen (3

[PATCH] staging:iio:ad7150: fix threshold mode config bit

2019-05-18 Thread Melissa Wen
and properly replaces it in the places where it is used. Fixes: 531efd6aa0991 ("staging:iio:adc:ad7150: chan_spec conv + i2c_smbus commands + drop unused poweroff timeout control.") Signed-off-by: Melissa Wen --- drivers/staging/iio/cdc/ad7150.c | 19 +++ 1 file c

Re: [PATCH 2/4] staging: iio: ad7150: use FIELD_GET and GENMASK

2019-05-07 Thread Melissa Wen
On 05/06, Ardelean, Alexandru wrote: > On Sat, 2019-05-04 at 13:43 +0300, Alexandru Ardelean wrote: > > [External] > > > > > > On Sat, May 4, 2019 at 1:25 AM Melissa Wen wrote: > > > > > > Use the bitfield macro FIELD_GET, and GENMASK to do the shi

Re: [PATCH 0/4] staging: iio: ad7150: improve driver readability

2019-05-07 Thread Melissa Wen
On 05/05, Jonathan Cameron wrote: > On Sat, 4 May 2019 14:12:22 +0300 > Alexandru Ardelean wrote: > > > On Sat, May 4, 2019 at 1:24 AM Melissa Wen wrote: > > > > > > This patchset solves readability issues in AD7150 code, such as clarify > > > registe

[PATCH 4/4] staging: iio: ad7150: clean up of comments

2019-05-03 Thread Melissa Wen
General cleaning of comments to remove useless information or improve description. Signed-off-by: Melissa Wen --- drivers/staging/iio/cdc/ad7150.c | 11 ++- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/drivers/staging/iio/cdc/ad7150.c b/drivers/staging/iio/cdc/ad7150.c

[PATCH 3/4] staging: iio: ad7150: simplify i2c SMBus return treatment

2019-05-03 Thread Melissa Wen
Since i2c_smbus_write_byte_data returns no-positive value, this commit making the treatment of its return value less verbose. Signed-off-by: Melissa Wen --- drivers/staging/iio/cdc/ad7150.c | 10 +++--- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/staging/iio/cdc

[PATCH 1/4] staging: iio: ad7150: organize registers definition

2019-05-03 Thread Melissa Wen
Use the suffix REG to make the register addresses clear and indentation to highlight field names. Signed-off-by: Melissa Wen --- drivers/staging/iio/cdc/ad7150.c | 75 1 file changed, 37 insertions(+), 38 deletions(-) diff --git a/drivers/staging/iio/cdc/ad7150

[PATCH 2/4] staging: iio: ad7150: use FIELD_GET and GENMASK

2019-05-03 Thread Melissa Wen
Use the bitfield macro FIELD_GET, and GENMASK to do the shift and mask in one go. This makes the code more readable than explicit masking followed by a shift. Signed-off-by: Melissa Wen --- drivers/staging/iio/cdc/ad7150.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git

[PATCH 0/4] staging: iio: ad7150: improve driver readability

2019-05-03 Thread Melissa Wen
This patchset solves readability issues in AD7150 code, such as clarify register and mask definition, fashion improvement of mask uses, reduce tedious operation and useless comments. Melissa Wen (4): staging: iio: ad7150: organize registers definition staging: iio: ad7150: use FIELD_GET

[PATCH] staging: iio: frequency: ad9834: Remove unnecessary parentheses

2019-04-02 Thread Melissa Wen
Remove unneeded parentheses around the arguments of ||. This reduces clutter and code behave in the same way. Change suggested by checkpatch.pl. CHECK: Unnecessary parentheses around 'st->devid == ID_AD9833' CHECK: Unnecessary parentheses around 'st->devid == ID_AD9837' Signed-off-by: M