Remove unnecessary header includes from {tools/}lib/list_sort.c
Subsystems (2)
cover Remove unnecessary header includes from {tools/}lib/list_sort.c
Remove outdated and unnecessary header includes from lib/list_sort.c and tools/lib/list_sort.c. Additionally, update the hunk exceptions checked by check_headers.sh to reflect these changes.
Regards,
Kuan-Wei
Kuan-Wei Chiu (3):
lib/list_sort: Remove unnecessary header includes tools/lib/list_sort: Remove unnecessary header includes perf tools: Update expected diff for lib/list_sort.c
lib/list_sort.c | 3 --- tools/lib/list_sort.c | 2 -- tools/perf/check-header_ignore_hunks/lib/list_sort.c | 11 ++--------- 3 files changed, 2 insertions(+), 14 deletions(-)
Signature · 1 line
2.34.1
PATCH 1/3 lib/list_sort: Remove unnecessary header includes
After commit 043b3f7b6388 ("lib/list_sort: simplify and remove MAX_LIST_LENGTH_BITS"), list_sort.c no longer uses ARRAY_SIZE() (which required kernel.h and bug.h for BUILD_BUG_ON_ZERO via __must_be_array) or memset() (which required string.h). As these headers are no longer needed, removes them.
There are no changes to the generated code, as confirmed by 'objdump -d'. Additionally, 'wc -l' shows that the size of lib/.list_sort.o.cmd is reduced from 259 lines to 101 lines.
--- lib/list_sort.c | 3 --- 1 file changed, 3 deletions(-)
lib/list_sort.c +0 -3
@@ -1,9 +1,6 @@// SPDX-License-Identifier: GPL-2.0 -#include <linux/kernel.h> -#include <linux/bug.h> #include <linux/compiler.h> #include <linux/export.h> -#include <linux/string.h> #include <linux/list_sort.h> #include <linux/list.h>
Signature · 1 line
2.34.1
PATCH 2/3 tools/lib/list_sort: Remove unnecessary header includes
In reply to Kuan-Wei ChiuSince lib/list_sort.c no longer requires ARRAY_SIZE() and memset(), the includes for kernel.h, bug.h, and string.h have been removed. Similarly, tools/lib/list_sort.c also does not need to include these headers, so they have been removed as well.
--- tools/lib/list_sort.c | 2 -- 1 file changed, 2 deletions(-)
tools/lib/list_sort.c +0 -2
@@ -1,8 +1,6 @@// SPDX-License-Identifier: GPL-2.0 -#include <linux/kernel.h> #include <linux/compiler.h> #include <linux/export.h> -#include <linux/string.h> #include <linux/list_sort.h> #include <linux/list.h>
Signature · 1 line
2.34.1
PATCH 3/3 perf tools: Update expected diff for lib/list_sort.c
In reply to Kuan-Wei ChiuSince there are no longer any header include differences between lib/list_sort.c and tools/lib/list_sort.c, update the expected diff in check-header_ignore_hunks accordingly.
--- tools/perf/check-header_ignore_hunks/lib/list_sort.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-)
tools/perf/check-header_ignore_hunks/lib/list_sort.c +2 -9
@@ -1,11 +1,4 @@ -@@ -1,5 +1,6 @@ -// SPDX-License-Identifier: GPL-2.0 -#include <linux/kernel.h> -+#include <linux/bug.h> -#include <linux/compiler.h> -#include <linux/export.h> -#include <linux/string.h> -@@ -52,6 +53,7 @@ +@@ -50,6 +50,7 @@ struct list_head *a, struct list_head *b) {struct list_head *tail = head;
@@ -13,7 +6,7 @@for (;;) {/* if equal, take 'a' -- important for sort stability */ -@@ -77,6 +79,15 @@ +@@ -75,6 +76,15 @@/* Finish linking remainder of list b on to tail */ tail->next = b; do {
Signature · 1 line
2.34.1
Quoted 11 lines · Kuan-Wei Chiu
Remove outdated and unnecessary header includes from
lib/list_sort.candtools/lib/list_sort.c. Additionally, update the hunk exceptions checked bycheck_headers.shto reflect these changes.Regards,
Kuan-WeiKuan-Wei Chiu (3):
lib/list_sort: Remove unnecessary header includestools/lib/list_sort: Remove unnecessary header includes perf tools: Update expected diff forlib/list_sort.c
Thanks,
Namhyung
Quoted 9 lines
lib/list_sort.c | 3 --- tools/lib/list_sort.c | 2 -- tools/perf/check-header_ignore_hunks/lib/list_sort.c | 11 ++--------- 3 files changed, 2 insertions(+), 14 deletions(-)Signature · 1 line
2.34.1