mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Borislav Petkov <bp@alien8.de>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Randy Dunlap <rdunlap@infradead.org>,
	x86@kernel.org, Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jslaby@suse.cz>,
	Jason Wessel <jason.wessel@windriver.com>,
	kgdb-bugreport@lists.sourceforge.net,
	Hedi Berriche <hedi@sgi.com>, Mike Travis <travis@sgi.com>,
	Dimitri Sivanich <sivanich@sgi.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Kees Cook <keescook@chromium.org>,
	Peter Zijlstra <peterz@infradead.org>
Subject: Re: [PATCH] printk: Use symbolic defines for console loglevels
Date: Mon, 19 May 2014 12:12:51 -0700	[thread overview]
Message-ID: <1400526771.14238.15.camel@joe-AO725> (raw)
In-Reply-To: <1400524052-25625-1-git-send-email-bp@alien8.de>

On Mon, 2014-05-19 at 20:27 +0200, Borislav Petkov wrote:
> ... instead of naked numbers.

Seems sensible.

> diff --git a/include/linux/printk.h b/include/linux/printk.h
[]
> @@ -30,6 +30,17 @@ static inline const char *printk_skip_level(const char *buffer)
>  	return buffer;
>  }
>  
> +/* printk's without a loglevel use this.. */
> +#define DEFAULT_MESSAGE_LOGLEVEL CONFIG_DEFAULT_MESSAGE_LOGLEVEL

Does anyone actually set CONFIG_DEFAULT_MESSAGE_LOGLEVEL
to something other than 4?

> +/* We show everything that is MORE important than this.. */

It might be nice to show somewhere that larger values are
less important.

> +#define CONSOLE_LOGLEVEL_SILENT  0 /* Mum's the word */
> +#define CONSOLE_LOGLEVEL_MIN	 1 /* Minimum loglevel we let people use */
> +#define CONSOLE_LOGLEVEL_QUIET	 4 /* Shhh ..., when booted with "quiet" */
> +#define CONSOLE_LOGLEVEL_DEFAULT 7 /* anything MORE serious than KERN_DEBUG */
> +#define CONSOLE_LOGLEVEL_DEBUG	10 /* issue debug messages */
> +#define CONSOLE_LOGLEVEL_MOTORMOUTH 15	/* You can't shut this one up */

It may be nicer to have #defines for the
KERN_<LEVEL> numbers from kern_levels.h
and use those here.

Maybe add:

#define LOGLEVEL_EMERG		0
#define LOGLEVEL_ALERT		1
#define LOGLEVEL_CRIT		2
#define LOGLEVEL_ERR		3
#define LOGLEVEL_WARNING	4
#define LOGLEVEL_NOTICE		5
#define LOGLEVEL_INFO		6
#define LOGLEVEL_DEBUG		7

That could clean up a few uses of
magic numbers like 7 in dev_printk_emit



  reply	other threads:[~2014-05-19 19:12 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-19 18:27 Borislav Petkov
2014-05-19 19:12 ` Joe Perches [this message]
2014-05-19 19:25   ` Borislav Petkov
2014-05-19 19:36 ` Kees Cook
2014-05-19 20:38 ` Randy Dunlap
2014-05-20  5:44 ` Valdis.Kletnieks
2014-05-27 19:17 ` Steven Rostedt
2014-05-27 19:43   ` Borislav Petkov
2014-05-27 22:36     ` Valdis.Kletnieks
2014-05-27 22:59       ` Borislav Petkov
2014-05-27 23:26         ` Andrew Morton
2014-05-27 23:32           ` Steven Rostedt
2014-05-27 23:43           ` Borislav Petkov

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=1400526771.14238.15.camel@joe-AO725 \
    --to=joe@perches.com \
    --cc=akpm@linux-foundation.org \
    --cc=bp@alien8.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=hedi@sgi.com \
    --cc=jason.wessel@windriver.com \
    --cc=jslaby@suse.cz \
    --cc=keescook@chromium.org \
    --cc=kgdb-bugreport@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=rdunlap@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=sivanich@sgi.com \
    --cc=torvalds@linux-foundation.org \
    --cc=travis@sgi.com \
    --cc=x86@kernel.org \
    /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

all inboxes | Powered by JetHome®