[PATCH 1/3] net: ax88796c: ASIX AX88796C SPI Ethernet Adapter Driver

Lukasz Stelmach l.stelmach at samsung.com
Mon Sep 7 13:47:09 EDT 2020


It was <2020-08-26 śro 09:13>, when Geert Uytterhoeven wrote:
> On Tue, Aug 25, 2020 at 8:02 PM Andrew Lunn <andrew at lunn.ch> wrote:
>> On Tue, Aug 25, 2020 at 07:03:09PM +0200, Łukasz Stelmach wrote:
>> > +     if (netif_msg_pktdata(ax_local)) {
>> > +             int loop;
>> > +             netdev_info(ndev, "TX packet len %d, total len %d, seq %d\n",
>> > +                             pkt_len, tx_skb->len, seq_num);
>> > +
>> > +             netdev_info(ndev, "  Dump SPI Header:\n    ");
>> > +             for (loop = 0; loop < 4; loop++)
>> > +                     netdev_info(ndev, "%02x ", *(tx_skb->data + loop));
>> > +
>> > +             netdev_info(ndev, "\n");
>>
>> This no longer works as far as i remember. Lines are terminate by
>> default even if they don't have a \n.
>>
>> Please you should not be using netdev_info(). netdev_dbg() please.
>
> We have a nice helper for this: print_hex_dump_debug().

It is good to know.

Actually I think printe_hex_dump(KERN_INFO) is here more
appropriate.  With *_debug() functions and dynamic debug enabled users
need to flip two switches to see messages. I think that if msglvl
(pktdata in this case) is not turned on by default and users need to use
ethtool to switch it, they shouldn't be required to fiddle with dynamic
debug too.

-- 
Łukasz Stelmach
Samsung R&D Institute Poland
Samsung Electronics
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 487 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20200907/caa7576d/attachment.sig>


More information about the linux-arm-kernel mailing list