]> git.baikalelectronics.ru Git - kernel.git/commit
media: rkisp1: Swap value and address arguments to rkisp1_write()
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Thu, 3 Mar 2022 15:35:10 +0000 (15:35 +0000)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Mon, 27 Jun 2022 07:32:06 +0000 (08:32 +0100)
commit3cf702e83b41877cff88bde91b482ac9790433fc
tree78caef9f52f7c849f4ac40aa100bd7f3ccd335fb
parentb8166906bc42a3e8cbe99084df3519848f90bef2
media: rkisp1: Swap value and address arguments to rkisp1_write()

While writel() takes the value and address arguments in that order, most
write functions (including in the regmap API) use the opposite
convention. Having the value first is considered confusing, and often
leads to more difficult to read code compared to the opposite convention
where the write call and the register name often fit on a single line:

rkisp1_write(rkisp1, RKISP1_CIF_THE_REG_NAME,
     complicate_calculation + for / the_register
     value + goes | here);

Swap the arguments of the rkisp1_write() function, and use the following
semantic patch to update the callers:

@@
expression rkisp1, value, address;
@@

- rkisp1_write(rkisp1, value, address)
+ rkisp1_write(rkisp1, address, value)

This commit also includes a few additional line break cleanups in the
rkisp1_write() calls, but no other manual change.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Dafna Hirschfeld <dafna@fastmail.com>
Reviewed-by: Ricardo Ribalda <ribalda@chromium.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c
drivers/media/platform/rockchip/rkisp1/rkisp1-common.h
drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c
drivers/media/platform/rockchip/rkisp1/rkisp1-params.c
drivers/media/platform/rockchip/rkisp1/rkisp1-resizer.c
drivers/media/platform/rockchip/rkisp1/rkisp1-stats.c