lkml.org 
[lkml]   [2022]   [May]   [23]   [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 Mon, May 23, 2022 at 04:01:14AM +0200, Miguel Ojeda wrote:
> From: Boqun Feng <boqun.feng@gmail.com>
>
> This makes it easier to update the size later on.
>

This does not really conform to [1].

E.g.

"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.

> Furthermore, a static assert is added to ensure both are updated
> when that happens. The relationship used is one that keeps the new
> size (512+1) close to the original buffer size (500).

You must split this then into two patches:

1. A patch that re-defines the length with KSYM_NAME_LEN, i.e.
#define KSYM_NAME_LEN 499
2. A patch which increases the size and reasoning for that.

Right now bundles two separate changes, which does not conform to [2].

BR, Jarkko

\
 
 \ /
  Last update: 2022-05-23 21:47    [W:0.268 / U:1.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site