From: Fabio Aiuto <fabioaiuto83@gmail.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: joe@perches.com, julia.lawall@inria.fr,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: cocci script hints request
Date: Tue, 13 Apr 2021 11:24:56 +0200 [thread overview]
Message-ID: <20210413092455.GB5477@agape.jhs> (raw)
In-Reply-To: <YHVgSuRCW1fdabrH@kroah.com>
On Tue, Apr 13, 2021 at 11:11:38AM +0200, Greg KH wrote:
> On Tue, Apr 13, 2021 at 11:04:01AM +0200, Fabio Aiuto wrote:
> > Hi,
> >
> > I would like to improve the following coccinelle script:
> >
> > @@
> > expression a, fmt;
> > expression list var_args;
> > @@
> >
> > - DBG_871X_LEVEL(a, fmt, var_args);
> > + printk(fmt, var_args);
> >
> > I would replace the DBG_871X_LEVEL macro with printk,
>
> No you really do not, you want to change that to a dev_*() call instead
> depending on the "level" of the message.
>
> No "raw" printk() calls please, I will just reject them :)
>
> thanks,
>
> greg k-h
but there are very few occurences of DBG_871X_LEVEL in module init functions:
static int __init rtw_drv_entry(void)
{
int ret;
DBG_871X_LEVEL(_drv_always_, "module init start\n");
dump_drv_version(RTW_DBGDUMP);
#ifdef BTCOEXVERSION
DBG_871X_LEVEL(_drv_always_, "rtl8723bs BT-Coex version = %s\n", BTCOEXVERSION);
#endif /* BTCOEXVERSION */
sdio_drvpriv.drv_registered = true;
ret = sdio_register_driver(&sdio_drvpriv.r871xs_drv);
if (ret != 0) {
sdio_drvpriv.drv_registered = false;
rtw_ndev_notifier_unregister();
}
DBG_871X_LEVEL(_drv_always_, "module init ret =%d\n", ret);
return ret;
}
where I don't have a device available... shall I pass NULL to
first argument?
Another question: may I use netdev_dbg in case of rtl8723bs?
thank you,
fabio
next prev parent reply other threads:[~2021-04-13 9:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-13 9:04 cocci script hints request Fabio Aiuto
2021-04-13 9:11 ` Greg KH
2021-04-13 9:24 ` Fabio Aiuto [this message]
2021-04-13 9:42 ` Greg KH
2021-04-13 9:56 ` Julia Lawall
2021-04-13 10:07 ` Fabio Aiuto
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=20210413092455.GB5477@agape.jhs \
--to=fabioaiuto83@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=joe@perches.com \
--cc=julia.lawall@inria.fr \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
/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 read-only IMAP folder(s) and NNTP newsgroup(s).