All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: "Rafał Miłecki" <zajec5@gmail.com>
Cc: Johannes Berg <johannes@sipsolutions.net>,
	linux-wireless@vger.kernel.org, Hauke Mehrtens <hauke@hauke-m.de>
Subject: Re: [PATCH option A] bcma: use custom printing functions
Date: Thu, 28 Jun 2012 13:05:49 -0700	[thread overview]
Message-ID: <1340913949.2602.27.camel@joe2Laptop> (raw)
In-Reply-To: <CACna6rwXrspQ_PDfwZbL7jk=hZ6EmhCnebLcp82LaC4T-Khscw@mail.gmail.com>

On Thu, 2012-06-28 at 21:56 +0200, Rafał Miłecki wrote:
> 2012/6/28 Johannes Berg <johannes@sipsolutions.net>:
> > On Thu, 2012-06-28 at 21:44 +0200, Rafał Miłecki wrote:
> >
> >> +#define bcma_err(fmt, ...) \
> >> +     pr_err(KBUILD_MODNAME "-%d: " fmt, bus->num, ##__VA_ARGS__)
> >
> > both of your options seem to rely on "bus" being a variable in the
> > context, is that really a good idea?
> 
> Yeah, I made that assumption to make calls nicer & shorter. We may
> need to get reference to "bus" in function or two.
> 
> I saw such a solution in "radeon" gpu driver, example:
> value = RREG32(R600_AUDIO_STATUS_BITS);
> (they assume "rdev" is available in every function calling RREG32).

I think that radeon use is ugly myself.

> If you believe it's ugly, I can change that. I also wonder what Joe
> will respond.
> 
> P.S.
> Both patches are not signed yet and they are supposed to be RFC. Sorry
> for missing that in subject line.

I think it'd be better to add and use:

#define bcma_bus_err(bus, fmt, ...)				\
	pr_err("bus %d: " fmt, (bus)->num, ##__VA_ARGS__)

#define bcma_bus_info(bus, fmt, ...)				\
	pr_info("bus %d: " fmt, (bus)->num, ##__VA_ARGS__)

or some other equivalent use if you're wedded
to wanting "bcma-%d:" prefixed output.

I'd rather have the prefix be something like "bcma: <bus#>: ",
so a dmesg grep pattern can be "^bcma:" but hey, it ain't my code.

Do what you think best.

cheers, Joe


  reply	other threads:[~2012-06-28 20:05 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-28 19:44 [PATCH option A] bcma: use custom printing functions Rafał Miłecki
2012-06-28 19:48 ` Johannes Berg
2012-06-28 19:56   ` Rafał Miłecki
2012-06-28 20:05     ` Joe Perches [this message]
2012-06-28 20:18       ` Rafał Miłecki
2012-06-28 20:29         ` Hauke Mehrtens
2012-06-28 20:42           ` Rafał Miłecki
2012-06-28 21:09         ` Joe Perches
2012-06-28 20:48       ` 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=1340913949.2602.27.camel@joe2Laptop \
    --to=joe@perches.com \
    --cc=hauke@hauke-m.de \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.