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

2021-03-26 Thread Lee Jones
On Thu, 25 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. > > Replace cell

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

2021-03-25 Thread Andy Shevchenko
On Thu, Mar 25, 2021 at 9:31 PM Linus Torvalds wrote: > > On Thu, Mar 25, 2021 at 12:23 PM Andy Shevchenko > wrote: > > > > Replace cell parameter by bar and assign local pointer res to the > > respective non-const place holder in the intel_quark_i2c_setup() > > and intel_quark_gpio_setup(). > >

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

2021-03-25 Thread Linus Torvalds
On Thu, Mar 25, 2021 at 12:23 PM Andy Shevchenko wrote: > > Replace cell parameter by bar and assign local pointer res to the > respective non-const place holder in the intel_quark_i2c_setup() > and intel_quark_gpio_setup(). Thanks. I assume/hope this got tested on hardware too? It looks

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

2021-03-25 Thread Andy Shevchenko
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. Replace cell parameter by bar and assign local pointer res to the