lkml.org 
[lkml]   [2022]   [May]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v7 01/25] kallsyms: avoid hardcoding the buffer size
On Tue, May 24, 2022 at 06:21:14PM +0200, Miguel Ojeda wrote:
> On Mon, May 23, 2022 at 9:46 PM Jarkko Sakkinen <jarkko@kernel.org> wrote:
> >
> > "Declare KSY_NAME_LEN, which describes the maximum length for a kernel
> > symbol read by kallsyms from the input. In read_symbol(), define the
> > buffer to be of length "KSY_NAME_LEN + 1", which includes the terminator
> > character."
> >
> > would be better.
>
> Note that the patch is not declaring `KSYM_NAME_LEN`, but a new
> constant for a fairly arbitrarily sized for an input buffer.
>
> I am all for detailed commit messages, and I agree this can be
> expanded. However, I think the first sentence of what you wrote should
> be part of the docs of the constant, and the second one sounds like it
> could be a comment on the code. Something like "Introduce
> KSYM_NAME_LEN_BUFFER in place of the previously hardcoded size of the
> input buffer (...)" would be better for a reviewer.

Inline comment would be sufficient a remainder, and actually a better
idea.

> > You must split this then into two patches:
>
> Note that the size is not really being increased in a meaningful way
> -- the important bit is the introduction of the relationship between
> constants. The changes are all meant as a replacement for the
> previously hardcoded constant, so I don't think the split is a "must",
> but we can do it.
>
> We can even split this into 3 patches: clean up the unneeded `sizeof`,
> replace (and, importantly, document) the hardcoded constant, and
> finally introduce the relationship.
>
> Thanks for taking a look!
>
> Cheers,
> Miguel

BR, Jarkko

\
 
 \ /
  Last update: 2022-05-26 06:56    [W:0.095 / U:0.548 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site