ATH10K Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Kalle Valo <kvalo@qca.qualcomm.com>
To: Michal Kazior <michal.kazior@tieto.com>
Cc: linux-wireless@vger.kernel.org, ath10k@lists.infradead.org
Subject: Re: [PATCH 2/3] ath10k: dump hex bytes with dev string prefix
Date: Mon, 22 Sep 2014 13:52:05 +0300	[thread overview]
Message-ID: <877g0wlyga.fsf@kamboji.qca.qualcomm.com> (raw)
In-Reply-To: <1411046721-20510-3-git-send-email-michal.kazior@tieto.com> (Michal Kazior's message of "Thu, 18 Sep 2014 15:25:20 +0200")

Michal Kazior <michal.kazior@tieto.com> writes:

> This makes it easier to debug hex dumps on systems
> with more than a single ath10k device.
>
> Signed-off-by: Michal Kazior <michal.kazior@tieto.com>

[...]

> -		print_hex_dump_bytes(prefix, DUMP_PREFIX_OFFSET, buf, len);
> +		for (ptr = buf; (ptr - buf) < len; ptr += 16) {
> +			linebuflen = 0;
> +			if (prefix)
> +				linebuflen += scnprintf(linebuf + linebuflen,
> +							sizeof(linebuf) -
> +							linebuflen,
> +							"%s", prefix);
> +			linebuflen += scnprintf(linebuf + linebuflen,
> +						sizeof(linebuf) - linebuflen,
> +						"%08x: ",
> +						(unsigned int)(ptr - buf));
> +			hex_dump_to_buffer(ptr, len - (ptr - buf), 16, 1,
> +					   linebuf + linebuflen,
> +					   sizeof(linebuf) - linebuflen, true);
> +			dev_printk(KERN_DEBUG, ar->dev, "%s\n", linebuf);
> +		}

Would it be possible to simplify this to one scnprintf()? Something
like:

linebuflen += scnprintf(linebuf + linebuflen,
			sizeof(linebuf) - linebuflen,
			"%s%08x: ",
                        prefix ? prefix : "",
			(unsigned int)(ptr - buf));

-- 
Kalle Valo

_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

  reply	other threads:[~2014-09-22 10:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-18 13:25 [PATCH 0/3] ath10k: debug improvements Michal Kazior
2014-09-18 13:25 ` [PATCH 1/3] ath10k: print wmi version info Michal Kazior
2014-09-22 10:05   ` Kalle Valo
2014-09-18 13:25 ` [PATCH 2/3] ath10k: dump hex bytes with dev string prefix Michal Kazior
2014-09-22 10:52   ` Kalle Valo [this message]
2014-09-22 12:03     ` Michal Kazior
2014-09-22 12:07       ` Kalle Valo
2014-09-18 13:25 ` [PATCH 3/3] ath10k: add debug dump for pci rx Michal Kazior

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=877g0wlyga.fsf@kamboji.qca.qualcomm.com \
    --to=kvalo@qca.qualcomm.com \
    --cc=ath10k@lists.infradead.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=michal.kazior@tieto.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox