Search Linux Wireless

Re: [PATCH 2/3] ath10k: dump hex bytes with dev string prefix

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Michal Kazior <michal.kazior@xxxxxxxxx> writes:

> On 22 September 2014 12:52, Kalle Valo <kvalo@xxxxxxxxxxxxxxxx> wrote:
>> Michal Kazior <michal.kazior@xxxxxxxxx> writes:
>>
>>> -             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));
>
> It should be fine. You want me to re-send it?

Yes, that would be good. I don't feel comfortable editing patches with
logic changes like this.

-- 
Kalle Valo
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux