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: <20210927122138.56cb1d8e@oasis.local.home>
Date:   Mon, 27 Sep 2021 12:21:38 -0400
From:   Steven Rostedt <rostedt@...dmis.org>
To:     Chris Down <chris@...isdown.name>
Cc:     Arnd Bergmann <arnd@...nel.org>, Petr Mladek <pmladek@...e.com>,
        Sergey Senozhatsky <senozhatsky@...omium.org>,
        Andy Shevchenko <andy.shevchenko@...il.com>,
        Jessica Yu <jeyu@...nel.org>, Arnd Bergmann <arnd@...db.de>,
        John Ogness <john.ogness@...utronix.de>,
        Nathan Chancellor <nathan@...nel.org>,
        Nick Desaulniers <ndesaulniers@...gle.com>,
        YueHaibing <yuehaibing@...wei.com>, linux-kernel@...r.kernel.org,
        llvm@...ts.linux.dev
Subject: Re: [PATCH] printk: avoid -Wsometimes-uninitialized warning

On Mon, 27 Sep 2021 14:19:18 +0100
Chris Down <chris@...isdown.name> wrote:

> Having IS_ENABLED and then an #ifdef seems to hurt code readability to me.

I agree.

Would this be a better solution?

-- Steve

diff --git a/kernel/printk/index.c b/kernel/printk/index.c
index d3709408debe..ce3a0c8c5770 100644
--- a/kernel/printk/index.c
+++ b/kernel/printk/index.c
@@ -26,10 +26,10 @@ static struct pi_entry *pi_get_entry(const struct module *mod, loff_t pos)
 	if (mod) {
 		entries = mod->printk_index_start;
 		nr_entries = mod->printk_index_size;
-	}
+	} else
 #endif
+	{
 
-	if (!mod) {
 		/* vmlinux, comes from linker symbols */
 		entries = __start_printk_index;
 		nr_entries = __stop_printk_index - __start_printk_index;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ