* linux-next: build warning after merge of the printk tree
@ 2018-07-10 6:45 Stephen Rothwell
[not found] ` <CGME20180710064527epcas1p16fd9ad765711d69264b3251890bbcc2e@epcms5p5>
0 siblings, 1 reply; 13+ messages in thread
From: Stephen Rothwell @ 2018-07-10 6:45 UTC (permalink / raw)
To: Petr Mladek
Cc: Linux-Next Mailing List, Linux Kernel Mailing List, Maninder Singh
[-- Attachment #1: Type: text/plain, Size: 458 bytes --]
Hi all,
After merging the printk tree, today's linux-next build (x86_64
allnoconfig) produced this warning:
kernel/printk/printk.c:2033:13: warning: 'suppress_message_printing' defined but not used [-Wunused-function]
static bool suppress_message_printing(int level) { return false; }
^~~~~~~~~~~~~~~~~~~~~~~~~
Introduced by commit
375899cddcbb ("printk: make sure to print log on console.")
--
Cheers,
Stephen Rothwell
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
* RE: linux-next: build warning after merge of the printk tree
[not found] ` <CGME20180710064527epcas1p16fd9ad765711d69264b3251890bbcc2e@epcms5p5>
@ 2018-07-10 7:16 ` Maninder Singh
2018-07-10 9:19 ` Petr Mladek
0 siblings, 1 reply; 13+ messages in thread
From: Maninder Singh @ 2018-07-10 7:16 UTC (permalink / raw)
To: Stephen Rothwell, Petr Mladek
Cc: Linux-Next Mailing List, Linux Kernel Mailing List,
Vaneet Narang, PANKAJ MISHRA
[-- Attachment #1: Type: text/plain, Size: 736 bytes --]
Hi Petr,
> Hi all,
> After merging the printk tree, today's linux-next build (x86_64
> allnoconfig) produced this warning:
> kernel/printk/printk.c:2033:13: warning: 'suppress_message_printing' defined but not used [-Wunused-function]
> static bool suppress_message_printing(int level) { return false; }
^~~~~~~~~~~~~~~~~~~~~~~~~
seems there is no user for suppress_message_printing when CONFIG_PRINTK is disabled,
because earlier it was getting used in console_unlock and now we shifted this into vprintk_emit
which will be disabled on disabling CONFIG_PRINTk.
should we remove this defination when CONFIG_PRINTK is disabled ?
> Introduced by commit
> 375899cddcbb ("printk: make sure to print log on console.")
[-- Attachment #2: No File Name 0 --]
[-- Type: application/octet-stream, Size: 499 bytes --]
-----BEGIN PGP SIGNATURE-----
iQEzBAEBCAAdFiEENIC96giZ81tWdLgKAVBC80lX0GwFAltEVfoACgkQAVBC80lX
0GxQTwf9EZwdtrXMLQwD1/qJOadRHs1fyvT5nyUdMbCPctaMkdIm4Nsyx1lai8r/
oFMjjlMqmwO+YqneRwojhv+nAZ77+CtBURnV7k2riazf3mHcrUjHCzfQ2el5Fgsj
6p3Yaowl45+lTVYa9uEZxs59QWWFrZnfPKdDk8jDFeFppG1N3UHr9rQJm9pis6TA
9rZFucyeWAZAe7wMkbpeKPl8whpVUPXxwDgtgIjiotVg5tKluC7RNcQwLzMbBH0o
u2haX3SDfeqOdxi05Weh4QIXKo7kFAyX3os+wyyUPoIv40uWuhLAf1I6WhdPBdbi
gLCiuK5xrnNYmgxURg7moHUQ+0PzDw==
=bSrM
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: linux-next: build warning after merge of the printk tree
2018-07-10 7:16 ` Maninder Singh
@ 2018-07-10 9:19 ` Petr Mladek
0 siblings, 0 replies; 13+ messages in thread
From: Petr Mladek @ 2018-07-10 9:19 UTC (permalink / raw)
To: Maninder Singh
Cc: Stephen Rothwell, Linux-Next Mailing List,
Linux Kernel Mailing List, Vaneet Narang, PANKAJ MISHRA
On Tue 2018-07-10 12:46:14, Maninder Singh wrote:
> Hi Petr,
>
> > Hi all,
>
> > After merging the printk tree, today's linux-next build (x86_64
> > allnoconfig) produced this warning:
>
> > kernel/printk/printk.c:2033:13: warning: 'suppress_message_printing' defined but not used [-Wunused-function]
> > static bool suppress_message_printing(int level) { return false; }
> ^~~~~~~~~~~~~~~~~~~~~~~~~
>
> seems there is no user for suppress_message_printing when CONFIG_PRINTK is disabled,
> because earlier it was getting used in console_unlock and now we shifted this into vprintk_emit
> which will be disabled on disabling CONFIG_PRINTk.
>
> should we remove this defination when CONFIG_PRINTK is disabled ?
>
> > Introduced by commit
> > 375899cddcbb ("printk: make sure to print log on console.")
Grr, I wonder how I missed it. I usually try build with CONFIG_PRINTK
disabled.
Anyway, I have just pushed the following patch into printk.git,
branch for-4.19:
From 7b83946e61a1e4a080d48c24396aeb18b6366203 Mon Sep 17 00:00:00 2001
From: Petr Mladek <pmladek@suse.com>
Date: Tue, 10 Jul 2018 10:44:53 +0200
Subject: [PATCH] printk: Fix warning about unused suppress_message_printing
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
suppress_message_printing() is not longer called in console_unlock().
Therefore it is not longer needed with disabled CONFIG_PRINTK.
This fixes the warning:
kernel/printk/printk.c:2033:13: warning: ‘suppress_message_printing’ defined but not used [-Wunused-function]
static bool suppress_message_printing(int level) { return false; }
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Suggested-by: Maninder Singh <maninder1.s@samsung.com>
Signed-off-by: Petr Mladek <pmladek@suse.com>
---
kernel/printk/printk.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index fcc1992c040a..e2cb0fc18e2d 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -2021,7 +2021,6 @@ static void call_console_drivers(const char *ext_text, size_t ext_len,
const char *text, size_t len) {}
static size_t msg_print_text(const struct printk_log *msg,
bool syslog, char *buf, size_t size) { return 0; }
-static bool suppress_message_printing(int level) { return false; }
#endif /* CONFIG_PRINTK */
--
2.13.7
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: linux-next: build warning after merge of the printk tree
@ 2018-07-10 9:19 ` Petr Mladek
0 siblings, 0 replies; 13+ messages in thread
From: Petr Mladek @ 2018-07-10 9:19 UTC (permalink / raw)
To: Maninder Singh
Cc: Stephen Rothwell, Linux-Next Mailing List,
Linux Kernel Mailing List, Vaneet Narang, PANKAJ MISHRA
On Tue 2018-07-10 12:46:14, Maninder Singh wrote:
> Hi Petr,
>
> > Hi all,
>
> > After merging the printk tree, today's linux-next build (x86_64
> > allnoconfig) produced this warning:
>
> > kernel/printk/printk.c:2033:13: warning: 'suppress_message_printing' defined but not used [-Wunused-function]
> > static bool suppress_message_printing(int level) { return false; }
> ^~~~~~~~~~~~~~~~~~~~~~~~~
>
> seems there is no user for suppress_message_printing when CONFIG_PRINTK is disabled,
> because earlier it was getting used in console_unlock and now we shifted this into vprintk_emit
> which will be disabled on disabling CONFIG_PRINTk.
>
> should we remove this defination when CONFIG_PRINTK is disabled ?
>
> > Introduced by commit
> > 375899cddcbb ("printk: make sure to print log on console.")
Grr, I wonder how I missed it. I usually try build with CONFIG_PRINTK
disabled.
Anyway, I have just pushed the following patch into printk.git,
branch for-4.19:
>From 7b83946e61a1e4a080d48c24396aeb18b6366203 Mon Sep 17 00:00:00 2001
From: Petr Mladek <pmladek@suse.com>
Date: Tue, 10 Jul 2018 10:44:53 +0200
Subject: [PATCH] printk: Fix warning about unused suppress_message_printing
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
suppress_message_printing() is not longer called in console_unlock().
Therefore it is not longer needed with disabled CONFIG_PRINTK.
This fixes the warning:
kernel/printk/printk.c:2033:13: warning: ‘suppress_message_printing’ defined but not used [-Wunused-function]
static bool suppress_message_printing(int level) { return false; }
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Suggested-by: Maninder Singh <maninder1.s@samsung.com>
Signed-off-by: Petr Mladek <pmladek@suse.com>
---
kernel/printk/printk.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index fcc1992c040a..e2cb0fc18e2d 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -2021,7 +2021,6 @@ static void call_console_drivers(const char *ext_text, size_t ext_len,
const char *text, size_t len) {}
static size_t msg_print_text(const struct printk_log *msg,
bool syslog, char *buf, size_t size) { return 0; }
-static bool suppress_message_printing(int level) { return false; }
#endif /* CONFIG_PRINTK */
--
2.13.7
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH] printk: Fix warning about unused suppress_message_printing
2018-07-10 9:19 ` Petr Mladek
(?)
@ 2018-07-10 11:53 ` kbuild test robot
-1 siblings, 0 replies; 13+ messages in thread
From: kbuild test robot @ 2018-07-10 11:53 UTC (permalink / raw)
To: Petr Mladek
Cc: kbuild-all, Maninder Singh, Stephen Rothwell,
Linux-Next Mailing List, Linux Kernel Mailing List,
Vaneet Narang, PANKAJ MISHRA
[-- Attachment #1: Type: text/plain, Size: 17474 bytes --]
Hi Petr,
I love your patch! Yet something to improve:
[auto build test ERROR on linus/master]
[also build test ERROR on v4.18-rc4 next-20180709]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Petr-Mladek/printk-Fix-warning-about-unused-suppress_message_printing/20180710-174802
config: ia64-allnoconfig (attached as .config)
compiler: ia64-linux-gcc (GCC) 8.1.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
GCC_VERSION=8.1.0 make.cross ARCH=ia64
All errors (new ones prefixed by >>):
kernel/printk/printk.c: In function 'console_unlock':
>> kernel/printk/printk.c:2351:7: error: implicit declaration of function 'suppress_message_printing' [-Werror=implicit-function-declaration]
if (suppress_message_printing(msg->level)) {
^~~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +/suppress_message_printing +2351 kernel/printk/printk.c
a8199371a kernel/printk/printk.c Sergey Senozhatsky 2016-03-17 2273
^1da177e4 kernel/printk.c Linus Torvalds 2005-04-16 2274 /**
ac751efa6 kernel/printk.c Torben Hohn 2011-01-25 2275 * console_unlock - unlock the console system
^1da177e4 kernel/printk.c Linus Torvalds 2005-04-16 2276 *
ac751efa6 kernel/printk.c Torben Hohn 2011-01-25 2277 * Releases the console_lock which the caller holds on the console system
^1da177e4 kernel/printk.c Linus Torvalds 2005-04-16 2278 * and the console driver list.
^1da177e4 kernel/printk.c Linus Torvalds 2005-04-16 2279 *
ac751efa6 kernel/printk.c Torben Hohn 2011-01-25 2280 * While the console_lock was held, console output may have been buffered
ac751efa6 kernel/printk.c Torben Hohn 2011-01-25 2281 * by printk(). If this is the case, console_unlock(); emits
ac751efa6 kernel/printk.c Torben Hohn 2011-01-25 2282 * the output prior to releasing the lock.
^1da177e4 kernel/printk.c Linus Torvalds 2005-04-16 2283 *
7f3a781d6 kernel/printk.c Kay Sievers 2012-05-09 2284 * If there is output waiting, we wake /dev/kmsg and syslog() users.
^1da177e4 kernel/printk.c Linus Torvalds 2005-04-16 2285 *
ac751efa6 kernel/printk.c Torben Hohn 2011-01-25 2286 * console_unlock(); may be called from any context.
^1da177e4 kernel/printk.c Linus Torvalds 2005-04-16 2287 */
ac751efa6 kernel/printk.c Torben Hohn 2011-01-25 2288 void console_unlock(void)
^1da177e4 kernel/printk.c Linus Torvalds 2005-04-16 2289 {
6fe29354b kernel/printk/printk.c Tejun Heo 2015-06-25 2290 static char ext_text[CONSOLE_EXT_LOG_MAX];
704982531 kernel/printk.c Kay Sievers 2012-07-16 2291 static char text[LOG_LINE_MAX + PREFIX_MAX];
^1da177e4 kernel/printk.c Linus Torvalds 2005-04-16 2292 unsigned long flags;
8d91f8b15 kernel/printk/printk.c Tejun Heo 2016-01-15 2293 bool do_cond_resched, retry;
^1da177e4 kernel/printk.c Linus Torvalds 2005-04-16 2294
557240b48 kernel/printk.c Linus Torvalds 2006-06-19 2295 if (console_suspended) {
bd8d7cf5b kernel/printk/printk.c Jan Kara 2014-06-04 2296 up_console_sem();
557240b48 kernel/printk.c Linus Torvalds 2006-06-19 2297 return;
557240b48 kernel/printk.c Linus Torvalds 2006-06-19 2298 }
78944e549 kernel/printk.c Antonino A. Daplas 2006-08-05 2299
8d91f8b15 kernel/printk/printk.c Tejun Heo 2016-01-15 2300 /*
257ab4431 kernel/printk/printk.c Petr Mladek 2017-03-24 2301 * Console drivers are called with interrupts disabled, so
8d91f8b15 kernel/printk/printk.c Tejun Heo 2016-01-15 2302 * @console_may_schedule should be cleared before; however, we may
8d91f8b15 kernel/printk/printk.c Tejun Heo 2016-01-15 2303 * end up dumping a lot of lines, for example, if called from
8d91f8b15 kernel/printk/printk.c Tejun Heo 2016-01-15 2304 * console registration path, and should invoke cond_resched()
8d91f8b15 kernel/printk/printk.c Tejun Heo 2016-01-15 2305 * between lines if allowable. Not doing so can cause a very long
8d91f8b15 kernel/printk/printk.c Tejun Heo 2016-01-15 2306 * scheduling stall on a slow console leading to RCU stall and
8d91f8b15 kernel/printk/printk.c Tejun Heo 2016-01-15 2307 * softlockup warnings which exacerbate the issue with more
8d91f8b15 kernel/printk/printk.c Tejun Heo 2016-01-15 2308 * messages practically incapacitating the system.
257ab4431 kernel/printk/printk.c Petr Mladek 2017-03-24 2309 *
257ab4431 kernel/printk/printk.c Petr Mladek 2017-03-24 2310 * console_trylock() is not able to detect the preemptive
257ab4431 kernel/printk/printk.c Petr Mladek 2017-03-24 2311 * context reliably. Therefore the value must be stored before
257ab4431 kernel/printk/printk.c Petr Mladek 2017-03-24 2312 * and cleared after the the "again" goto label.
8d91f8b15 kernel/printk/printk.c Tejun Heo 2016-01-15 2313 */
8d91f8b15 kernel/printk/printk.c Tejun Heo 2016-01-15 2314 do_cond_resched = console_may_schedule;
257ab4431 kernel/printk/printk.c Petr Mladek 2017-03-24 2315 again:
78944e549 kernel/printk.c Antonino A. Daplas 2006-08-05 2316 console_may_schedule = 0;
78944e549 kernel/printk.c Antonino A. Daplas 2006-08-05 2317
a8199371a kernel/printk/printk.c Sergey Senozhatsky 2016-03-17 2318 /*
a8199371a kernel/printk/printk.c Sergey Senozhatsky 2016-03-17 2319 * We released the console_sem lock, so we need to recheck if
a8199371a kernel/printk/printk.c Sergey Senozhatsky 2016-03-17 2320 * cpu is online and (if not) is there at least one CON_ANYTIME
a8199371a kernel/printk/printk.c Sergey Senozhatsky 2016-03-17 2321 * console.
a8199371a kernel/printk/printk.c Sergey Senozhatsky 2016-03-17 2322 */
a8199371a kernel/printk/printk.c Sergey Senozhatsky 2016-03-17 2323 if (!can_use_console()) {
a8199371a kernel/printk/printk.c Sergey Senozhatsky 2016-03-17 2324 console_locked = 0;
a8199371a kernel/printk/printk.c Sergey Senozhatsky 2016-03-17 2325 up_console_sem();
a8199371a kernel/printk/printk.c Sergey Senozhatsky 2016-03-17 2326 return;
a8199371a kernel/printk/printk.c Sergey Senozhatsky 2016-03-17 2327 }
a8199371a kernel/printk/printk.c Sergey Senozhatsky 2016-03-17 2328
^1da177e4 kernel/printk.c Linus Torvalds 2005-04-16 2329 for (;;) {
62e32ac35 kernel/printk/printk.c Joe Perches 2013-07-31 2330 struct printk_log *msg;
6fe29354b kernel/printk/printk.c Tejun Heo 2015-06-25 2331 size_t ext_len = 0;
3ce9a7c0a kernel/printk.c Kay Sievers 2012-05-13 2332 size_t len;
7ff9554bb kernel/printk.c Kay Sievers 2012-05-03 2333
f975237b7 kernel/printk/printk.c Sergey Senozhatsky 2016-12-27 2334 printk_safe_enter_irqsave(flags);
f975237b7 kernel/printk/printk.c Sergey Senozhatsky 2016-12-27 2335 raw_spin_lock(&logbuf_lock);
7ff9554bb kernel/printk.c Kay Sievers 2012-05-03 2336 if (console_seq < log_first_seq) {
9afe77ed8 kernel/printk/printk.c Maxim Akristiniy 2017-10-23 2337 len = sprintf(text, "** %u printk messages dropped **\n",
84b5ec8a9 kernel/printk/printk.c Will Deacon 2014-06-04 2338 (unsigned)(log_first_seq - console_seq));
84b5ec8a9 kernel/printk/printk.c Will Deacon 2014-06-04 2339
7ff9554bb kernel/printk.c Kay Sievers 2012-05-03 2340 /* messages are gone, move to first one */
7ff9554bb kernel/printk.c Kay Sievers 2012-05-03 2341 console_seq = log_first_seq;
7ff9554bb kernel/printk.c Kay Sievers 2012-05-03 2342 console_idx = log_first_idx;
84b5ec8a9 kernel/printk/printk.c Will Deacon 2014-06-04 2343 } else {
84b5ec8a9 kernel/printk/printk.c Will Deacon 2014-06-04 2344 len = 0;
7ff9554bb kernel/printk.c Kay Sievers 2012-05-03 2345 }
084681d14 kernel/printk.c Kay Sievers 2012-06-28 2346 skip:
7ff9554bb kernel/printk.c Kay Sievers 2012-05-03 2347 if (console_seq == log_next_seq)
7ff9554bb kernel/printk.c Kay Sievers 2012-05-03 2348 break;
7ff9554bb kernel/printk.c Kay Sievers 2012-05-03 2349
7ff9554bb kernel/printk.c Kay Sievers 2012-05-03 2350 msg = log_from_idx(console_idx);
d9c23523e kernel/printk/printk.c Sergey Senozhatsky 2016-12-24 @2351 if (suppress_message_printing(msg->level)) {
084681d14 kernel/printk.c Kay Sievers 2012-06-28 2352 /*
084681d14 kernel/printk.c Kay Sievers 2012-06-28 2353 * Skip record we have buffered and already printed
cf7754441 kernel/printk/printk.c Sergey Senozhatsky 2016-08-02 2354 * directly to the console when we received it, and
cf7754441 kernel/printk/printk.c Sergey Senozhatsky 2016-08-02 2355 * record that has level above the console loglevel.
084681d14 kernel/printk.c Kay Sievers 2012-06-28 2356 */
084681d14 kernel/printk.c Kay Sievers 2012-06-28 2357 console_idx = log_next(console_idx);
084681d14 kernel/printk.c Kay Sievers 2012-06-28 2358 console_seq++;
084681d14 kernel/printk.c Kay Sievers 2012-06-28 2359 goto skip;
084681d14 kernel/printk.c Kay Sievers 2012-06-28 2360 }
649e6ee33 kernel/printk.c Kay Sievers 2012-05-10 2361
cca10d58d kernel/printk/printk.c Sergey Senozhatsky 2017-12-21 2362 len += msg_print_text(msg,
cca10d58d kernel/printk/printk.c Sergey Senozhatsky 2017-12-21 2363 console_msg_format & MSG_FORMAT_SYSLOG,
cca10d58d kernel/printk/printk.c Sergey Senozhatsky 2017-12-21 2364 text + len,
cca10d58d kernel/printk/printk.c Sergey Senozhatsky 2017-12-21 2365 sizeof(text) - len);
6fe29354b kernel/printk/printk.c Tejun Heo 2015-06-25 2366 if (nr_ext_console_drivers) {
6fe29354b kernel/printk/printk.c Tejun Heo 2015-06-25 2367 ext_len = msg_print_ext_header(ext_text,
6fe29354b kernel/printk/printk.c Tejun Heo 2015-06-25 2368 sizeof(ext_text),
5aa068ea4 kernel/printk/printk.c Linus Torvalds 2016-10-25 2369 msg, console_seq);
6fe29354b kernel/printk/printk.c Tejun Heo 2015-06-25 2370 ext_len += msg_print_ext_body(ext_text + ext_len,
6fe29354b kernel/printk/printk.c Tejun Heo 2015-06-25 2371 sizeof(ext_text) - ext_len,
6fe29354b kernel/printk/printk.c Tejun Heo 2015-06-25 2372 log_dict(msg), msg->dict_len,
6fe29354b kernel/printk/printk.c Tejun Heo 2015-06-25 2373 log_text(msg), msg->text_len);
6fe29354b kernel/printk/printk.c Tejun Heo 2015-06-25 2374 }
7ff9554bb kernel/printk.c Kay Sievers 2012-05-03 2375 console_idx = log_next(console_idx);
7ff9554bb kernel/printk.c Kay Sievers 2012-05-03 2376 console_seq++;
07354eb1a kernel/printk.c Thomas Gleixner 2009-07-25 2377 raw_spin_unlock(&logbuf_lock);
7ff9554bb kernel/printk.c Kay Sievers 2012-05-03 2378
dbdda842f kernel/printk/printk.c Steven Rostedt (VMware 2018-01-10 2379) /*
dbdda842f kernel/printk/printk.c Steven Rostedt (VMware 2018-01-10 2380) * While actively printing out messages, if another printk()
dbdda842f kernel/printk/printk.c Steven Rostedt (VMware 2018-01-10 2381) * were to occur on another CPU, it may wait for this one to
dbdda842f kernel/printk/printk.c Steven Rostedt (VMware 2018-01-10 2382) * finish. This task can not be preempted if there is a
dbdda842f kernel/printk/printk.c Steven Rostedt (VMware 2018-01-10 2383) * waiter waiting to take over.
dbdda842f kernel/printk/printk.c Steven Rostedt (VMware 2018-01-10 2384) */
c162d5b43 kernel/printk/printk.c Petr Mladek 2018-01-12 2385 console_lock_spinning_enable();
dbdda842f kernel/printk/printk.c Steven Rostedt (VMware 2018-01-10 2386)
81d68a96a kernel/printk.c Steven Rostedt 2008-05-12 2387 stop_critical_timings(); /* don't trace print latency */
d9c23523e kernel/printk/printk.c Sergey Senozhatsky 2016-12-24 2388 call_console_drivers(ext_text, ext_len, text, len);
81d68a96a kernel/printk.c Steven Rostedt 2008-05-12 2389 start_critical_timings();
dbdda842f kernel/printk/printk.c Steven Rostedt (VMware 2018-01-10 2390)
c162d5b43 kernel/printk/printk.c Petr Mladek 2018-01-12 2391 if (console_lock_spinning_disable_and_check()) {
c162d5b43 kernel/printk/printk.c Petr Mladek 2018-01-12 2392 printk_safe_exit_irqrestore(flags);
43a17111c kernel/printk/printk.c Sergey Senozhatsky 2018-04-19 2393 return;
c162d5b43 kernel/printk/printk.c Petr Mladek 2018-01-12 2394 }
dbdda842f kernel/printk/printk.c Steven Rostedt (VMware 2018-01-10 2395)
f975237b7 kernel/printk/printk.c Sergey Senozhatsky 2016-12-27 2396 printk_safe_exit_irqrestore(flags);
8d91f8b15 kernel/printk/printk.c Tejun Heo 2016-01-15 2397
8d91f8b15 kernel/printk/printk.c Tejun Heo 2016-01-15 2398 if (do_cond_resched)
8d91f8b15 kernel/printk/printk.c Tejun Heo 2016-01-15 2399 cond_resched();
^1da177e4 kernel/printk.c Linus Torvalds 2005-04-16 2400 }
dbdda842f kernel/printk/printk.c Steven Rostedt (VMware 2018-01-10 2401)
^1da177e4 kernel/printk.c Linus Torvalds 2005-04-16 2402 console_locked = 0;
fe3d8ad31 kernel/printk.c Feng Tang 2011-03-22 2403
fe3d8ad31 kernel/printk.c Feng Tang 2011-03-22 2404 /* Release the exclusive_console once it is used */
fe3d8ad31 kernel/printk.c Feng Tang 2011-03-22 2405 if (unlikely(exclusive_console))
fe3d8ad31 kernel/printk.c Feng Tang 2011-03-22 2406 exclusive_console = NULL;
fe3d8ad31 kernel/printk.c Feng Tang 2011-03-22 2407
07354eb1a kernel/printk.c Thomas Gleixner 2009-07-25 2408 raw_spin_unlock(&logbuf_lock);
4f2a8d3cf kernel/printk.c Peter Zijlstra 2011-06-22 2409
bd8d7cf5b kernel/printk/printk.c Jan Kara 2014-06-04 2410 up_console_sem();
4f2a8d3cf kernel/printk.c Peter Zijlstra 2011-06-22 2411
4f2a8d3cf kernel/printk.c Peter Zijlstra 2011-06-22 2412 /*
4f2a8d3cf kernel/printk.c Peter Zijlstra 2011-06-22 2413 * Someone could have filled up the buffer again, so re-check if there's
4f2a8d3cf kernel/printk.c Peter Zijlstra 2011-06-22 2414 * something to flush. In case we cannot trylock the console_sem again,
4f2a8d3cf kernel/printk.c Peter Zijlstra 2011-06-22 2415 * there's a new owner and the console_unlock() from them will do the
4f2a8d3cf kernel/printk.c Peter Zijlstra 2011-06-22 2416 * flush, no worries.
4f2a8d3cf kernel/printk.c Peter Zijlstra 2011-06-22 2417 */
07354eb1a kernel/printk.c Thomas Gleixner 2009-07-25 2418 raw_spin_lock(&logbuf_lock);
7ff9554bb kernel/printk.c Kay Sievers 2012-05-03 2419 retry = console_seq != log_next_seq;
f975237b7 kernel/printk/printk.c Sergey Senozhatsky 2016-12-27 2420 raw_spin_unlock(&logbuf_lock);
f975237b7 kernel/printk/printk.c Sergey Senozhatsky 2016-12-27 2421 printk_safe_exit_irqrestore(flags);
09dc3cf93 kernel/printk.c Peter Zijlstra 2011-12-08 2422
4f2a8d3cf kernel/printk.c Peter Zijlstra 2011-06-22 2423 if (retry && console_trylock())
4f2a8d3cf kernel/printk.c Peter Zijlstra 2011-06-22 2424 goto again;
^1da177e4 kernel/printk.c Linus Torvalds 2005-04-16 2425 }
ac751efa6 kernel/printk.c Torben Hohn 2011-01-25 2426 EXPORT_SYMBOL(console_unlock);
^1da177e4 kernel/printk.c Linus Torvalds 2005-04-16 2427
:::::: The code at line 2351 was first introduced by commit
:::::: d9c23523ed98a3acaa0bfd8fef143595d6aa631d printk: drop call_console_drivers() unused param
:::::: TO: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
:::::: CC: Petr Mladek <pmladek@suse.com>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 5528 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: linux-next: build warning after merge of the printk tree
2018-07-10 9:19 ` Petr Mladek
(?)
(?)
@ 2018-07-10 13:15 ` Sergey Senozhatsky
-1 siblings, 0 replies; 13+ messages in thread
From: Sergey Senozhatsky @ 2018-07-10 13:15 UTC (permalink / raw)
To: Petr Mladek
Cc: Maninder Singh, Stephen Rothwell, Linux-Next Mailing List,
Linux Kernel Mailing List, Vaneet Narang, PANKAJ MISHRA
On (07/10/18 11:19), Petr Mladek wrote:
> suppress_message_printing() is not longer called in console_unlock().
> Therefore it is not longer needed with disabled CONFIG_PRINTK.
>
> This fixes the warning:
>
> kernel/printk/printk.c:2033:13: warning: ‘suppress_message_printing’ defined but not used [-Wunused-function]
> static bool suppress_message_printing(int level) { return false; }
>
> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> Suggested-by: Maninder Singh <maninder1.s@samsung.com>
> Signed-off-by: Petr Mladek <pmladek@suse.com>
Acked-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Happens all the time to me as well. I'd rather remove CONFIG_PRINTK
at this point ;)
-ss
^ permalink raw reply [flat|nested] 13+ messages in thread
* linux-next: build warning after merge of the printk tree
@ 2022-11-22 7:10 Stephen Rothwell
0 siblings, 0 replies; 13+ messages in thread
From: Stephen Rothwell @ 2022-11-22 7:10 UTC (permalink / raw)
To: Petr Mladek
Cc: John Ogness, Linux Kernel Mailing List, Linux Next Mailing List
[-- Attachment #1: Type: text/plain, Size: 354 bytes --]
Hi all,
After merging the printk tree, today's linux-next build (htmldocs)
produced this warning:
kernel/printk/printk.c:298: warning: Function parameter or member 'cookie' not described in 'console_srcu_read_unlock'
Introduced by commit
8bdbdd7f43cd ("printk: Prepare for SRCU console list protection")
--
Cheers,
Stephen Rothwell
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: linux-next: build warning after merge of the printk tree
2021-07-25 21:16 ` Jonathan Corbet
2021-07-26 12:28 ` Petr Mladek
@ 2021-07-26 13:07 ` Chris Down
1 sibling, 0 replies; 13+ messages in thread
From: Chris Down @ 2021-07-26 13:07 UTC (permalink / raw)
To: Jonathan Corbet
Cc: Stephen Rothwell, linux-doc, Petr Mladek,
Linux Kernel Mailing List, Linux Next Mailing List
Jonathan Corbet writes:
>The problem is that you moved printk(), but left the associated
>kerneldoc comment tied to _printk(), which isn't what you really want to
>document. The fix should look something like the attached.
Ah, I see. Thank you for your help!
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: linux-next: build warning after merge of the printk tree
2021-07-25 21:16 ` Jonathan Corbet
@ 2021-07-26 12:28 ` Petr Mladek
2021-07-26 13:07 ` Chris Down
1 sibling, 0 replies; 13+ messages in thread
From: Petr Mladek @ 2021-07-26 12:28 UTC (permalink / raw)
To: Jonathan Corbet
Cc: Chris Down, Stephen Rothwell, linux-doc,
Linux Kernel Mailing List, Linux Next Mailing List
On Sun 2021-07-25 15:16:00, Jonathan Corbet wrote:
> Chris Down <chris@chrisdown.name> writes:
>
> > Chris Down writes:
> >>+Cc: Jonathan Corbet <corbet@lwn.net>, linux-doc@vger.kernel.org
> >
> > Well, let's actually Cc them this time...
> >
> >>Stephen Rothwell writes:
> >>>After merging the printk tree, today's linux-next build (htmldocs)
> >>>produced this warning:
> >>>
> >>>kernel/printk/printk.c:1: warning: 'printk' not found
> >>>
> >>>Introduced by commit
> >>>
> >>> 337015573718 ("printk: Userspace format indexing support")
> >>>
> >>>I presume that "printk" is referred to elsewhere in the documentation
> >>>as being in this file.
> >>
> >>Hmm, this is an interesting one, because I think we still generally
> >>just want to refer to the API as being `printk()`. Changing it all
> >>over the place seems wrong. As you'd imagine, there are quite a few
> >>references to this name, so it requires a lot of noise all over the
> >>docs and inline comments.
> >>
> >>Jonathan and other docs folks, how can one tell Sphinx that when it
> >>sees printk() it's referring to a function-like macro, or otherwise
> >>squelch this reasonably? :-)
>
> The problem is that you moved printk(), but left the associated
> kerneldoc comment tied to _printk(), which isn't what you really want to
> document. The fix should look something like the attached.
>
> Thanks,
>
> jon
>
> --------snip here----------------------
> printk: Move the printk() kerneldoc comment to its new home
>
> Commit 337015573718 ("printk: Userspace format indexing support") turned
> printk() into a macro, but left the kerneldoc comment for it with the (now)
> _printk() function, resulting in this docs-build warning:
>
> kernel/printk/printk.c:1: warning: 'printk' not found
>
> Move the kerneldoc comment back next to the (now) macro it's meant to
> describe and have the docs build find it there.
>
> Signed-off-by: Jonathan Corbet <corbet@lwn.net>
This looks better than my variant. I have pushed it into
printk/linux.git, branch for-5.15-printk-index.
Best Regards,
Petr
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: linux-next: build warning after merge of the printk tree
2021-07-20 12:22 ` Chris Down
@ 2021-07-25 21:16 ` Jonathan Corbet
2021-07-26 12:28 ` Petr Mladek
2021-07-26 13:07 ` Chris Down
0 siblings, 2 replies; 13+ messages in thread
From: Jonathan Corbet @ 2021-07-25 21:16 UTC (permalink / raw)
To: Chris Down, Stephen Rothwell
Cc: linux-doc, Petr Mladek, Linux Kernel Mailing List,
Linux Next Mailing List
Chris Down <chris@chrisdown.name> writes:
> Chris Down writes:
>>+Cc: Jonathan Corbet <corbet@lwn.net>, linux-doc@vger.kernel.org
>
> Well, let's actually Cc them this time...
>
>>Stephen Rothwell writes:
>>>After merging the printk tree, today's linux-next build (htmldocs)
>>>produced this warning:
>>>
>>>kernel/printk/printk.c:1: warning: 'printk' not found
>>>
>>>Introduced by commit
>>>
>>> 337015573718 ("printk: Userspace format indexing support")
>>>
>>>I presume that "printk" is referred to elsewhere in the documentation
>>>as being in this file.
>>
>>Hmm, this is an interesting one, because I think we still generally
>>just want to refer to the API as being `printk()`. Changing it all
>>over the place seems wrong. As you'd imagine, there are quite a few
>>references to this name, so it requires a lot of noise all over the
>>docs and inline comments.
>>
>>Jonathan and other docs folks, how can one tell Sphinx that when it
>>sees printk() it's referring to a function-like macro, or otherwise
>>squelch this reasonably? :-)
The problem is that you moved printk(), but left the associated
kerneldoc comment tied to _printk(), which isn't what you really want to
document. The fix should look something like the attached.
Thanks,
jon
--------snip here----------------------
printk: Move the printk() kerneldoc comment to its new home
Commit 337015573718 ("printk: Userspace format indexing support") turned
printk() into a macro, but left the kerneldoc comment for it with the (now)
_printk() function, resulting in this docs-build warning:
kernel/printk/printk.c:1: warning: 'printk' not found
Move the kerneldoc comment back next to the (now) macro it's meant to
describe and have the docs build find it there.
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
---
Documentation/core-api/printk-basics.rst | 5 +----
include/linux/printk.h | 24 ++++++++++++++++++++++++
kernel/printk/printk.c | 24 ------------------------
3 files changed, 25 insertions(+), 28 deletions(-)
diff --git a/Documentation/core-api/printk-basics.rst b/Documentation/core-api/printk-basics.rst
index 965e4281eddd..2dde24ca7d9f 100644
--- a/Documentation/core-api/printk-basics.rst
+++ b/Documentation/core-api/printk-basics.rst
@@ -107,9 +107,6 @@ also ``CONFIG_DYNAMIC_DEBUG`` in the case of pr_debug()) is defined.
Function reference
==================
-.. kernel-doc:: kernel/printk/printk.c
- :functions: printk
-
.. kernel-doc:: include/linux/printk.h
- :functions: pr_emerg pr_alert pr_crit pr_err pr_warn pr_notice pr_info
+ :functions: printk pr_emerg pr_alert pr_crit pr_err pr_warn pr_notice pr_info
pr_fmt pr_debug pr_devel pr_cont
diff --git a/include/linux/printk.h b/include/linux/printk.h
index 2651b82ed352..c1e176403967 100644
--- a/include/linux/printk.h
+++ b/include/linux/printk.h
@@ -431,6 +431,30 @@ struct pi_entry {
})
+/**
+ * printk - print a kernel message
+ * @fmt: format string
+ *
+ * This is printk(). It can be called from any context. We want it to work.
+ *
+ * If printk indexing is enabled, _printk() is called from printk_index_wrap.
+ * Otherwise, printk is simply #defined to _printk.
+ *
+ * We try to grab the console_lock. If we succeed, it's easy - we log the
+ * output and call the console drivers. If we fail to get the semaphore, we
+ * place the output into the log buffer and return. The current holder of
+ * the console_sem will notice the new output in console_unlock(); and will
+ * send it to the consoles before releasing the lock.
+ *
+ * One effect of this deferred printing is that code which calls printk() and
+ * then changes console_loglevel may break. This is because console_loglevel
+ * is inspected when the actual printing occurs.
+ *
+ * See also:
+ * printf(3)
+ *
+ * See the vsnprintf() documentation for format string extensions over C99.
+ */
#define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
#define printk_deferred(fmt, ...) \
printk_index_wrap(_printk_deferred, fmt, ##__VA_ARGS__)
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index 9b3bd6e017f1..63176be3b50c 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -2186,30 +2186,6 @@ int vprintk_default(const char *fmt, va_list args)
}
EXPORT_SYMBOL_GPL(vprintk_default);
-/**
- * _printk - print a kernel message
- * @fmt: format string
- *
- * This is _printk(). It can be called from any context. We want it to work.
- *
- * If printk indexing is enabled, _printk() is called from printk_index_wrap.
- * Otherwise, printk is simply #defined to _printk.
- *
- * We try to grab the console_lock. If we succeed, it's easy - we log the
- * output and call the console drivers. If we fail to get the semaphore, we
- * place the output into the log buffer and return. The current holder of
- * the console_sem will notice the new output in console_unlock(); and will
- * send it to the consoles before releasing the lock.
- *
- * One effect of this deferred printing is that code which calls printk() and
- * then changes console_loglevel may break. This is because console_loglevel
- * is inspected when the actual printing occurs.
- *
- * See also:
- * printf(3)
- *
- * See the vsnprintf() documentation for format string extensions over C99.
- */
asmlinkage __visible int _printk(const char *fmt, ...)
{
va_list args;
--
2.31.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: linux-next: build warning after merge of the printk tree
2021-07-20 12:18 ` Chris Down
@ 2021-07-20 12:22 ` Chris Down
2021-07-25 21:16 ` Jonathan Corbet
0 siblings, 1 reply; 13+ messages in thread
From: Chris Down @ 2021-07-20 12:22 UTC (permalink / raw)
To: Stephen Rothwell
Cc: Jonathan Corbet, linux-doc, Petr Mladek,
Linux Kernel Mailing List, Linux Next Mailing List
[-- Attachment #1: Type: text/plain, Size: 1010 bytes --]
Chris Down writes:
>+Cc: Jonathan Corbet <corbet@lwn.net>, linux-doc@vger.kernel.org
Well, let's actually Cc them this time...
>Stephen Rothwell writes:
>>After merging the printk tree, today's linux-next build (htmldocs)
>>produced this warning:
>>
>>kernel/printk/printk.c:1: warning: 'printk' not found
>>
>>Introduced by commit
>>
>> 337015573718 ("printk: Userspace format indexing support")
>>
>>I presume that "printk" is referred to elsewhere in the documentation
>>as being in this file.
>
>Hmm, this is an interesting one, because I think we still generally
>just want to refer to the API as being `printk()`. Changing it all
>over the place seems wrong. As you'd imagine, there are quite a few
>references to this name, so it requires a lot of noise all over the
>docs and inline comments.
>
>Jonathan and other docs folks, how can one tell Sphinx that when it
>sees printk() it's referring to a function-like macro, or otherwise
>squelch this reasonably? :-)
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 963 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: linux-next: build warning after merge of the printk tree
2021-07-20 6:24 Stephen Rothwell
@ 2021-07-20 12:18 ` Chris Down
2021-07-20 12:22 ` Chris Down
0 siblings, 1 reply; 13+ messages in thread
From: Chris Down @ 2021-07-20 12:18 UTC (permalink / raw)
To: Stephen Rothwell
Cc: Petr Mladek, Linux Kernel Mailing List, Linux Next Mailing List
[-- Attachment #1: Type: text/plain, Size: 917 bytes --]
+Cc: Jonathan Corbet <corbet@lwn.net>, linux-doc@vger.kernel.org
Stephen Rothwell writes:
>After merging the printk tree, today's linux-next build (htmldocs)
>produced this warning:
>
>kernel/printk/printk.c:1: warning: 'printk' not found
>
>Introduced by commit
>
> 337015573718 ("printk: Userspace format indexing support")
>
>I presume that "printk" is referred to elsewhere in the documentation
>as being in this file.
Hmm, this is an interesting one, because I think we still generally just want
to refer to the API as being `printk()`. Changing it all over the place seems
wrong. As you'd imagine, there are quite a few references to this name, so it
requires a lot of noise all over the docs and inline comments.
Jonathan and other docs folks, how can one tell Sphinx that when it sees
printk() it's referring to a function-like macro, or otherwise squelch this
reasonably? :-)
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 963 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
* linux-next: build warning after merge of the printk tree
@ 2021-07-20 6:24 Stephen Rothwell
2021-07-20 12:18 ` Chris Down
0 siblings, 1 reply; 13+ messages in thread
From: Stephen Rothwell @ 2021-07-20 6:24 UTC (permalink / raw)
To: Petr Mladek
Cc: Chris Down, Linux Kernel Mailing List, Linux Next Mailing List
[-- Attachment #1: Type: text/plain, Size: 379 bytes --]
Hi all,
After merging the printk tree, today's linux-next build (htmldocs)
produced this warning:
kernel/printk/printk.c:1: warning: 'printk' not found
Introduced by commit
337015573718 ("printk: Userspace format indexing support")
I presume that "printk" is referred to elsewhere in the documentation
as being in this file.
--
Cheers,
Stephen Rothwell
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2022-11-22 7:11 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-10 6:45 linux-next: build warning after merge of the printk tree Stephen Rothwell
[not found] ` <CGME20180710064527epcas1p16fd9ad765711d69264b3251890bbcc2e@epcms5p5>
2018-07-10 7:16 ` Maninder Singh
2018-07-10 9:19 ` Petr Mladek
2018-07-10 9:19 ` Petr Mladek
2018-07-10 11:53 ` [PATCH] printk: Fix warning about unused suppress_message_printing kbuild test robot
2018-07-10 13:15 ` linux-next: build warning after merge of the printk tree Sergey Senozhatsky
2021-07-20 6:24 Stephen Rothwell
2021-07-20 12:18 ` Chris Down
2021-07-20 12:22 ` Chris Down
2021-07-25 21:16 ` Jonathan Corbet
2021-07-26 12:28 ` Petr Mladek
2021-07-26 13:07 ` Chris Down
2022-11-22 7:10 Stephen Rothwell
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.