* [PATCH 1/3] lib/list_sort: Remove unnecessary header includes
2024-10-12 4:28 [PATCH 0/3] Remove unnecessary header includes from {tools/}lib/list_sort.c Kuan-Wei Chiu
@ 2024-10-12 4:28 ` Kuan-Wei Chiu
2024-10-12 4:28 ` [PATCH 2/3] tools/lib/list_sort: " Kuan-Wei Chiu
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Kuan-Wei Chiu @ 2024-10-12 4:28 UTC (permalink / raw)
To: akpm, acme
Cc: peterz, mingo, namhyung, mark.rutland, alexander.shishkin, jolsa,
irogers, adrian.hunter, kan.liang, jserv, linux-kernel,
linux-perf-users, Kuan-Wei Chiu
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.
Signed-off-by: Kuan-Wei Chiu <visitorckw@gmail.com>
---
lib/list_sort.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/lib/list_sort.c b/lib/list_sort.c
index 0fb59e92ca2d..8d3f623536fe 100644
--- a/lib/list_sort.c
+++ b/lib/list_sort.c
@@ -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>
--
2.34.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/3] tools/lib/list_sort: Remove unnecessary header includes
2024-10-12 4:28 [PATCH 0/3] Remove unnecessary header includes from {tools/}lib/list_sort.c Kuan-Wei Chiu
2024-10-12 4:28 ` [PATCH 1/3] lib/list_sort: Remove unnecessary header includes Kuan-Wei Chiu
@ 2024-10-12 4:28 ` Kuan-Wei Chiu
2024-10-12 4:28 ` [PATCH 3/3] perf tools: Update expected diff for lib/list_sort.c Kuan-Wei Chiu
2024-10-22 4:20 ` [PATCH 0/3] Remove unnecessary header includes from {tools/}lib/list_sort.c Namhyung Kim
3 siblings, 0 replies; 5+ messages in thread
From: Kuan-Wei Chiu @ 2024-10-12 4:28 UTC (permalink / raw)
To: akpm, acme
Cc: peterz, mingo, namhyung, mark.rutland, alexander.shishkin, jolsa,
irogers, adrian.hunter, kan.liang, jserv, linux-kernel,
linux-perf-users, Kuan-Wei Chiu
Since 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.
Signed-off-by: Kuan-Wei Chiu <visitorckw@gmail.com>
---
tools/lib/list_sort.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/tools/lib/list_sort.c b/tools/lib/list_sort.c
index 69affa251fa7..bb99e493dcd1 100644
--- a/tools/lib/list_sort.c
+++ b/tools/lib/list_sort.c
@@ -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>
--
2.34.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 3/3] perf tools: Update expected diff for lib/list_sort.c
2024-10-12 4:28 [PATCH 0/3] Remove unnecessary header includes from {tools/}lib/list_sort.c Kuan-Wei Chiu
2024-10-12 4:28 ` [PATCH 1/3] lib/list_sort: Remove unnecessary header includes Kuan-Wei Chiu
2024-10-12 4:28 ` [PATCH 2/3] tools/lib/list_sort: " Kuan-Wei Chiu
@ 2024-10-12 4:28 ` Kuan-Wei Chiu
2024-10-22 4:20 ` [PATCH 0/3] Remove unnecessary header includes from {tools/}lib/list_sort.c Namhyung Kim
3 siblings, 0 replies; 5+ messages in thread
From: Kuan-Wei Chiu @ 2024-10-12 4:28 UTC (permalink / raw)
To: akpm, acme
Cc: peterz, mingo, namhyung, mark.rutland, alexander.shishkin, jolsa,
irogers, adrian.hunter, kan.liang, jserv, linux-kernel,
linux-perf-users, Kuan-Wei Chiu
Since 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.
Signed-off-by: Kuan-Wei Chiu <visitorckw@gmail.com>
---
| 11 ++---------
1 file changed, 2 insertions(+), 9 deletions(-)
--git a/tools/perf/check-header_ignore_hunks/lib/list_sort.c b/tools/perf/check-header_ignore_hunks/lib/list_sort.c
index 32d98cb34f80..b7316d29857d 100644
--- a/tools/perf/check-header_ignore_hunks/lib/list_sort.c
+++ b/tools/perf/check-header_ignore_hunks/lib/list_sort.c
@@ -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 {
--
2.34.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 0/3] Remove unnecessary header includes from {tools/}lib/list_sort.c
2024-10-12 4:28 [PATCH 0/3] Remove unnecessary header includes from {tools/}lib/list_sort.c Kuan-Wei Chiu
` (2 preceding siblings ...)
2024-10-12 4:28 ` [PATCH 3/3] perf tools: Update expected diff for lib/list_sort.c Kuan-Wei Chiu
@ 2024-10-22 4:20 ` Namhyung Kim
3 siblings, 0 replies; 5+ messages in thread
From: Namhyung Kim @ 2024-10-22 4:20 UTC (permalink / raw)
To: Kuan-Wei Chiu
Cc: akpm, acme, peterz, mingo, mark.rutland, alexander.shishkin,
jolsa, irogers, adrian.hunter, kan.liang, jserv, linux-kernel,
linux-perf-users
On Sat, Oct 12, 2024 at 12:28:25PM +0800, Kuan-Wei Chiu wrote:
> 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
Acked-by: Namhyung Kim <namhyung@kernel.org>
Thanks,
Namhyung
>
> 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(-)
>
> --
> 2.34.1
>
^ permalink raw reply [flat|nested] 5+ messages in thread