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: <20181123122405.3iqc6bvdxkngntzl@pathway.suse.cz>
Date:   Fri, 23 Nov 2018 13:24:05 +0100
From:   Petr Mladek <pmladek@...e.com>
To:     Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp>
Cc:     Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
        Steven Rostedt <rostedt@...dmis.org>,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] printk: Make printk_emit() local function.

On Thu 2018-11-22 23:59:28, Tetsuo Handa wrote:
> printk_emit() is called from only devkmsg_write() in the same file.
> Save object size by making it a local function.
> 
> Signed-off-by: Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp>
> ---
>  include/linux/printk.h |  5 -----
>  kernel/printk/printk.c | 31 +++++++++++++++----------------
>  2 files changed, 15 insertions(+), 21 deletions(-)
> 
> --- a/kernel/printk/printk.c
> +++ b/kernel/printk/printk.c
> @@ -752,6 +752,20 @@ struct devkmsg_user {
>  	char buf[CONSOLE_EXT_LOG_MAX];
>  };
>  
> +static __printf(3, 4) __cold int devkmsg_emit(int facility, int level,
> +					      const char *fmt, ...);

There is no need for the forward declaration. __printf(3, 4)
and __cold could be part of the function definition.
Or do I miss anything?

> +static int devkmsg_emit(int facility, int level, const char *fmt, ...)
> +{
> +	va_list args;
> +	int r;
> +
> +	va_start(args, fmt);
> +	r = vprintk_emit(facility, level, NULL, 0, fmt, args);
> +	va_end(args);
> +
> +	return r;
> +}
> +

Otherwise, the patch makes sense. I like that it removes one
useless EXPORT_SYMBOL().

Best Regards,
Petr

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ