netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: "Rafał Miłecki" <zajec5@gmail.com>
Cc: netdev@vger.kernel.org, "David S. Miller" <davem@davemloft.net>
Subject: Re: [PATCH] bgmac: driver for GBit MAC core on BCMA bus
Date: Wed, 26 Dec 2012 14:24:40 -0800	[thread overview]
Message-ID: <1356560680.26650.15.camel@joe-AO722> (raw)
In-Reply-To: <1356363222-16672-1-git-send-email-zajec5@gmail.com>

On Mon, 2012-12-24 at 16:33 +0100, Rafał Miłecki wrote:
> BCMA is a Broadcom specific bus with devices AKA cores. All recent BCMA
> based SoCs have gigabit ethernet provided by the GBit MAC core. This
> patch adds driver for such a cores registering itself as a netdev. It
> has been tested on a BCM4706 and BCM4718 chipsets.

Just a trivial note:

> diff --git a/drivers/net/ethernet/broadcom/bgmac.h b/drivers/net/ethernet/broadcom/bgmac.h
[]
> @@ -0,0 +1,443 @@
> +#ifndef _BGMAC_H
> +#define _BGMAC_H
> +
> +#define pr_fmt(fmt)		KBUILD_MODNAME ": " fmt
> +
> +#define bgmac_err(bgmac, fmt, ...) \
> +	pr_err("u%d: " fmt, (bgmac)->core->core_unit, ##__VA_ARGS__)
> +#define bgmac_warn(bgmac, fmt, ...) \
> +	pr_warn("u%d: " fmt, (bgmac)->core->core_unit, ##__VA_ARGS__)
> +#define bgmac_info(bgmac, fmt, ...) \
> +	pr_info("u%d: " fmt, (bgmac)->core->core_unit, ##__VA_ARGS__)
> +#define bgmac_dbg(bgmac, fmt, ...) \
> +	pr_debug("u%d: " fmt, (bgmac)->core->core_unit, ##__VA_ARGS__)

Maybe all the bgmac_<level> macros should be:

	dev_<level>(&bgmac->core->dev, "u%d: " fmt,
	            (bgmac)->core->core_unit, ##__VA_ARGS)

or maybe a new function like below if you use
a lot of these to decrease object size a little.

int bgmac_printk(const char *level, const struct bgmac *bgmac,
                 const char *fmt, ...)
{

	struct va_format vaf;
	va_list args;
	int r;

	va_start(args, fmt);

	vaf.fmt = fmt;
	vaf.va = &args;

	r = dev_printk(&bgmac->core->dev, "u%d: %pV",
	               bgmac->core->core_unit, &vaf);

	va_end(args);

	return r;
}

  reply	other threads:[~2012-12-26 22:24 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-24 15:33 [PATCH] bgmac: driver for GBit MAC core on BCMA bus Rafał Miłecki
2012-12-26 22:24 ` Joe Perches [this message]
2012-12-26 23:17 ` Francois Romieu
2012-12-27  0:45   ` Rafał Miłecki
2012-12-27 22:03     ` Francois Romieu
2013-01-03 15:57   ` Rafał Miłecki
2013-01-03 20:30     ` Francois Romieu
2013-01-05 12:08       ` Rafał Miłecki
2013-01-05 16:57         ` Francois Romieu
2013-01-05 18:28           ` Rafał Miłecki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1356560680.26650.15.camel@joe-AO722 \
    --to=joe@perches.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=zajec5@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).