[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240306092647.16010-1-chunhui.li@mediatek.com>
Date: Wed, 6 Mar 2024 17:26:47 +0800
From: Chunhui Li <chunhui.li@...iatek.com>
To: Petr Mladek <pmladek@...e.com>, Steven Rostedt <rostedt@...dmis.org>, John
Ogness <john.ogness@...utronix.de>, Sergey Senozhatsky
<senozhatsky@...omium.org>, Matthias Brugger <matthias.bgg@...il.com>,
AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>
CC: <linux-kernel@...r.kernel.org>, <linux-arm-kernel@...ts.infradead.org>,
<linux-mediatek@...ts.infradead.org>, <wsd_upstream@...iatek.com>, Chunhui Li
<chunhui.li@...iatek.com>
Subject: [PATCH] printk: fix _entry_ptr build warning
We build with Werror and suffer build error when
enable CONFIG_PRINTK_INDEX, such as
gfp.h:223:2: error: unused variable '_entry_ptr'
ratelimit.h:31:3: error: unused variable '_entry_ptr'
kallsyms.h:172:2: error: unused variable '_entry_ptr'
[-Werror,-Wunused-variable]
Fix the warning by appending __attribute__((unused)).
Signed-off-by: Chunhui Li <chunhui.li@...iatek.com>
---
include/linux/printk.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/printk.h b/include/linux/printk.h
index 8ef499ab3c1e..749c1c4257f1 100644
--- a/include/linux/printk.h
+++ b/include/linux/printk.h
@@ -392,7 +392,7 @@ struct pi_entry {
.level = __builtin_constant_p(_level) ? (_level) : NULL, \
.subsys_fmt_prefix = _subsys_fmt_prefix,\
}; \
- static const struct pi_entry *_entry_ptr \
+ static const struct pi_entry *_entry_ptr __attribute__((unused)) \
__used __section(".printk_index") = &_entry; \
} \
} while (0)
--
2.18.0
Powered by blists - more mailing lists