[U-Boot] [PATCH v2 3/7] usb: eth: introduce support for Moschip USB ethernet

Marek Vasut
2014-02-17T20:57:04Z

On Monday, February 17, 2014 at 08:35:23 PM, Gerhard Sittig wrote:

[...]

> +int mcs7830_eth_get_info(struct usb_device *dev, struct ueth_data *ss,
> + struct eth_device *eth)
> +{
> + debug("%s()\n", __func__);
> + if (!eth) {
> + debug("%s: missing parameter.\n", __func__);
> + return 0;
> + }
> +
> + snprintf(eth->name, sizeof(eth->name), "%s%d",
> + MCS7830_BASE_NAME, mcs7830_iface_idx++);
> + eth->init = mcs7830_init;
> + eth->send = mcs7830_send;
> + eth->recv = mcs7830_recv;
> + eth->halt = mcs7830_halt;
> + eth->write_hwaddr = mcs7830_write_mac;
> + eth->priv = ss;
> +
> + if (mcs7830_basic_reset(ss))
> + return 0;
> +
> +#ifdef DEBUG
> + (void)mcs7830_read_config(eth);

So this is debug-only function? You might want to put the entire function into
#ifdef DEBUG and then have an #else , where you define the function as an empty
one. The GCC shall handle the rest then as well, but you won't have this ugly
ifdef in a function.
[...]

Best regards,
Marek Vasut