Received: by 10.223.185.116 with SMTP id b49csp3045179wrg; Mon, 5 Mar 2018 13:05:11 -0800 (PST) X-Google-Smtp-Source: AG47ELuEuRhHQUBVMR/R3ma1xqSP/n8nruvYu0tGcVVtTaJl4G8RaD8ccEAkuYmWwXVEl5EvUF4s X-Received: by 2002:a17:902:d204:: with SMTP id t4-v6mr14604133ply.377.1520283910964; Mon, 05 Mar 2018 13:05:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520283910; cv=none; d=google.com; s=arc-20160816; b=tPWwHhgB0od41gsBpCTN37d1B759EcjJR+nnb+K0sZBk6WROoQaBcxIS3LFwYTEaM2 t6grRDuPlK2dj5bkaM87M5PmJVwRYW7hLtulA/1BdSbpKBa9Y1ohTZesTkV4ePc3Uyre VfWQM3Mox/RgzhXZznSEm7g1FqqEQ+BOjTwP1AxsKcQhocihKTTybhxIW1+vyNL/zLzk zL+WQBW6EawqiTmzkIJ4OcroCtmx+at2rmKXOaHaE3BdYYhULzUoFWix6VLJcqsBcrS0 hbWDYNQHqn6McpZEhyr+SIxiOVqXz5mDM9D06sClUD83a7YSyLFQ30MZXXY+HLKZoIBx FmLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date :arc-authentication-results; bh=UA00/zv9aVxKRvm532Psfk/jDwfjQCjv9SqImNS2eig=; b=bB+rZM8Wa8SGCPhfm1Yber5XxX4UmJjAvw6Iq+86ZjQU4gmXaAOLhNDs86qQUMsbBY EQbfLfXOWebdfu+mkXMPoOlgTwnnIaRlhF9ztBFifKZc4HlSCE1IOFmzoohb5yHPBZk4 h8s9bdoVC+OxdypNLe50bH62fFMt9uEngc7+jBiarrS6WzQfznlpgubzRCFLnr7NnCLg H0nzRSpQjN+Q4dRgkUfv+8whrUGSTH5+3Z0IGZxD47ZcYVEyPOorLK0QxAs0j2fgC6yU Jwqp9Ff43lVpAAnlQdsZ6XpEb6+yP+FK3FCV/EbOFWs6hbcPOR5TJU3lpKPliow2RHfj ttJw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 34-v6si9892844plp.252.2018.03.05.13.04.56; Mon, 05 Mar 2018 13:05:10 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932314AbeCEVDY (ORCPT + 99 others); Mon, 5 Mar 2018 16:03:24 -0500 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:29612 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932099AbeCEVDW (ORCPT ); Mon, 5 Mar 2018 16:03:22 -0500 X-IronPort-AV: E=Sophos;i="5.47,428,1515452400"; d="scan'208";a="316528854" Received: from abo-3-110-68.mrs.modulonet.fr (HELO [192.168.0.15]) ([85.68.110.3]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Mar 2018 22:03:21 +0100 Date: Mon, 5 Mar 2018 22:03:20 +0100 (CET) From: Julia Lawall X-X-Sender: jll@hadrien To: Arushi Singhal cc: Dan Carpenter , Greg KH , driverdevel , outreachy-kernel@googlegroups.com, LKML Subject: Re: [Outreachy kernel] Re: [PATCH] staging: irda: Replace printk() with appropriate net_*macro_ratelimited() In-Reply-To: Message-ID: References: <20180304223205.GA31416@seema-Inspiron-15-3567> <20180305100345.v6ajs7vdgzmwu5x4@mwanda> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: multipart/mixed; BOUNDARY="8323329-1001131651-1520283801=:2763" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --8323329-1001131651-1520283801=:2763 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT 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. julia --8323329-1001131651-1520283801=:2763--