Hi Ahmad.

> > 
> > If we introduced the following small helpers we could simplify the call 
> > sites
> > to just use at91_get_ddram_size(AT91SAM9G45_BASE_DDRSDRC0) and similar.
> > 
> > static inline u32 at91_get_ddram_size(void __force __iomem * addr)
> > {
> >     return __at91_get_ddram_size(IOMEM(addr), true);
> > }
> > 
> > static inline u32 at91sam9g45_get_ddram_size(void __force __iomem * addr)
> > {
> >     return __at91_get_ddram_size(IOMEM(addr), false);
> > }
> 
> That would still require the pointer cast to pacify the -Wint-conversion.
> And (void*)ADDR looks only marginally better IOMEM(ADDR) IMO
> at the cost of having sparse miss passing memory pointers
> (__force __iomem would be equivalent to just __attribute__((noderef)), 
> wouldn't it?)
> 
> My preference would've been that AT91SAM9G45_BASE_DDRSDRC0 already expands
> to a void __iomem *.
The main idea was to get rid of the bool argument and use more explicit function
names. Moving IOMEM() was the added extra.

> We could do that in a follow-up patch.
Agreed, maybe later if we do it.
The original patch in this mail was fine.

You can add my:
Reviewed-by: Sam Ravnborg <s...@ravnborg.org>

If you respin the series.

        Sam

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

Reply via email to