Received: by 10.223.185.116 with SMTP id b49csp3727892wrg; Tue, 6 Mar 2018 04:06:04 -0800 (PST) X-Google-Smtp-Source: AG47ELspw2aeyc5/i2SSo3SM8HNHiMHwAkgVlHKoT/X1xCwxx4ink5Y/Z8ktrk/5NRlFkaBb7c5h X-Received: by 10.99.111.137 with SMTP id k131mr15068000pgc.11.1520337964170; Tue, 06 Mar 2018 04:06:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520337964; cv=none; d=google.com; s=arc-20160816; b=C/Y1izyWHhIZOUjp7aXJ+FhZEUedvKBLkclOW4yoPtgBIOC6mbJoByEOoNs427AZ2K ZJATsxSGkPoPBYF3d4zTFHQOkB7foj2kiH/QEtGUM/XMPLpRi5JByzfqgHI34i3yyC4L 4ZFb1PLjcxQVLEuK+EZJA3fr/idSSZ8ratl/zaVIvVTwEAGozDkz8LaBIThzU56xRb+D 4JSPeMxmVrkMyhPHUkzkwlJz7/mkBtZvbhPEq3IfTj4lqQ1a37zvrsc/8iQAI9eag1YF Najxdi1zcUfrhmKJdeV4KVgIElgrTGD5UaHjJYMKeN5ENXrNLy7yY1o/KovUOdjAsNxz oHmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=U0NcP5nuhezmYyByKs48U8afBpoN8AEeu+zcJy7Gd9A=; b=iQ8l4NrrY3br3y+zo/JShtHzK8XWTa6JIba0CpYVMAilYc7frk+NDkQczbRxl8S5Xo 4/8ISz7Jc+gV1rUZxB1RyCa3ZeYWsmSJjUs+K7lzghbyZPMgzoZNlMPwN3pY/9l7BljT 2ZLlMnmh8RjSd85H5rfmndTe7HJbYtD7SIeJZP0X24IPNMwH55FeB8Ua5q5cm/Iegt1b 7pBYKUBEKg3QobAthmSS5LBZ0NZ7KG5JoVUBUoUllyK3BCqBvjq+iREtnp/WMtiKQ8/N +aHmrEltjR2kgEAfNfnAofJq8AwqhW1x487/XpVhKM20DK1w6ye/20XO4jpnxwaTwdkg X4Sg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=pfTVlBHS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e5si9775869pgf.646.2018.03.06.04.05.49; Tue, 06 Mar 2018 04:06:04 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=pfTVlBHS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753539AbeCFMEg (ORCPT + 99 others); Tue, 6 Mar 2018 07:04:36 -0500 Received: from mail-lf0-f65.google.com ([209.85.215.65]:33901 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753024AbeCFMEf (ORCPT ); Tue, 6 Mar 2018 07:04:35 -0500 Received: by mail-lf0-f65.google.com with SMTP id l191so28073616lfe.1 for ; Tue, 06 Mar 2018 04:04:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=U0NcP5nuhezmYyByKs48U8afBpoN8AEeu+zcJy7Gd9A=; b=pfTVlBHSJ7MCRTz+rCsjZAtk77womeMc2OGSp7ExRaaPNno1/Oi37OjwCNVU26nKBr CasOyl8yh5zJWiNNK4oPJyxCvb8OLfcIoDySDtFEDoebNNlCu7QqCVeLlCyHXZuIt534 VdhLP+C1rbovzknJ8YyKW8lzD9fr7kBwv0UfKvYu/2xRro/vtLIXPYoJtH9gJWL7a9it sfBCYsWCWTcE/047HQodOHabHZdK7Hd2pnqGCk7SCfC8zZsHU0ZE7mU+p43/rZB24c00 VbrqGXc7f1mX4x145ZwbrYRRjaqEkmBy6i/p0mWanXAcqSfAZzqRDUmxQ3ZJvQskm2wp OSiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=U0NcP5nuhezmYyByKs48U8afBpoN8AEeu+zcJy7Gd9A=; b=PGfhnYsOOkO6N9fLxDWE3YqQVorHU7eHa6/b8KBklfkvVt6N1bz6oe61TVFjthMq+9 6edWYwY5VVD0kHY2zc6VAQ7Ya3PRIjk3qY8RhM51CGr8dihLVsgk7wx0BgDrYsEZ+2PQ bZQ16kslitdhA7U7lkziXiQiwxdSFx5OdP3js8jXQSqJkonc9xf3OiCshaBIR5UXT873 97O7a3+Y8fXozO8EsFTkZv3+4Vl0vsDeuA+nyvm7i3UmqR80zV25YL79sG/RwXhsvxVQ bd6eWGq7+p04MQa33hKUefvwbTNvOI/hoZClmP5x2wANitEP0f9qKyQ2t9AmFpb9Afvj qaTg== X-Gm-Message-State: APf1xPDKFs6yPVjRrd0vsz+PWv/lMc5vlyuaEfcB2blU3f87/zmipI6k b990NhvZNb14NeS9m8ZXjGWjaqsVybFG+Pui5FY= X-Received: by 10.46.54.12 with SMTP id d12mr12316548lja.31.1520337873467; Tue, 06 Mar 2018 04:04:33 -0800 (PST) MIME-Version: 1.0 Received: by 10.25.23.85 with HTTP; Tue, 6 Mar 2018 04:04:32 -0800 (PST) In-Reply-To: References: <20180304223205.GA31416@seema-Inspiron-15-3567> <20180305100345.v6ajs7vdgzmwu5x4@mwanda> From: SIMRAN SINGHAL Date: Tue, 6 Mar 2018 17:34:32 +0530 Message-ID: Subject: Re: [Outreachy kernel] Re: [PATCH] staging: irda: Replace printk() with appropriate net_*macro_ratelimited() To: Julia Lawall Cc: Arushi Singhal , Dan Carpenter , Greg KH , driverdevel , outreachy-kernel , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 6, 2018 at 2:33 AM, Julia Lawall wrote: > > > On Mon, 5 Mar 2018, Arushi Singhal wrote: > >> >> >> On Mon, Mar 5, 2018 at 3:33 PM, Dan Carpenter wrote: >> On Mon, Mar 05, 2018 at 04:02:06AM +0530, 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. >> > Indentation is also changed, to fix the checkpatch issue if line is not >> > exceding 80 characters. >> > >> > Signed-off-by: Arushi Singhal >> > --- >> > .../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"); >> >> >> This should probably just be deleted. >> >> Hello Dan >> Why we should make this change? >> According to me it's use here to print debug message. >> Wanted to know more about your thought on this. >> >> > 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); >> > } >> >> The "if (net_ratelimit()) " already means the message is ratelimited so >> it's net_dbg() ok? I think so, but I've never looked at this before. >> >> >> net_dbg() is an implicit declaration of a function. So we can't do this change. > > Perhaps you can add the header file that declares net_dbg. Hi Julia There is such header file which declares net_dbg. We can use dev_dbg() for all struct device object. We can use netdev_dbg() for all struct netdevice object. For net subsystem when there is no struct device object we can go with net_dbg_ratelimited (preferred) or pr_debug. I have understood this from my readings. If I am wrong somewhere please correct me. Thanks Arushi > > julia > > -- > 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/alpine.DEB.2.20.1803052203001.2763%40hadrien. > For more options, visit https://groups.google.com/d/optout.