Re: [PATCH v3 20/33] staging: rtl8192e: Fix PREFER_PR_LEVEL warnings

From: Mateusz Kulikowski
Date: Tue May 12 2015 - 16:20:36 EST


On 10.05.2015 00:37, Joe Perches wrote:
> On Sat, 2015-05-09 at 23:19 +0200, Mateusz Kulikowski wrote:
>> Fix most of remaining PREFER_PR_LEVEL warnings in rtllib.
>> Replace printk() with netdev_* if possible, pr_* in other cases.
>> All pr_* use __func__ to easily trace message back to rtllib
>
> It's more common to use %s: and not %s():
> but it's generally even better not to use these
> at all and use dynamic_debug to add the function
> name when desired.

I wasn't aware of that - thanks for the tip.
In that case I'll throw away function names in all _dbg messages for v4.

>> diff --git a/drivers/staging/rtl8192e/rtllib_crypt_ccmp.c b/drivers/staging/rtl8192e/rtllib_crypt_ccmp.c
(...)
>> hdr = (struct rtllib_hdr_4addr *) skb->data;
>> - printk(KERN_DEBUG
>> - "%s: Michael MIC verification failed for MSDU from %pM keyidx=%d\n",
>> - skb->dev ? skb->dev->name : "N/A", hdr->addr2,
>> - keyidx);
>> - printk(KERN_DEBUG "%d\n",
>> - memcmp(mic, skb->data + skb->len - 8, 8) != 0);
>> + pr_debug("%s: Michael MIC verification failed for MSDU from %pM keyidx=%d\n",
>> + skb->dev ? skb->dev->name : "N/A", hdr->addr2,
>> + keyidx);
>
> Not that it's necessary, but are this and below
> missing __func__?

It prints device name in an awkward way - I must missed this one during review as
it is the place where netdev_dbg() should be used.

Will do it the right way in v4.

Regards,
Mateusz

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/