lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220510132922.61883db0@gandalf.local.home>
Date:   Tue, 10 May 2022 13:29:22 -0400
From:   Steven Rostedt <rostedt@...dmis.org>
To:     Xiaoming Ni <nixiaoming@...wei.com>
Cc:     "Guilherme G. Piccoli" <gpiccoli@...lia.com>,
        <akpm@...ux-foundation.org>, <bhe@...hat.com>, <pmladek@...e.com>,
        <kexec@...ts.infradead.org>, <linux-kernel@...r.kernel.org>,
        <bcm-kernel-feedback-list@...adcom.com>,
        <coresight@...ts.linaro.org>, <linuxppc-dev@...ts.ozlabs.org>,
        <linux-alpha@...r.kernel.org>,
        <linux-arm-kernel@...ts.infradead.org>,
        <linux-edac@...r.kernel.org>, <linux-hyperv@...r.kernel.org>,
        <linux-leds@...r.kernel.org>, <linux-mips@...r.kernel.org>,
        <linux-parisc@...r.kernel.org>, <linux-pm@...r.kernel.org>,
        <linux-remoteproc@...r.kernel.org>, <linux-s390@...r.kernel.org>,
        <linux-tegra@...r.kernel.org>, <linux-um@...ts.infradead.org>,
        <linux-xtensa@...ux-xtensa.org>, <netdev@...r.kernel.org>,
        <openipmi-developer@...ts.sourceforge.net>, <rcu@...r.kernel.org>,
        <sparclinux@...r.kernel.org>, <xen-devel@...ts.xenproject.org>,
        <x86@...nel.org>, <kernel-dev@...lia.com>, <kernel@...ccoli.net>,
        <halves@...onical.com>, <fabiomirmar@...il.com>,
        <alejandro.j.jimenez@...cle.com>,
        <andriy.shevchenko@...ux.intel.com>, <arnd@...db.de>,
        <bp@...en8.de>, <corbet@....net>, <d.hatayama@...fujitsu.com>,
        <dave.hansen@...ux.intel.com>, <dyoung@...hat.com>,
        <feng.tang@...el.com>, <gregkh@...uxfoundation.org>,
        <mikelley@...rosoft.com>, <hidehiro.kawai.ez@...achi.com>,
        <jgross@...e.com>, <john.ogness@...utronix.de>,
        <keescook@...omium.org>, <luto@...nel.org>, <mhiramat@...nel.org>,
        <mingo@...hat.com>, <paulmck@...nel.org>, <peterz@...radead.org>,
        <senozhatsky@...omium.org>, <stern@...land.harvard.edu>,
        <tglx@...utronix.de>, <vgoyal@...hat.com>, <vkuznets@...hat.com>,
        <will@...nel.org>, Arjan van de Ven <arjan@...ux.intel.com>,
        Cong Wang <xiyou.wangcong@...il.com>,
        Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
        Valentin Schneider <valentin.schneider@....com>
Subject: Re: [PATCH 18/30] notifier: Show function names on notifier
 routines if DEBUG_NOTIFIERS is set

On Thu, 28 Apr 2022 09:01:13 +0800
Xiaoming Ni <nixiaoming@...wei.com> wrote:

> > +#ifdef CONFIG_DEBUG_NOTIFIERS
> > +	{
> > +		char sym_name[KSYM_NAME_LEN];
> > +
> > +		pr_info("notifiers: registered %s()\n",
> > +			notifier_name(n, sym_name));
> > +	}  
> 
> Duplicate Code.
> 
> Is it better to use __func__ and %pS?
> 
> pr_info("%s: %pS\n", __func__, n->notifier_call);
> 
> 
> > +#endif

Also, don't sprinkle #ifdef in C code. Instead:

	if (IS_ENABLED(CONFIG_DEBUG_NOTIFIERS))
		pr_info("notifers: regsiter %ps()\n",
			n->notifer_call);


Or define a print macro at the start of the C file that is a nop if it is
not defined, and use the macro.

-- Steve

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ