Re: [PATCH v3 3/3] gpio: xilinx: Utilize generic bitmap_get_value and _set_value
From: Syed Nayyar Waris <hidden>
Date: 2021-04-01 18:55:14
Also in:
linux-arch, linux-gpio, linux-pm, lkml
From: Syed Nayyar Waris <hidden>
Date: 2021-04-01 18:55:14
Also in:
linux-arch, linux-gpio, linux-pm, lkml
On Mon, Mar 29, 2021 at 8:54 PM Andy Shevchenko [off-list ref] wrote:
On Sat, Mar 06, 2021 at 07:36:30PM +0530, Syed Nayyar Waris wrote:quoted
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....quoted
+ 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?quoted
+ 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
Okay. I will incorporate your comments in my next submission. Thank You. Regards Syed Nayyar Waris _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel