On 4 August 2011 04:42, Jean-Christophe PLAGNIOL-VILLARD <plagnioj@xxxxxxxxxxxx> wrote: > On 22:37 Wed 03 Aug , Antony Pavlov wrote: >> Signed-off-by: Antony Pavlov <antonynpavlov@xxxxxxxxx> >> --- >> drivers/serial/serial_ns16550.c | 87 ++++++++++++++++++++++++--------------- >> 1 files changed, 54 insertions(+), 33 deletions(-) >> >> + plat->reg_write(val, (unsigned long)dev->priv, off); > no it must stay void __iomem* plat->reg_write() get the second argument 'unsigned long base'. Moreover, using 'void *' in arithmetic is a poor practice. Fortunally for us, in GCC incrementing a void pointer adds one to the value (sizeof(void) == 1). Add '-pedantic' flag to gcc and compile current 'next' barebox. You will see something like this: In function ‘ns16550_read’: drivers/serial/serial_ns16550.c:72: warning: pointer of type ‘void *’ used in arithmetic >> + if (plat->reg_read == NULL) { >> + int width = dev->resource[0].flags & IORESOURCE_MEM_TYPE_MASK; >> + >> + switch (width) { >> + default: ... >> + } >> + } >> + >> + if (plat->reg_write == NULL) { >> + int width = dev->resource[0].flags & IORESOURCE_MEM_TYPE_MASK; > why do it twice? You are right. width calculation or even separate reg_write & reg_read handling can be combined. -- Best regards, Antony Pavlov _______________________________________________ barebox mailing list barebox@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/barebox