[U-Boot] [PATCH] USB: musb_udc: Bugfix musb_peri_rx_ep

Kim Phillips kim.phillips at freescale.com
Thu Sep 13 21:01:43 CEST 2012


On Thu, 13 Sep 2012 10:26:31 -0700
Tom Rini <trini at ti.com> wrote:

> +				} else {
> +					if (debug_level > 0)
> +						serial_printf("ERROR : %s %d"
> +								" no space "
> +								"in rcv "
> +								"buffer\n",
> +								__func__,
> +								ep);
> +				}

that's pretty bad.

strings are allowed to exceed the 80 column limit, for grep purposes.

also, if the conditional logic is reversed, one can regain some of
that horizontal space, i.e.:

if (!(peri_rxcsr & MUSB_RXCSR_RXPKTRDY)) {
	if (debug_level > 0)
		serial_printf("ERROR : %s %d with nothing to do\n",
			      __PRETTY_FUNCTION__, ep);
	return;
}
peri_rxcount = readw(&musbr->ep[ep].epN.rxcount);
if (!peri_rxcount)
	if (debug_level > 0) {
		serial_printf("ERROR : %s %d problem with endpoint\n",
			      __PRETTY_FUNCTION__, ep);
		serial_printf("ERROR : %s %d with nothing to do\n",
			      __func__, ep);
	return;
}

...and so on.

Kim



More information about the U-Boot mailing list