lkml.org 
[lkml]   [2021]   [Mar]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 2/2] lib/vsprintf: reduce space taken by no_hash_pointers warning
On Fri, Mar 5, 2021 at 1:46 PM Marco Elver <elver@google.com> wrote:
> +static const char no_hash_pointers_warning[8][55] __initconst = {
> + "******************************************************",
> + " NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE ",
> + " This system shows unhashed kernel memory addresses ",
> + " via the console, logs, and other interfaces. This ",
> + " might reduce the security of your system. ",
> + " If you see this message and you are not debugging ",
> + " the kernel, report this immediately to your system ",
> + " administrator! ",
> +};
> +
> static int __init no_hash_pointers_enable(char *str)
> {
> + /* Indices into no_hash_pointers_warning; -1 is an empty line. */
> + const int lines[] = { 0, 1, -1, 2, 3, 4, -1, 5, 6, 7, -1, 1, 0 };

You can save a few more bytes by making this an array of s8.

I agree with the __initconst. The rest seems overkill to me, but I
won't reject it.

Acked-by: Timur Tabi <timur@kernel.org>

\
 
 \ /
  Last update: 2021-03-06 21:30    [W:1.529 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site