All of lore.kernel.org
 help / color / mirror / Atom feed
From: Denis Vlasenko <vda.linux@googlemail.com>
To: James Ketrenos <jketreno@linux.intel.com>
Cc: Andrew Morton <akpm@osdl.org>, Miles Lane <miles.lane@gmail.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Jouni Malinen <jkmaline@cc.hut.fi>
Subject: Re: 2.6.18-mm1 -- ieee80211: Info elem: parse failed: info_element->len + 2 > left : info_element->len+2=28 left=9, id=221.
Date: Thu, 28 Sep 2006 02:15:18 +0200	[thread overview]
Message-ID: <200609280215.18561.vda.linux@googlemail.com> (raw)
In-Reply-To: <451B01FB.2000408@linux.intel.com>

On Thursday 28 September 2006 00:58, James Ketrenos wrote:
> Andrew Morton wrote:
> > On Wed, 27 Sep 2006 13:47:18 -0700
> > James Ketrenos <jketreno@linux.intel.com> wrote:
> > 
> >> +static int snprint_line(char *buf, size_t count,
> >> +			const u8 * data, u32 len, u32 ofs)
> >> +{
> >> +	int out, i, j, l;
> >> +	char c;
> >> +
> >> +	out = snprintf(buf, count, "%08X", ofs);
> >> +
> >> +	for (l = 0, i = 0; i < 2; i++) {
> >> +		out += snprintf(buf + out, count - out, " ");
> >> +		for (j = 0; j < 8 && l < len; j++, l++)
> >> +			out += snprintf(buf + out, count - out, "%02X ",
> >> +					data[(i * 8 + j)]);
> >> +		for (; j < 8; j++)
> >> +			out += snprintf(buf + out, count - out, "   ");
> >> +	}

Dumping this will slow things down,
there will be a lot of calls to snprinf.
Consider making it a bit less slow by handling
full 16-byte lines a bit faster, like:

	if (len >= 16) {
		printk( "%02X %02X %02X %02X %02X %02X %02X %02X  "
			"%02X %02X %02X %02X %02X %02X %02X %02X ",
			ptr[0], ptr[1], ptr[2], ptr[3],
			ptr[4], ptr[5], ptr[6], ptr[7],
			ptr[8], ptr[9], ptr[10], ptr[11],
			ptr[12], ptr[13], ptr[14], ptr[15]);
		num -= 16;
		ptr += 16;
	}

Just my 0.02 euros
--
vda

      parent reply	other threads:[~2006-09-28  0:16 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-26 19:04 2.6.18-mm1 -- ieee80211: Info elem: parse failed: info_element->len + 2 > left : info_element->len+2=28 left=9, id=221 Miles Lane
2006-09-26 19:43 ` Andrew Morton
2006-09-27  0:53   ` Miles Lane
2006-09-28  0:24     ` Jesper Juhl
2006-09-28  5:02       ` Miles Lane
2006-09-27  0:56 ` Miles Lane
2006-09-27  6:05   ` Miles Lane
2006-09-27 20:47     ` James Ketrenos
2006-09-27 20:18       ` Andrew Morton
2006-09-27 22:58         ` James Ketrenos
2006-09-27 23:02           ` Andrew Morton
2006-09-28  0:15           ` Denis Vlasenko [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=200609280215.18561.vda.linux@googlemail.com \
    --to=vda.linux@googlemail.com \
    --cc=akpm@osdl.org \
    --cc=jketreno@linux.intel.com \
    --cc=jkmaline@cc.hut.fi \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miles.lane@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.