linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Antti Palosaari <crope@iki.fi>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: linux-media@vger.kernel.org,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Subject: Re: [PATCH 2/2] dvb_usb_v2: use %*ph to dump usb xfer debugs
Date: Wed, 08 Aug 2012 12:37:27 +0300	[thread overview]
Message-ID: <50223357.1020203@iki.fi> (raw)
In-Reply-To: <CAHp75Vd=EiGvgWh=t22DTOx0=3x8EjC2wbcgXKba56YtSr22_w@mail.gmail.com>

On 08/08/2012 07:16 AM, Andy Shevchenko wrote:
> On Wed, Aug 8, 2012 at 1:56 AM, Antti Palosaari <crope@iki.fi> wrote:
>> diff --git a/drivers/media/dvb/dvb-usb-v2/dvb_usb_urb.c b/drivers/media/dvb/dvb-usb-v2/dvb_usb_urb.c
>> index 5f5bdd0..0431bee 100644
>> --- a/drivers/media/dvb/dvb-usb-v2/dvb_usb_urb.c
>> +++ b/drivers/media/dvb/dvb-usb-v2/dvb_usb_urb.c
>
>> @@ -37,10 +36,8 @@ int dvb_usbv2_generic_rw(struct dvb_usb_device *d, u8 *wbuf, u16 wlen, u8 *rbuf,
>>          if (ret < 0)
>>                  return ret;
>>
>> -#ifdef DVB_USB_XFER_DEBUG
>> -       print_hex_dump(KERN_DEBUG, KBUILD_MODNAME ": >>> ", DUMP_PREFIX_NONE,
>> -                       32, 1, wbuf, wlen, 0);
>> -#endif
>> +       dev_dbg(&d->udev->dev, "%s: >>> %*ph\n", __func__, wlen, wbuf);
>> +
>>          ret = usb_bulk_msg(d->udev, usb_sndbulkpipe(d->udev,
>>                          d->props->generic_bulk_ctrl_endpoint), wbuf, wlen,
>>                          &actual_length, 2000);
>> @@ -64,11 +61,8 @@ int dvb_usbv2_generic_rw(struct dvb_usb_device *d, u8 *wbuf, u16 wlen, u8 *rbuf,
>>                          dev_err(&d->udev->dev, "%s: 2nd usb_bulk_msg() " \
>>                                          "failed=%d\n", KBUILD_MODNAME, ret);
>>
>> -#ifdef DVB_USB_XFER_DEBUG
>> -               print_hex_dump(KERN_DEBUG, KBUILD_MODNAME ": <<< ",
>> -                               DUMP_PREFIX_NONE, 32, 1, rbuf, actual_length,
>> -                               0);
>> -#endif
>> +               dev_dbg(&d->udev->dev, "%s: <<< %*ph\n", __func__,
>> +                               actual_length, rbuf);
>>          }
>>
> Antti, I didn't check how long buffer could be in above cases, but be
> aware that %*ph prints up to 64 bytes only. Is it enough here?

It is correct behavior. I saw from the LKML patch limit was selected 
using min_t() not causing any other side effect than cut print length.

For some cases it could be more than 64 here, likely for the firmware 
download packed. I suspect, situation where control message is longer 
than 64 byte does not exist in real life as USB1.1 BULK max is 64. And 
even such case exists, we are not interested those not printed bytes.

regards
Antti

-- 
http://palosaari.fi/

      reply	other threads:[~2012-08-08  9:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-07 22:56 [PATCH 1/2] dvb-usb: use %*ph to dump small buffers Antti Palosaari
2012-08-07 22:56 ` [PATCH 2/2] dvb_usb_v2: use %*ph to dump usb xfer debugs Antti Palosaari
2012-08-08  4:16   ` Andy Shevchenko
2012-08-08  9:37     ` Antti Palosaari [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=50223357.1020203@iki.fi \
    --to=crope@iki.fi \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=linux-media@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;
as well as URLs for NNTP newsgroup(s).