Re: [PATCH v2 1/1] mfd: intel_quark_i2c_gpio: Don't play dirty trick with const

From: Lee Jones
Date: Fri Mar 26 2021 - 10:52:34 EST


On Fri, 26 Mar 2021, Andy Shevchenko wrote:

> As Linus rightfully noticed, the driver plays dirty trick with const,
> i.e. it assigns a place holder data structure to the const field
> in the MFD cell and then drops the const by explicit casting. This is
> not how it should be.
>
> Assign local pointers of the cell and resource to the respective
> non-const place holders in the intel_quark_i2c_setup() and
> intel_quark_gpio_setup().
>
> Reported-by: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
> ---
> v2: eliminated bar parameter (Lee)
> drivers/mfd/intel_quark_i2c_gpio.c | 26 ++++++++++++--------------
> 1 file changed, 12 insertions(+), 14 deletions(-)

Neat.

Applied, thanks.

--
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog