lkml.org 
[lkml]   [2021]   [Feb]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] printk: Userspace format enumeration support
Some improvements I noticed that I'll include when sending v2.

Chris Down writes:
>+static void remove_printk_fmt_sec(const struct module *mod)
>+{
>+ struct printk_fmt_sec *tmp = NULL, *ps = NULL;
>+ const char **fptr = NULL;

fptr can be scoped to list_for_each_entry_safe, I'll move it.

>+static int proc_pf_show(struct seq_file *s, void *v)
>+{
>+ const struct printk_fmt_sec *ps = NULL;
>+ const char **fptr = NULL;

Ditto for list_for_each_entry.

>+
>+ mutex_lock(&printk_fmts_mutex);
>+
>+ list_for_each_entry(ps, &printk_fmts_list, list) {
>+ const char *mod_name = ps_get_module_name(ps);
>+
>+ for (fptr = ps->start; fptr < ps->end; fptr++) {
>+ seq_puts(s, mod_name);
>+ seq_putc(s, ',');
>+ seq_puts(s, *fptr);
>+ seq_putc(s, '\0');
>+ }
>+ }

Not sure why I didn't just use seq_printf here. I'll do that.

I'll wait a few days for feedback then will send v2 either way. :-)

\
 
 \ /
  Last update: 2021-02-05 01:51    [W:0.159 / U:0.524 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site