Re: [PATCH v3 3/3] gpio: xilinx: Utilize generic bitmap_get_value and _set_value

From
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Date
2021-03-29 15:25:38
Also in
linux-arch, linux-arm-kernel, linux-gpio, lkml
Reply to
Syed Nayyar Waris, 2021-03-06
On Sat, Mar 06, 2021 at 07:36:30PM +0530, Syed Nayyar Waris wrote:
This patch reimplements the xgpio_set_multiple() function in
drivers/gpio/gpio-xilinx.c to use the new generic functions:
bitmap_get_value() and bitmap_set_value(). The code is now simpler
to read and understand. Moreover, instead of looping for each bit
in xgpio_set_multiple() function, now we can check each channel at
a time and save cycles.
...
+	u32 *const state = chip->gpio_state;
Looking at this... What's the point of the const here?

Am I right that this tells: pointer is a const, while the data underneath
can be modified?
+	unsigned int *const width = chip->gpio_width;
Ditto.

Putting const:s here and there for sake of the const is not good practice.
It makes code harder to read.

-- 
With Best Regards,
Andy Shevchenko

Thread (16 messages) 16 messages, 6 authors, last reply 2021-04-02
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help