[U-Boot] [PATCH 03/11] Blackfin: bf60x: add serial support

Wolfgang Denk
2013-02-07T10:15:10Z

Dear Sonic Zhang,

In message <1360223258-6945-4-git-send-email-sonic.adi@gmail.com> you wrote:
>
> Add serial for bf60x.

There is a large number of checkpatch issues. Please fix!!

> +/*
> + * All Blackfin system MMRs are padded to 32bits even if the register
> + * itself is only 16bits. So use a helper macro to streamline this.
> + */
> +#define __BFP(m) u16 m; u16 __pad_##m
> +struct bfin_mmr_serial {
> +#if BFIN_UART_HW_VER == 2
> + __BFP(dll);
> + __BFP(dlh);
> + __BFP(gctl);
> + __BFP(lcr);
> + __BFP(mcr);
> + __BFP(lsr);
> + __BFP(msr);
> + __BFP(scr);
> + __BFP(ier_set);
> + __BFP(ier_clear);
> + __BFP(thr);
> + __BFP(rbr);
> +#else
> + union {
> + u16 dll;
> + u16 thr;
> + const u16 rbr;
> + };
> + const u16 __spad0;
> + union {
> + u16 dlh;
> + u16 ier;
> + };
> + const u16 __spad1;
> + const __BFP(iir);
> + __BFP(lcr);
> + __BFP(mcr);
> + __BFP(lsr);
> + __BFP(msr);
> + __BFP(scr);
> + const u32 __spad2;
> + __BFP(gctl);
> +#endif

Sorry, but this is totally unreadable.

> +# define DO_MUX(port, mux_tx, mux_rx, tx, rx) \
> + bfin_write_PORT##port##_MUX((bfin_read_PORT##port##_MUX() & ~(PORT_x_MUX_##mux_tx##_MASK | PORT_x_MUX_##mux_rx##_MASK)) | PORT_x_MUX_##mux_tx##_FUNC_1 | PORT_x_MUX_##mux_rx##_FUNC_1); \
> + bfin_write_PORT##port##_FER(bfin_read_PORT##port##_FER() | P##port##tx | P##port##rx);
> + switch (CONFIG_UART_CONSOLE) {
> + case 0:
> + DO_MUX(G, 7, 7, 12, 13);
> + break; /* Port G; mux 7; PG12 and PG13 */
> + case 1:
> + DO_MUX(F, 3, 3, 6, 7);
> + break; /* Port F; mux 3; PF6 and PF7 */

This is totally unreadable.

This needs serious fixing.

Best regards,

Wolfgang Denk

--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Too bad that all the people who know how to run the country are busy
driving taxicabs and cutting hair. - George Burns