Re: [PATCH -mm][MIPS] GPIO LED driver for the WGT634U machine

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 15 Aug 2007, Geert Uytterhoeven wrote:
> On Wed, 15 Aug 2007, Aurelien Jarno wrote:
> > --- a/arch/mips/bcm947xx/wgt634u.c
> > +++ b/arch/mips/bcm947xx/wgt634u.c
> 
> > +static const struct gpio_led wgt634u_leds[] = {
> 
> > +static const struct gpio_led_platform_data wgt634u_led_data = {
> > +	.num_leds =     ARRAY_SIZE(wgt634u_leds),
> > +	.leds =         (void *) wgt634u_leds,
>                         ^^^^^^^^
> 
> gpio_led_platform_data.leds is of type struct gpio_led *.
> Should it be const, or should the const be dropped from wgt634u_leds?
> 
> > +static struct platform_device wgt634u_gpio_leds = {
> > +	.name =         "leds-gpio",
> > +	.id =           -1,
> > +	.dev = {
> > +		.platform_data = (void *) &wgt634u_led_data,
>                                  ^^^^^^^^
> device.platform_data is a void *, so you can drop the cast.

Hmm, wgt634u_led_data is const too. But casting away constness is
usually an indicator that something is wrong.

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux