[PATCH v2 1/2] ARM: mxc: Introduce imx_add_gpio_leds
Uwe Kleine-König
u.kleine-koenig at pengutronix.de
Tue Apr 5 04:46:41 EDT 2011
On Tue, Apr 05, 2011 at 09:43:48AM +0100, Russell King - ARM Linux wrote:
> On Tue, Apr 05, 2011 at 10:32:59AM +0200, Uwe Kleine-König wrote:
> > On Tue, Apr 05, 2011 at 08:59:32AM +0100, Russell King - ARM Linux wrote:
> > > On Tue, Apr 05, 2011 at 09:51:18AM +0200, Uwe Kleine-König wrote:
> > > > This was intended by
> > > >
> > > > struct gpio_led_platform_data *_pdata = *pdata;
> > > >
> > > > I'm just fighting with the compiler at this line because it doesn't like
> > > > _pdata being initialized by a const pointer.
> > >
> > > That's idiotic and revolting. Casting away const means you're writing
> > > broken code, which can fail for XIP users. If you're going to play
> > > such games, there's *NO* point in marking it const in the first place.
> > No I won the fight with the compiler, the result is
> >
> > struct gpio_led_platform_data _pdata = *pdata
> >
> > which AFAIK is valid C and even works for XIP users.
>
> Which will work, but that's not what you wrote in the first two posts
> of the code.
Yeah, this was completely untested and apart from the const issue didn't
even matched the correct types.
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
More information about the linux-arm-kernel
mailing list