From: Sergei Shtylyov <sergei.shtylyov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
To: Andy Shevchenko
<andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
Cc: Greg Kroah-Hartman
<gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>,
linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] net/usb/kalmia: use %*phC to dump small buffers
Date: Tue, 28 May 2013 22:14:01 +0400 [thread overview]
Message-ID: <51A4F3E9.4090108@cogentembedded.com> (raw)
In-Reply-To: <1369734966-29026-1-git-send-email-andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
Hello.
On 28-05-2013 13:56, Andy Shevchenko wrote:
> Instead of dereferencing pointer and put values on stack we could use nice
> %*phC specifier.
> Signed-off-by: Andy Shevchenko <andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
> ---
> drivers/net/usb/kalmia.c | 46 ++++++++++++++++------------------------------
> 1 file changed, 16 insertions(+), 30 deletions(-)
> diff --git a/drivers/net/usb/kalmia.c b/drivers/net/usb/kalmia.c
> index 0192073..13ecfc5 100644
> --- a/drivers/net/usb/kalmia.c
> +++ b/drivers/net/usb/kalmia.c
[...]
> @@ -263,32 +260,24 @@ kalmia_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
> sizeof(EXPECTED_UNKNOWN_HEADER_1)) || !memcmp(
> header_start, EXPECTED_UNKNOWN_HEADER_2,
> sizeof(EXPECTED_UNKNOWN_HEADER_2))) {
> - netdev_dbg(
> - dev->net,
> - "Received expected unknown frame header: %02x:%02x:%02x:%02x:%02x:%02x. Package length: %i\n",
> - header_start[0], header_start[1],
> - header_start[2], header_start[3],
> - header_start[4], header_start[5],
> + netdev_dbg(dev->net,
> + "Received expected unknown frame "
> + "header: %6phC. Package length: %i\n",
Message strings shouldn't be broken, despite 80 chars limit (there's an
exception for them in checkpatch.pl).
> + header_start,
> skb->len - KALMIA_HEADER_LENGTH);
> }
> else {
> - netdev_err(
> - dev->net,
> - "Received unknown frame header: %02x:%02x:%02x:%02x:%02x:%02x. Package length: %i\n",
> - header_start[0], header_start[1],
> - header_start[2], header_start[3],
> - header_start[4], header_start[5],
> + netdev_err(dev->net,
> + "Received unknown frame header: %6phC. "
> + "Package length: %i\n", header_start,
Same here...
> skb->len - KALMIA_HEADER_LENGTH);
> return 0;
> }
> }
[...]
> @@ -310,12 +299,9 @@ kalmia_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
> sizeof(HEADER_END_OF_USB_PACKET)) == 0);
> if (!is_last) {
> header_start = skb->data + ether_packet_length;
> - netdev_dbg(
> - dev->net,
> - "End header: %02x:%02x:%02x:%02x:%02x:%02x. Package length: %i\n",
> - header_start[0], header_start[1],
> - header_start[2], header_start[3],
> - header_start[4], header_start[5],
> + netdev_dbg(dev->net,
> + "End header: %6phC. Package length: %i"
> + "\n", header_start,
... and here.
WBR, Sergei
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2013-05-28 18:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-28 9:56 [PATCH] net/usb/kalmia: use %*phC to dump small buffers Andy Shevchenko
[not found] ` <1369734966-29026-1-git-send-email-andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2013-05-28 18:14 ` Sergei Shtylyov [this message]
2013-05-28 18:21 ` Andy Shevchenko
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=51A4F3E9.4090108@cogentembedded.com \
--to=sergei.shtylyov-m4dtvfq/zs1mrggop+s0pdbpr1lh4cv8@public.gmane.org \
--cc=andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
--cc=gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org \
--cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.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 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.