[PATCH 06/13] ARM: LPC32XX: Core architecture files

Uwe Kleine-König u.kleine-koenig at pengutronix.de
Wed Feb 3 05:54:44 EST 2010


Hello 
On Thu, Jan 28, 2010 at 12:58:40PM -0500, H Hartley Sweeten wrote:
> On Wednesday, January 27, 2010 6:43 PM, wellsk40 wrote:
> > From: Kevin Wells <wellsk40 at gmail.com>
> > 
> > GPIO support functions for gpiolib, irq setup and handling, serial
> > port support, and high resolution timer support used in the LPC32XX
> > architecture.
> > 
> > Signed-off-by: Kevin Wells <wellsk40 at gmail.com>
> > ---
> 
> [snip]
> 
> > +static struct gpio_regs gpio_grp_regs[] = {
> > +	{
> > +		.inp_state	= (void __iomem *) GPIO_P0_INP_STATE(GPIOBASE),
> > +		.outp_set	= (void __iomem *) GPIO_P0_OUTP_SET(GPIOBASE),
> > +		.outp_clr	= (void __iomem *) GPIO_P0_OUTP_CLR(GPIOBASE),
> > +		.dir_set	= (void __iomem *) GPIO_P0_DIR_SET(GPIOBASE),
> > +		.dir_clr	= (void __iomem *) GPIO_P0_DIR_CLR(GPIOBASE),
> > +	},
> > +	{
> > +		.inp_state	= (void __iomem *) GPIO_P1_INP_STATE(GPIOBASE),
> > +		.outp_set	= (void __iomem *) GPIO_P1_OUTP_SET(GPIOBASE),
> > +		.outp_clr	= (void __iomem *) GPIO_P1_OUTP_CLR(GPIOBASE),
> > +		.dir_set	= (void __iomem *) GPIO_P1_DIR_SET(GPIOBASE),
> > +		.dir_clr	= (void __iomem *) GPIO_P1_DIR_CLR(GPIOBASE),
> > +	},
> > +	{
> > +		.inp_state	= (void __iomem *) GPIO_P2_INP_STATE(GPIOBASE),
> > +		.outp_set	= (void __iomem *) GPIO_P2_OUTP_SET(GPIOBASE),
> > +		.outp_clr	= (void __iomem *) GPIO_P2_OUTP_CLR(GPIOBASE),
> > +		.dir_set	= (void __iomem *) GPIO_P2_DIR_SET(GPIOBASE),
> > +		.dir_clr	= (void __iomem *) GPIO_P2_DIR_CLR(GPIOBASE),
> > +	},
> > +	{
> > +		.inp_state	= (void __iomem *) GPIO_P3_INP_STATE(GPIOBASE),
> > +		.outp_set	= (void __iomem *) GPIO_P3_OUTP_SET(GPIOBASE),
> > +		.outp_clr	= (void __iomem *) GPIO_P3_OUTP_CLR(GPIOBASE),
> > +		.dir_set	= (void __iomem *) GPIO_P2_DIR_SET(GPIOBASE),
> > +		.dir_clr	= (void __iomem *) GPIO_P2_DIR_CLR(GPIOBASE),
> > +	},
> > +};
> 
> All this casting is pretty ugly.
> 
> It appears these GPIO_P* macros are only used here.  Can the macros
> be modified to create the (void __iomem *) directly?
If GPIO_P* macros are only used here, maybe better define them in this
file?

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