From: Julia Lawall <julia.lawall@lip6.fr>
To: Arushi Singhal <arushisinghal19971997@gmail.com>
Cc: gregkh@linuxfoundation.org, devel@driverdev.osuosl.org,
linux-kernel@vger.kernel.org, Larry.Finger@lwfinger.net,
outreachy-kernel@googlegroups.com
Subject: Re: [Outreachy kernel] [PATCH v2] staging: rtl8192u: Replace printk() with appropriate net_*macro_ratelimited()
Date: Mon, 5 Mar 2018 08:37:54 +0100 (CET) [thread overview]
Message-ID: <alpine.DEB.2.20.1803050835230.2306@hadrien> (raw)
In-Reply-To: <20180305073256.GA4347@seema-Inspiron-15-3567>
On Mon, 5 Mar 2018, Arushi Singhal wrote:
> Replace printk having a log level with the appropriate
> net_*macro_ratelimited.
> It's better to use actual device name as a prefix in error messages.
I asked several questions about the above two lines, which as far as I can
see haven't been answered. Please excuse me if I missed the answers, but I
would still like to know what they are.
Namely, why did you choose to change to rate limited output, and what does
the "device name as a prefix" comment mean?
julia
> Indentation is also changed, to fix the checkpatch issue if line is not
> exceding 80 characters.
>
> Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
> ---
> changes in v2
> *change the subject line, in v1 driver name was wrong.
>
> .../rtl8192u/ieee80211/ieee80211_crypt_ccmp.c | 22 +++++++++++-----------
> 1 file changed, 11 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c
> index e6648f7..200fe5f 100644
> --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c
> +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c
> @@ -73,7 +73,7 @@ static void *ieee80211_ccmp_init(int key_idx)
>
> priv->tfm = (void *)crypto_alloc_cipher("aes", 0, CRYPTO_ALG_ASYNC);
> if (IS_ERR(priv->tfm)) {
> - printk(KERN_DEBUG "ieee80211_crypt_ccmp: could not allocate crypto API aes\n");
> + net_dbg_ratelimited("ieee80211_crypt_ccmp: could not allocate crypto API aes\n");
> priv->tfm = NULL;
> goto fail;
> }
> @@ -276,22 +276,22 @@ static int ieee80211_ccmp_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
> keyidx = pos[3];
> if (!(keyidx & (1 << 5))) {
> if (net_ratelimit()) {
> - printk(KERN_DEBUG "CCMP: received packet without ExtIV flag from %pM\n",
> - hdr->addr2);
> + net_dbg_ratelimited("CCMP: received packet without ExtIV flag from %pM\n",
> + hdr->addr2);
> }
> key->dot11RSNAStatsCCMPFormatErrors++;
> return -2;
> }
> keyidx >>= 6;
> if (key->key_idx != keyidx) {
> - printk(KERN_DEBUG "CCMP: RX tkey->key_idx=%d frame keyidx=%d priv=%p\n",
> - key->key_idx, keyidx, priv);
> + net_dbg_ratelimited("CCMP: RX tkey->key_idx=%d frame keyidx=%d priv=%p\n",
> + key->key_idx, keyidx, priv);
> return -6;
> }
> if (!key->key_set) {
> if (net_ratelimit()) {
> - printk(KERN_DEBUG "CCMP: received packet from %pM with keyid=%d that does not have a configured key\n",
> - hdr->addr2, keyidx);
> + net_dbg_ratelimited("CCMP: received packet from %pM with keyid=%d that does not have a configured key\n",
> + hdr->addr2, keyidx);
> }
> return -3;
> }
> @@ -306,8 +306,8 @@ static int ieee80211_ccmp_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
>
> if (memcmp(pn, key->rx_pn, CCMP_PN_LEN) <= 0) {
> if (net_ratelimit()) {
> - printk(KERN_DEBUG "CCMP: replay detected: STA=%pM previous PN %pm received PN %pm\n",
> - hdr->addr2, key->rx_pn, pn);
> + net_dbg_ratelimited("CCMP: replay detected: STA=%pM previous PN %pm received PN %pm\n",
> + hdr->addr2, key->rx_pn, pn);
> }
> key->dot11RSNAStatsCCMPReplays++;
> return -4;
> @@ -341,8 +341,8 @@ static int ieee80211_ccmp_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
>
> if (memcmp(mic, a, CCMP_MIC_LEN) != 0) {
> if (net_ratelimit()) {
> - printk(KERN_DEBUG "CCMP: decrypt failed: STA=%pM\n",
> - hdr->addr2);
> + net_dbg_ratelimited("CCMP: decrypt failed: STA=%pM\n",
> + hdr->addr2);
> }
> key->dot11RSNAStatsCCMPDecryptErrors++;
> return -5;
> --
> 2.7.4
>
> --
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20180305073256.GA4347%40seema-Inspiron-15-3567.
> For more options, visit https://groups.google.com/d/optout.
>
next prev parent reply other threads:[~2018-03-05 7:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-05 7:32 Arushi Singhal
2018-03-05 7:37 ` Julia Lawall [this message]
2018-03-06 17:01 ` [Outreachy kernel] " Arushi Singhal
2018-03-06 17:08 ` Julia Lawall
2018-03-06 12:05 ` [Outreachy kernel] " Greg KH
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=alpine.DEB.2.20.1803050835230.2306@hadrien \
--to=julia.lawall@lip6.fr \
--cc=Larry.Finger@lwfinger.net \
--cc=arushisinghal19971997@gmail.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=outreachy-kernel@googlegroups.com \
/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
all inboxes | Powered by JetHome®