Re: [PATCH 0/2] check_headers.sh with hunk exceptions (lib/list_sort.c tools/ copy)

From: Kuan-Wei Chiu
Date: Wed Oct 02 2024 - 13:21:17 EST


On Mon, Sep 30, 2024 at 05:21:34PM -0300, Arnaldo Carvalho de Melo wrote:
> From: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
>
> Hi,
>
> Please take a look, as per tools/include/uapi/README we carry
> copies of kernel files for various reasons and check when it drifts, in
> this case we need another way to accept diffs while checking, its all
> spelled out in the individual patches, please ack.
>
> - Arnaldo
>
> Arnaldo Carvalho de Melo (2):
> tools check_headers.sh: Add check variant that excludes some hunks
> perf tools: Cope with differences for lib/list_sort.c copy from the kernel
>
LGTM. For the series:

Acked-by: Kuan-Wei Chiu <visitorckw@xxxxxxxxx>

While reviewing the patches, I noticed that there was already a
difference between lib/list_sort.c and tools/lib/list_sort.c regarding
an additional #include <linux/bug.h>. This prompted me to investigate
the reason for this discrepancy. From what I can see, both files only
seem to require only three headers:

#include <linux/compiler.h> /* for likely() macro */
#include <linux/export.h> /* for EXPORT_SYMBOL() macro */
#include <linux/list_sort.h> /* for list_sort() and linux/types.h */

I'll check the git history and run build tests to confirm. If only
these headers are needed, I'll submit a cleanup patch.

Regards,
Kuan-Wei

> .../check-header_ignore_hunks/lib/list_sort.c | 31 +++++++++++++++++++
> tools/perf/check-headers.sh | 29 ++++++++++++++++-
> 2 files changed, 59 insertions(+), 1 deletion(-)
> create mode 100644 tools/perf/check-header_ignore_hunks/lib/list_sort.c
>
> --
> 2.46.0
>