From: Joe Perches <joe@perches.com>
To: "L. Alberto Giménez" <agimenez@sysvalve.es>
Cc: devel@linuxdriverproject.org, Greg Kroah-Hartman <gregkh@suse.de>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/3] Staging: rt2860: include KERN_* in printk
Date: Sun, 12 Dec 2010 19:13:53 -0800 [thread overview]
Message-ID: <1292210033.18202.81.camel@Joe-Laptop> (raw)
In-Reply-To: <20101213000106.GA2049@bart.evergreen.loc>
On Mon, 2010-12-13 at 01:01 +0100, L. Alberto Giménez wrote:
> On Sun, Dec 12, 2010 at 11:46:09AM -0800, Joe Perches wrote:
> > On Sun, 2010-12-12 at 20:25 +0100, L. Alberto Giménez wrote:
> > > On Sun, Dec 12, 2010 at 11:04:28AM -0800, Joe Perches wrote:
> > > > On Sun, 2010-12-12 at 18:56 +0100, L. Alberto Giménez wrote:
> > > > > diff --git a/drivers/staging/rt2860/pci_main_dev.c b/drivers/staging/rt2860/pci_main_dev.c
> > > > > @@ -601,15 +600,15 @@ void hex_dump(char *str, unsigned char *pSrcBufVA, unsigned int SrcBufLen)
> > > > >[...]
> > > > This should use print_hex_dump
> > > Ok, but I'll have to figure out how to translate the arguments without losing
> > > the original developers intended format.
> >
> > I think you can change the format without concern.
> >
> > print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_OFFSET, 16, 1,
> > pSrcBufVA, SrcBufLen, true);
>
> Hi Joe,
>
> If you don't mind, I will send this as a separate patch, since including it in
> the KERN_* cleanup would clobber the patch and I'd prefer to make an standalone
> patch for the hex_dump -> print_hex_dump modifications (many files in the source
> do use the function).
It's fine to keep the hex_dump function, just change
the function itself to use print_hex_dump.
Changing all the callers will simply increase the code
without any other value.
Something simple like this should work:
drivers/staging/rt2860/rt_linux.c | 16 +++-------------
1 files changed, 3 insertions(+), 13 deletions(-)
diff --git a/drivers/staging/rt2860/rt_linux.c
b/drivers/staging/rt2860/rt_linux.c
index abfeea1..5b081ce 100644
--- a/drivers/staging/rt2860/rt_linux.c
+++ b/drivers/staging/rt2860/rt_linux.c
@@ -594,22 +594,12 @@ rt_get_sg_list_from_packet(void *pPacket, struct rt_rtmp_sg_list *sg)
void hex_dump(char *str, unsigned char *pSrcBufVA, unsigned int SrcBufLen)
{
- unsigned char *pt;
- int x;
-
if (RTDebugLevel < RT_DEBUG_TRACE)
return;
- pt = pSrcBufVA;
- printk("%s: %p, len = %d\n", str, pSrcBufVA, SrcBufLen);
- for (x = 0; x < SrcBufLen; x++) {
- if (x % 16 == 0)
- printk("0x%04x : ", x);
- printk("%02x ", ((unsigned char)pt[x]));
- if (x % 16 == 15)
- printk("\n");
- }
- printk("\n");
+ printk(KERN_DEBUG "%s: %p, len = %d\n", str, pSrcBufVA, SrcBufLen);
+ print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_OFFSET, 16, 1,
+ pSrcBufVA, SrcBufLen, true);
}
/*
next prev parent reply other threads:[~2010-12-13 3:13 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-12 17:56 [PATCH 0/3] Staging: rt2860: Fix checkpatch issues L. Alberto Giménez
2010-12-12 17:56 ` [PATCH 1/3] Staging: rt2860: Clean spaces before tabs L. Alberto Giménez
2010-12-13 6:05 ` Dan Carpenter
2010-12-12 17:56 ` [PATCH 2/3] Staging: rt2860: Avoid extern in .c file L. Alberto Giménez
2010-12-12 17:56 ` [PATCH 3/3] Staging: rt2860: include KERN_* in printk L. Alberto Giménez
2010-12-12 19:04 ` Joe Perches
2010-12-12 19:25 ` L. Alberto Giménez
2010-12-12 19:46 ` Joe Perches
2010-12-13 0:01 ` L. Alberto Giménez
2010-12-13 3:13 ` Joe Perches [this message]
2010-12-13 5:56 ` Dan Carpenter
2010-12-13 6:03 ` Joe Perches
2010-12-12 23:58 ` [PATCH v2] " L. Alberto Giménez
2010-12-13 18:30 ` Greg KH
2010-12-13 20:24 ` L. Alberto Giménez
2010-12-13 21:15 ` Greg KH
2010-12-13 21:53 ` Joe Perches
2010-12-13 22:17 ` Greg KH
2010-12-14 1:01 ` [PATCH 1/2][RESEND] " L. Alberto Giménez
2010-12-14 1:01 ` [PATCH 2/2][RESEND] Staging: rt2860: Sanitize DBGPRINT_ERR macro L. Alberto Giménez
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=1292210033.18202.81.camel@Joe-Laptop \
--to=joe@perches.com \
--cc=agimenez@sysvalve.es \
--cc=devel@linuxdriverproject.org \
--cc=gregkh@suse.de \
--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