[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YB1Vgyi11cBkL1P7@chrisdown.name>
Date: Fri, 5 Feb 2021 14:26:11 +0000
From: Chris Down <chris@...isdown.name>
To: linux-kernel@...r.kernel.org
Cc: Petr Mladek <pmladek@...e.com>,
Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
John Ogness <john.ogness@...utronix.de>,
Johannes Weiner <hannes@...xchg.org>,
Andrew Morton <akpm@...ux-foundation.org>, kernel-team@...com
Subject: Re: [PATCH] printk: Userspace format enumeration support
Oh, and one more I just spotted and will fix in v2 after other feedback is in:
Chris Down writes:
>+static void store_printk_fmt_sec(const struct module *mod, const char **start,
>+ const char **end)
>+{
>+ struct printk_fmt_sec *ps = NULL;
>+ const char **fptr = NULL;
>+ size_t size = 0;
>+
>+ ps = kmalloc(sizeof(struct printk_fmt_sec), GFP_KERNEL);
>+ if (!ps)
>+ return;
>+
>+ ps->module = mod;
>+ ps->start = start;
>+ ps->end = end;
>+
>+ for (fptr = ps->start; fptr < ps->end; fptr++)
>+ size += strlen(*fptr) + 1;
This still works, but is out of date and doesn't account for the module and
comma, so results in one more unnecessary round trip doing seq_buf_alloc.
Powered by blists - more mailing lists