Re: [PATCH V4 0/2] Add virtual hardware module

2021-04-10 Thread Melissa Wen
On 04/07, Pekka Paalanen wrote: > On Mon, 5 Apr 2021 11:41:50 +0530 > Sumera Priyadarsini wrote: > > > This patchset adds support for emulating virtual hardware with VKMS. > > The virtual hardware mode can be enabled by using the following command > > while loading the module: > > sudo

Re: [PATCH V4 2/2] drm/vkms: Add support for virtual hardware mode

2021-04-10 Thread Melissa Wen
On 04/05, Sumera Priyadarsini wrote: > Add a virtual hardware or vblank-less mode as a module to > enable VKMS to emulate virtual graphic drivers. > > Add a new drm_crtc_helper_funcs struct, > vkms_virtual_crtc_helper_funcs() which holds the atomic helpers > for virtual hardware mode. Change the

Re: [PATCH V4 1/2] drm/vkms: Refactor vkms_composer_worker() to prep for virtual_hw mode

2021-04-10 Thread Melissa Wen
On 04/05, Sumera Priyadarsini wrote: > Add two new functions vkms_composer_common() and vkms_crtc_composer(). > The actual plane composition work has been moved to the helper function, > vkms_composer_common() which is called by both vkms_composer_worker() > and vkms_crtc_composer().

Re: [PATCH] drm/vkms: fix misuse of WARN_ON

2021-03-25 Thread Melissa Wen
On 03/25, Dmitry Vyukov wrote: > On Wed, Mar 24, 2021 at 11:00 PM Melissa Wen wrote: > > > > On 03/20, Dmitry Vyukov wrote: > > > vkms_vblank_simulate() uses WARN_ON for timing-dependent condition > > > (timer overrun). This is a mis-use of WARN_ON, WARN_ON mu

Re: [PATCH] drm/vkms: fix misuse of WARN_ON

2021-03-24 Thread Melissa Wen
+4fc21a003c8332eb0...@syzkaller.appspotmail.com > Cc: Rodrigo Siqueira > Cc: Melissa Wen > Cc: Haneen Mohammed > Cc: Daniel Vetter > Cc: David Airlie > Cc: dri-de...@lists.freedesktop.org > Cc: linux-kernel@vger.kernel.org > Change-Id: I7f01c288092bc7e472ec63af198f93ce3d8c49f7

Re: [PATCH][next] drm/vkms: Fix missing kmalloc allocation failure check

2021-01-15 Thread Melissa Wen
gt; > Fix this by adding the missing null check. > > > > Addresses-Coverity: ("Dereference null return value") > > Fixes: 2df7af93fdad ("drm/vkms: Add vkms_config type") > > Signed-off-by: Colin Ian King > > Good catch, thank you! > > Reviewe

Re: [PATCH V5 0/3] Decouple config data for configfs

2021-01-12 Thread Melissa Wen
On 01/12, Sumera Priyadarsini wrote: > This patchset aims to lay down some prep work before configfs can be > implemented for the vkms driver. The first patch in the series adds a > new type vkms_config to track device configuration. The second and third > patch add module testing support for

Re: [PATCH V5 3/3] drm/vkms: Add information about module options

2021-01-12 Thread Melissa Wen
Hi Sumera, Thanks for documenting. You forgot to bring Daniel's ack; however, as I also reviewed and lgtm, Reviewed-by: Melissa Wen > To disable the driver, use :: > >sudo modprobe -r vkms > -- > 2.25.1 >

Re: [PATCH V5 2/3] drm/vkms: Add support for writeback module

2021-01-12 Thread Melissa Wen
init writeback connector\n"); > + if (vkmsdev->config->writeback) { > + writeback = vkms_enable_writeback_connector(vkmsdev); > + if (writeback) > + DRM_ERROR("Failed to init writeback connector\n"); > + } Thanks, Reviewed-by: Melissa Wen > > drm_mode_config_reset(dev); > > -- > 2.25.1 >

Re: [PATCH V5 1/3] drm/vkms: Add vkms_config type

2021-01-12 Thread Melissa Wen
_device { > struct drm_device drm; > struct platform_device *platform; > struct vkms_output output; > + const struct vkms_config *config; > }; > > #define drm_crtc_to_vkms_output(target) \ > @@ -124,3 +131,4 @@ void vkms_set_composer(struct vkms_

Re: [PATCH V3] drm/vkms: Decouple config data for configfs

2021-01-06 Thread Melissa Wen
On 01/05, Sumera Priyadarsini wrote: > Currently, data for the device instance is held by vkms_device. > Add a separate type, vkms_config to contain configuration details > for the device and various modes to be later used by configfs. > This config data stays constant once the device is created.

Re: [PATCH V2] drm/vkms: Decouple config data for configfs

2021-01-02 Thread Melissa Wen
Hi Sumera, Thanks for your patch. Please see some comments below. On 01/02, Sumera Priyadarsini wrote: > Currently, data for the device instance is held by vkms_device. > Add a separate type, vkms_config to contain configuration details > for the device and various modes to be later used by

Re: [PATCH v3] drm/vkms: Add setup and testing information

2020-12-10 Thread Melissa Wen
On 12/09, Daniel Vetter wrote: > On Thu, Dec 10, 2020 at 12:34:53AM +0530, Sumera Priyadarsini wrote: > > Update the vkms documentation to contain steps to: > > > > - setup the vkms driver > > - run tests using igt > > > > Signed-off-by: Sumera Priyadarsini > > ___ > > Changes in v2: > > -

Re: [PATCH V2] drm/vkms: Add setup and testing information

2020-12-09 Thread Melissa Wen
On 12/09, Daniel Vetter wrote: > On Wed, Dec 9, 2020 at 12:33 PM Sumera Priyadarsini > wrote: > > > > On Wed, Dec 9, 2020 at 6:24 AM Daniel Vetter wrote: > > > > > > On Wed, Dec 09, 2020 at 02:07:35AM +0530, Sumera Priyadarsini wrote: > > > > Update the vkms documentation to contain steps to: >

Re: [PATCH] drm/vkms: Add setup and testing information

2020-12-04 Thread Melissa Wen
Hi Sumera, Thanks for the doc improvements. Please see some complimentary comments below. On 12/03, Daniel Vetter wrote: > On Thu, Dec 3, 2020 at 8:13 PM Sumera Priyadarsini > wrote: > > > > Update the vkms documentation to contain steps to: > > > > - setup the vkms driver > > - run tests

Re: [PATCH v6 1/3] drm/vkms: Decouple crc operations from composer

2020-09-04 Thread Melissa Wen
tch is preparation work for making vkms able to support new > features. > > Tested-by: Melissa Wen > Signed-off-by: Rodrigo Siqueira > --- > drivers/gpu/drm/vkms/vkms_composer.c | 49 > 1 file changed, 29 insertions(+), 20 deletions(-)

Re: [PATCH v6 2/3] drm/vkms: Compute CRC without change input data

2020-09-04 Thread Melissa Wen
-sizeof(u32)); > + > + for (y = y_src; y < y_src + h_src; ++y) { > + for (x = x_src; x < x_src + w_src; ++x) { > + pixel = get_pixel_from_buffer(x, y, vaddr, composer); > + crc = crc32_le(crc, (void *), sizeof(u32)); > } > } > > -- > 2.28.0 > Please, update the commit msg. The code improvement look good to me. So: Reviewed-by: Melissa Wen

[PATCH] MAINTAINERS: add entry for VKMS

2020-09-04 Thread Melissa Wen
Add myself as maintainer of VKMS driver Signed-off-by: Melissa Wen --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 01fb9ee6b951..d4277824a01c 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -5640,6 +5640,7 @@ F:drivers/gpu/drm/udl

Re: [PATCH] drm/vkms: fix warning in vkms_get_vblank_timestamp

2020-08-26 Thread Melissa Wen
triggers this warning and why this approach is reasonable, as VKMS has fake clocks. > > Cc: Daniel Vetter > Cc: Rodrigo Siqueira > Cc: Haneen Mohammed > Cc: Melissa Wen > > Signed-off-by: Sidong Yang > --- > drivers/gpu/drm/vkms/vkms_crtc.c | 5 + > 1 file cha

Re: [PATCH v5 1/3] drm/vkms: Decouple crc operations from composer

2020-08-25 Thread Melissa Wen
imary_composer, cursor_composer); > + if (ret) { > + if (ret == -EINVAL) > + kfree(vaddr_out); > + return; > + } > + > + crc32 = compute_crc(vaddr_out, primary_composer); > > /* > * The worker can fall behind the vblank hrtimer, make sure we catch > up. > */ > while (frame_start <= frame_end) > drm_crtc_add_crc_entry(crtc, true, frame_start++, ); > + > + kfree(vaddr_out); > } > > static const char * const pipe_crc_sources[] = {"auto"}; > -- > 2.28.0 > Tested-by: Melissa Wen

Re: [PATCH v5 3/3] drm/vkms: Add support for writeback

2020-08-25 Thread Melissa Wen
On Tue, Aug 25, 2020 at 12:45 PM Melissa Wen wrote: > > On 08/24, Rodrigo Siqueira wrote: > > This patch implements the necessary functions to add writeback support > > for vkms. This feature is useful for testing compositors if you don't > > have hardware with writeback

Re: [PATCH v5 0/3] drm/vkms: Introduces writeback support

2020-08-25 Thread Melissa Wen
, that I pointed out inline. Please, check it. - kms_flip and kms_pipe_crc_basic works as expected (was not affected). Best regards, Melissa Wen On 08/24, Rodrigo Siqueira wrote: > This is the V5 version of a series that introduces the writeback support > to VKMS. The first two p

Re: [PATCH v5 3/3] drm/vkms: Add support for writeback

2020-08-25 Thread Melissa Wen
On 08/24, Rodrigo Siqueira wrote: > This patch implements the necessary functions to add writeback support > for vkms. This feature is useful for testing compositors if you don't > have hardware with writeback support. > > Change in V4 (Emil and Melissa): > - Move signal completion above

Re: [PATCH v5 2/3] drm/vkms: Compute CRC without change input data

2020-08-25 Thread Melissa Wen
On 08/24, Rodrigo Siqueira wrote: > The compute_crc() function is responsible for calculating the > framebuffer CRC value; due to the XRGB format, this function has to > ignore the alpha channel during the CRC computation. Therefore, > compute_crc() set zero to the alpha channel directly in the

Re: [PATCH] drm/vkms: add alpha-premultiplied color blending

2020-08-25 Thread Melissa Wen
Hi Rodrigo, Thanks for the review! I just sent a v2 applying your suggestions. Best Regards, Melissa Wen Melissa Wen On Tue, Aug 25, 2020 at 12:04 AM Rodrigo Siqueira wrote: > > Hi Melissa, > > First of all, thanks a lot for your patch! > > Follows my inline comments. >

[PATCH v2] drm/vkms: add alpha-premultiplied color blending

2020-08-25 Thread Melissa Wen
functions - const for the read-only variable argb_src - replaces variable names - drops unnecessary comment -- Cc: Daniel Vetter Cc: Rodrigo Siqueira Cc: Haneen Mohammed Signed-off-by: Melissa Wen --- drivers/gpu/drm/vkms/vkms_composer.c | 55 1 file changed, 39

[PATCH] drm/vkms: add alpha-premultiplied color blending

2020-08-19 Thread Melissa Wen
this patch considers premultiplied alpha colors to compose vaddr_src with vaddr_dst. This change removes the following cursor-alpha-transparent warning: Suspicious CRC: All values are 0. Cc: Daniel Vetter Cc: Rodrigo Siqueira Cc: Haneen Mohammed Signed-off-by: Melissa Wen --- drivers/gpu/drm

[PATCH v3] drm/vkms: guarantee vblank when capturing crc

2020-08-08 Thread Melissa Wen
uses refcount to ensure that vblanks happen when enabling composer and while crc capture is needed. Cc: Rodrigo Siqueira Cc: Haneen Mohammed Co-debugged-by: Sidong Yang Signed-off-by: Sidong Yang Signed-off-by: Melissa Wen Reviewed-by: Daniel Vetter --- v2: - extract a vkms_set_composer

Re: [PATCH] drm/vkms: guarantee vblank when capturing crc

2020-08-06 Thread Melissa Wen
On 08/04, dan...@ffwll.ch wrote: > On Sat, Aug 01, 2020 at 03:49:29PM -0300, Melissa Wen wrote: > > VKMS needs vblank interrupts enabled to capture CRC. When vblank is > > disabled, tests like kms_cursor_crc and kms_pipe_crc_basic getting stuck > > waiting for a capture that

[PATCH v2] drm/vkms: guarantee vblank when capturing crc

2020-08-06 Thread Melissa Wen
refcount to ensure that vblanks happen when enabling composer and while crc capture is needed. Cc: Rodrigo Siqueira Cc: Haneen Mohammed Co-developed-by: Sidong Yang Signed-off-by: Sidong Yang Co-developed-by: Daniel Vetter Signed-off-by: Daniel Vetter Signed-off-by: Melissa Wen --- drivers

Re: [PATCH] drm/vkms: modify sequence disable/plane/enable in commit_tail

2020-08-01 Thread Melissa Wen
On Wed, Jul 29, 2020 at 12:22 PM Sidong Yang wrote: > > This patch modifies function call sequence in commit tail. This is for > the problem that raised when kms_cursor_crc test is tested repeatedly. > In second test, there is an bug that crtc commit doesn't start vblank events. > Because there

[PATCH] drm/vkms: guarantee vblank when capturing crc

2020-08-01 Thread Melissa Wen
-by: Daniel Vetter Signed-off-by: Daniel Vetter Signed-off-by: Melissa Wen --- drivers/gpu/drm/vkms/vkms_composer.c | 8 1 file changed, 8 insertions(+) diff --git a/drivers/gpu/drm/vkms/vkms_composer.c b/drivers/gpu/drm/vkms/vkms_composer.c index 4af2f19480f4..1161eaa383f1 100644

Re: [PATCH] drm/vkms: add missing drm_crtc_vblank_put to the get/put pair on flush

2020-07-31 Thread Melissa Wen
On 07/31, Sidong Yang wrote: > On Fri, Jul 31, 2020 at 11:08:34AM +0200, dan...@ffwll.ch wrote: > > On Thu, Jul 30, 2020 at 07:09:25AM -0300, Melissa Wen wrote: > > > On 07/29, Daniel Vetter wrote: > > > > On Wed, Jul 29, 2020 at 9:09 PM Melissa Wen > > > &

[PATCH] drm/vkms: fix xrgb on compute crc

2020-07-30 Thread Melissa Wen
The previous memset operation was not correctly zeroing the alpha channel to compute the crc, and as a result, the IGT subtest kms_cursor_crc/pipe-A-cursor-alpha-transparent fails. Fixes: db7f419c06d7c ("drm/vkms: Compute CRC with Cursor Plane") Signed-off-by: Melissa Wen --- drive

Re: [PATCH] drm/vkms: add missing drm_crtc_vblank_put to the get/put pair on flush

2020-07-30 Thread Melissa Wen
On 07/29, Daniel Vetter wrote: > On Wed, Jul 29, 2020 at 9:09 PM Melissa Wen wrote: > > > > Melissa Wen > > > > On Sat, Jul 25, 2020 at 3:12 PM Daniel Vetter wrote: > > > > > > On Sat, Jul 25, 2020 at 7:45 PM Melissa Wen wrote: > > > >

Re: [PATCH] drm/vkms: add missing drm_crtc_vblank_put to the get/put pair on flush

2020-07-29 Thread Melissa Wen
Melissa Wen On Sat, Jul 25, 2020 at 3:12 PM Daniel Vetter wrote: > > On Sat, Jul 25, 2020 at 7:45 PM Melissa Wen wrote: > > > > On 07/25, Daniel Vetter wrote: > > > On Sat, Jul 25, 2020 at 5:12 AM Sidong Yang wrote: > > > > > > > > On Wed, Ju

Re: [PATCH] drm/vkms: add missing drm_crtc_vblank_put to the get/put pair on flush

2020-07-25 Thread Melissa Wen
On Sat, Jul 25, 2020 at 4:19 PM Melissa Wen wrote: > > > No, this very first warning continues (only once) :( > > From here (drm_crtc_vblank_on): > > if (atomic_read(>refcount) != 0 || drm_vblank_offdelay == 0) > > drm_WARN_ON(dev, drm_vblank

Re: [PATCH] drm/vkms: add missing drm_crtc_vblank_put to the get/put pair on flush

2020-07-25 Thread Melissa Wen
> No, this very first warning continues (only once) :( > From here (drm_crtc_vblank_on): > if (atomic_read(>refcount) != 0 || drm_vblank_offdelay == 0) > drm_WARN_ON(dev, drm_vblank_enable(dev, pipe)); Sorry, not sure when this warning is triggered. > > > But I'm still

Re: [PATCH] drm/vkms: add missing drm_crtc_vblank_put to the get/put pair on flush

2020-07-25 Thread Melissa Wen
On 07/25, Daniel Vetter wrote: > On Sat, Jul 25, 2020 at 7:45 PM Melissa Wen wrote: > > > > On 07/25, Daniel Vetter wrote: > > > On Sat, Jul 25, 2020 at 5:12 AM Sidong Yang wrote: > > > > > > > > On Wed, Jul 22, 2020 at 05:17:05PM +0200, Daniel V

Re: [PATCH] drm/vkms: add missing drm_crtc_vblank_put to the get/put pair on flush

2020-07-25 Thread Melissa Wen
On 07/25, Daniel Vetter wrote: > On Sat, Jul 25, 2020 at 5:12 AM Sidong Yang wrote: > > > > On Wed, Jul 22, 2020 at 05:17:05PM +0200, Daniel Vetter wrote: > > > On Wed, Jul 22, 2020 at 4:06 PM Melissa Wen wrote: > > > > > > > > On 07/22, dan..

Re: [PATCH] drm/vkms: add missing drm_crtc_vblank_put to the get/put pair on flush

2020-07-22 Thread Melissa Wen
On 07/22, dan...@ffwll.ch wrote: > On Wed, Jul 22, 2020 at 08:04:11AM -0300, Melissa Wen wrote: > > This patch adds a missing drm_crtc_vblank_put op to the pair > > drm_crtc_vblank_get/put (inc/decrement counter to guarantee vblanks). > > > > It clears the

[PATCH] drm/vkms: add missing drm_crtc_vblank_put to the get/put pair on flush

2020-07-22 Thread Melissa Wen
the flush steps: it increases counter to hold a vblank reference (get), but there isn't a op to decreased it and release vblanks (put). Cc: Daniel Vetter Cc: Rodrigo Siqueira Cc: Haneen Mohammed Signed-off-by: Melissa Wen --- drivers/gpu/drm/vkms/vkms_crtc.c | 1 + 1 file changed, 1 insertion

Re: [PATCH] drm/vkms: add wait_for_vblanks in atomic_commit_tail

2020-07-21 Thread Melissa Wen
Hi all, I traced the subtests' execution to figure out what happens (or not) in a clean run and a blocked run, and this led me to suspect the vkms_crtc_atomic_flush function. Examining the code and considering the DRM doc, it seemed to me that a drm_crtc_vblank_get call was missing a

Re: [PATCH] drm/vkms: add wait_for_vblanks in atomic_commit_tail

2020-07-15 Thread Melissa Wen
On 07/15, Sidong Yang wrote: > On Wed, Jul 15, 2020 at 10:17:56AM +0200, Daniel Vetter wrote: > > On Tue, Jul 14, 2020 at 9:01 PM Melissa Wen wrote: > > > > > > On 07/14, Daniel Vetter wrote: > > > > On Tue, Jul 14, 2020 at 07:39:42AM -0300, Melissa Wen wro

Re: [PATCH] drm/vkms: add wait_for_vblanks in atomic_commit_tail

2020-07-14 Thread Melissa Wen
On 07/14, Daniel Vetter wrote: > On Tue, Jul 14, 2020 at 07:39:42AM -0300, Melissa Wen wrote: > > On Tue, Jul 14, 2020 at 7:20 AM Melissa Wen wrote: > > > > > > On 07/13, Daniel Vetter wrote: > > > > On Fri, Jul 10, 2020 at 02:05:33PM -0300, Melissa Wen w

Re: [PATCH] drm/vkms: add wait_for_vblanks in atomic_commit_tail

2020-07-14 Thread Melissa Wen
On Tue, Jul 14, 2020 at 7:20 AM Melissa Wen wrote: > > On 07/13, Daniel Vetter wrote: > > On Fri, Jul 10, 2020 at 02:05:33PM -0300, Melissa Wen wrote: > > > On 07/02, Daniel Vetter wrote: > > > > On Wed, Jul 01, 2020 at 03:31:34PM +, Sidong Yang wrote: >

Re: [PATCH] drm/vkms: add wait_for_vblanks in atomic_commit_tail

2020-07-14 Thread Melissa Wen
On 07/13, Daniel Vetter wrote: > On Fri, Jul 10, 2020 at 02:05:33PM -0300, Melissa Wen wrote: > > On 07/02, Daniel Vetter wrote: > > > On Wed, Jul 01, 2020 at 03:31:34PM +, Sidong Yang wrote: > > > > there is an error when igt test is run continuously. &

Re: [PATCH] drm/vkms: add wait_for_vblanks in atomic_commit_tail

2020-07-10 Thread Melissa Wen
On 07/02, Daniel Vetter wrote: > On Wed, Jul 01, 2020 at 03:31:34PM +, Sidong Yang wrote: > > there is an error when igt test is run continuously. > > vkms_atomic_commit_tail() > > need to call drm_atomic_helper_wait_for_vblanks() for give up ownership of > > vblank events. without this code,

[PATCH] drm/vkms: change the max cursor width/height

2020-07-10 Thread Melissa Wen
This change expands the coverage for the IGT kms_cursor_crc test, where the size varies between 64 and 512 for a square cursor. With this, in addition to the cursor 64x64, this patch enables the test of cursors with sizes: 128x128, 256x256, and 512x512. Signed-off-by: Melissa Wen --- drivers

[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 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 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 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