linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Michalis Pappas <mpappas@fastmail.fm>
Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: gdm72xx: conditionally compile debug code
Date: Wed, 16 Jul 2014 13:50:24 -0700	[thread overview]
Message-ID: <20140716205024.GA11078@kroah.com> (raw)
In-Reply-To: <53C6E332.2070301@fastmail.fm>

On Wed, Jul 16, 2014 at 09:40:18PM +0100, Michalis Pappas wrote:
> On 07/09/2014 07:51 PM, Greg KH wrote:
> >> diff --git a/drivers/staging/gdm72xx/gdm_sdio.c b/drivers/staging/gdm72xx/gdm_sdio.c
> >> index 9d2de6f..914fd75 100644
> >> --- a/drivers/staging/gdm72xx/gdm_sdio.c
> >> +++ b/drivers/staging/gdm72xx/gdm_sdio.c
> >> @@ -280,9 +280,11 @@ static void send_sdu(struct sdio_func *func, struct tx_cxt *tx)
> >>  
> >>  	spin_unlock_irqrestore(&tx->lock, flags);
> >>  
> >> +	#if defined(GDM72xx_DEBUG)
> >>  	print_hex_dump_debug("sdio_send: ", DUMP_PREFIX_NONE, 16, 1,
> >>  			     tx->sdu_buf + TYPE_A_HEADER_SIZE,
> >>  			     aggr_len - TYPE_A_HEADER_SIZE, false);
> >> +	#endif
> > 
> > This should be moved to use dev_dbg(), along with the other calls to
> > this function in this file.
> > 
> 
> But dev_dbg() gets eventually to be printk(), which cannot print the
> buffer, so using print_hex_dump_debug() seems to be correct for this
> case, no?

No, you don't want to print the message unless debugging is enabled, and
dev_dbg() uses the proper in-kernel dynamic debug infrastructure.  There
should never be a separate config option for debugging a driver, that
ensures that no user will ever be able to help you out with it.

So delete the ifdef stuff, and the config option, and just use the
proper in-kernel infrastructure for this.

thanks,

greg k-h

  reply	other threads:[~2014-07-16 20:50 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-01 13:00 [PATCH] staging: gdm72xx: remove unused code Michalis Pappas
2014-07-01 13:00 ` [PATCH] staging: gdm72xx: conditionally compile debug code Michalis Pappas
     [not found]   ` <CAC5Y2nPGyByqLEM1Go6Pxpb6MhiJy2Fvu=eEz6ak24gMhayk=A@mail.gmail.com>
2014-07-01 16:40     ` Michalis Pappas
     [not found]       ` <CAC5Y2nOvJ2=u7-T53kHd50AfQ7Mo_U4qvD_=si9=NSr_q0w3NA@mail.gmail.com>
2014-07-03 17:27         ` Michalis Pappas
2014-07-09 18:51   ` Greg KH
2014-07-09 19:52     ` Michalis Pappas
2014-07-09 20:24       ` Greg KH
2014-07-16 20:40     ` Michalis Pappas
2014-07-16 20:50       ` Greg KH [this message]
2014-07-16 22:03         ` Michalis Pappas
2014-07-16 22:10           ` Greg KH
2014-07-16 22:46             ` Joe Perches
2014-07-16 22:57               ` Greg KH
2014-07-17  0:19                 ` Joe Perches
2014-07-01 13:00 ` [PATCH] staging: gdm72xx: move T_CAPABILITY bit definitions to hci.h Michalis Pappas
2014-07-01 15:37   ` Ben Chan
2014-07-01 16:25     ` Michalis Pappas
2014-07-02 10:18   ` [PATCH V2] staging: gdm72xx: move T_CAPABILITY " Michalis Pappas
2014-07-09 10:26     ` Dan Carpenter
2014-07-09 18:24       ` Michalis Pappas
2014-07-09 18:31         ` [PATCH v3] " Michalis Pappas
2014-07-09 18:57           ` Greg KH
2014-07-09 19:21             ` [PATCH v4] " Michalis Pappas

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=20140716205024.GA11078@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=devel@driverdev.osuosl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpappas@fastmail.fm \
    /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).