public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Bruce Humphrey <brucehum@gmail.com>
Cc: abbotti@mev.co.uk, fmhess@users.sourceforge.net,
	gregkh@linuxfoundation.org, devel@driverdev.osuosl.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] Staging: Comedi: dyna_pci10xx: Replace printk with dev_info
Date: Thu, 13 Sep 2012 18:27:17 +0300	[thread overview]
Message-ID: <20120913152717.GA4587@mwanda> (raw)
In-Reply-To: <CAGzQFLgLkqOdfQjbz3LFArEZGxwiEA4nnpLLtCHaX3w=-=RbKw@mail.gmail.com>

On Thu, Sep 13, 2012 at 04:46:02PM +0200, Bruce Humphrey wrote:
> Thanks for all the comments!
> 
> My own answers are from the complete linux kernel newbie point of view!
> That's why I'm writing them even if they seem obvious, to make sure.
> 
>  >               data[n] = 0;
> > > -             printk(KERN_DEBUG "comedi: dyna_pci10xx: "
> > > -                     "timeout reading analog input\n");
> > > +             dev_dbg(dev->class_dev, "timeout reading analog input\n");
> >
> > The trick with removing the "comedi: dyna_pci10xx: " prefix is that
> > you need to put this at the top of the file before the includes.
> >
> > #define pr_fmt(fmt) "comedi: dyna_pci10xx: " fmt
> >
> > You would need to remove the prefix from the other pr_info printk
> > as well so it's not included twice.
> >
> 
> Thanks for the very useful info!
> This would use pr_info, and not dev_info, which I think is prefered. But of
> course, pr_info is much better than printk, coding style wise.
> 

Sorry, for some reason I thought there was an existing pr_info() in
the file which would have needed to be updated.  I'm not sure what
I was looking at...

Anyway, this file has changed recently in linux-next so there is
only one printk() left now.

regards,
dan carpenter


      parent reply	other threads:[~2012-09-13 15:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-13  1:46 [PATCH 1/2] Staging: Comedi: dyna_pci10xx: Replace printk with dev_info Bruce Humphrey
2012-09-13  8:00 ` Dan Carpenter
     [not found]   ` <CAGzQFLgLkqOdfQjbz3LFArEZGxwiEA4nnpLLtCHaX3w=-=RbKw@mail.gmail.com>
2012-09-13 15:27     ` Dan Carpenter [this message]

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=20120913152717.GA4587@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=abbotti@mev.co.uk \
    --cc=brucehum@gmail.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=fmhess@users.sourceforge.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    /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