linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Maninder Singh <maninder1.s@samsung.com>
To: Andy Whitcroft <apw@canonical.com>
Cc: "joe@perches.com" <joe@perches.com>,
	"dwaipayanray1@gmail.com" <dwaipayanray1@gmail.com>,
	"lukas.bulwahn@gmail.com" <lukas.bulwahn@gmail.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	AMIT SAHRAWAT <a.sahrawat@samsung.com>,
	Vaneet Narang <v.narang@samsung.com>
Subject: RE: [PATCH 1/1] scripts/checkpatch.pl: remove warning for pritk_deferred also
Date: Fri, 10 Sep 2021 18:15:32 +0530	[thread overview]
Message-ID: <20210910124532epcms5p3b63de3ee7ae2511817cb106c55a74946@epcms5p3> (raw)
In-Reply-To: <YTZ22IfeYanMEMpH@brain>

Hi,


>It looks sensible to add `_deferred`, there also looks to be an
>`_deferred_once` variant which should also be added.  See the first
>stanza of `$logFunctions`.  We might also consider splitting up
>`$logFunctions` so that we can consume the reset without that first
>stanza?  Something like this (completly untested):
>
>    our $logFunctionsCore = qr{(?x:
>        (?:[a-z0-9]+_){1,2}(?:printk|emerg|alert|crit|err|warning|warn|notice|info|debug|dbg|vdbg|devel|cont|WARN)(?:_ratelimited|_once|)|
>        TP_printk|
>        WARN(?:_RATELIMIT|_ONCE|)|
>        panic|
>        MODULE_[A-Z_]+|
>        seq_vprintf|seq_printf|seq_puts
>    )};
>    our $logFunctions = qr{(?x:
>        printk(?:_ratelimited|_once|_deferred_once|_deferred|)|
>	$logFunctionsCore
>    )};
>


sent V2 patch with testing basic checks:

https://lkml.org/lkml/2021/9/7/329

$ cat test.c


printk_deferred(KERN_ALERT "checking deferred\n");
printk_deferred_once(KERN_ALERT "checking deferred\n");
printk(KERN_ERR"error");
pr_emerg("Protocol: %#06hx\n", ntohs(eth->h_proto));
printk_deferred(KERN_ALERT "Protocol: %#06hx\n", ntohs(eth->h_proto));



WARNING: Prefer [subsystem eg: netdev]_err([subsystem]dev, ... then dev_err(dev, ... then pr_err(...  to printk(KERN_ERR ...
#22: FILE: test.c:22:
+printk(KERN_ERR"error");

WARNING: Integer promotion: Using 'h' in '%#06hx' is unnecessary
#23: FILE: test.c:23:
+pr_emerg("Protocol: %#06hx\n", ntohs(eth->h_proto));

WARNING: Integer promotion: Using 'h' in '%#06hx' is unnecessary
#24: FILE: test.c:24:
+printk_deferred(KERN_ALERT "Protocol: %#06hx\n", ntohs(eth->h_proto));


Thanks,
Maninder Singh

      parent reply	other threads:[~2021-09-10 12:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20210824063513epcas5p46ba8b375c3e32fab210640a28041efb6@epcas5p4.samsung.com>
2021-08-24  6:35 ` [PATCH 1/1] scripts/checkpatch.pl: remove warning for pritk_deferred also Maninder Singh
     [not found]   ` <CGME20210824063513epcas5p46ba8b375c3e32fab210640a28041efb6@epcms5p8>
2021-09-06 12:41     ` Maninder Singh
2021-09-06 20:15   ` Andy Whitcroft
     [not found]   ` <CGME20210824063513epcas5p46ba8b375c3e32fab210640a28041efb6@epcms5p3>
2021-09-10 12:45     ` Maninder Singh [this message]

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=20210910124532epcms5p3b63de3ee7ae2511817cb106c55a74946@epcms5p3 \
    --to=maninder1.s@samsung.com \
    --cc=a.sahrawat@samsung.com \
    --cc=apw@canonical.com \
    --cc=dwaipayanray1@gmail.com \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lukas.bulwahn@gmail.com \
    --cc=v.narang@samsung.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;
as well as URLs for NNTP newsgroup(s).