From f16e604aa614e753644655791b1c0aac9320277d Mon Sep 17 00:00:00 2001 From: Olivier Date: Wed, 18 Mar 2026 15:31:02 +0100 Subject: [PATCH 1/2] fix: replace 'SUBDIRS' by 'M' options in make because 'SUBDIRS' was removed in Linux 5.3 --- example1/Makefile | 2 +- example2/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/example1/Makefile b/example1/Makefile index b5c564b..d72eeea 100644 --- a/example1/Makefile +++ b/example1/Makefile @@ -8,4 +8,4 @@ WARN_FLAGS += -Wall .PHONY: default defualt: - $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules + $(MAKE) -C $(KDIR) M=$(PWD) modules diff --git a/example2/Makefile b/example2/Makefile index 8587a3d..c85d82e 100644 --- a/example2/Makefile +++ b/example2/Makefile @@ -8,4 +8,4 @@ WARN_FLAGS += -Wall .PHONY: default defualt: - $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules + $(MAKE) -C $(KDIR) M=$(PWD) modules From 823c62fbf249c259d12cdc2fd9ab17210327a86d Mon Sep 17 00:00:00 2001 From: Olivier Date: Wed, 18 Mar 2026 16:44:26 +0100 Subject: [PATCH 2/2] fix: removing junk use with debugfs_create_u32 because debugfs_create_u32 it's now a void function, it's return nothing, at the compilation we got an "void value not ignored as it ought to be" error. --- example1/debugfs_example1.c | 8 +------- example2/debugfs_example2.c | 7 +------ 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/example1/debugfs_example1.c b/example1/debugfs_example1.c index b035fe4..cd8c2f1 100644 --- a/example1/debugfs_example1.c +++ b/example1/debugfs_example1.c @@ -22,7 +22,6 @@ static u32 hello = 0; // This is called when the module loads. int init_module(void) { - struct dentry *junk; // Create directory `/sys/kernel/debug/example1`. // @@ -53,12 +52,7 @@ int init_module(void) // // See also linux-source/fs/debugfs/file.c:debugfs_create_u32 // - junk = debugfs_create_u32("hello", 0666, dir, &hello); - if (!junk) { - // Abort module load. - printk(KERN_ALERT "debugfs_example1: failed to create /sys/kernel/debug/example1/hello\n"); - return -1; - } + debugfs_create_u32("hello", 0666, dir, &hello); return 0; } diff --git a/example2/debugfs_example2.c b/example2/debugfs_example2.c index db26861..44afdcf 100644 --- a/example2/debugfs_example2.c +++ b/example2/debugfs_example2.c @@ -139,12 +139,7 @@ int init_module(void) // // See also linux-source/fs/debugfs/file.c:debugfs_create_u32 // - junk = debugfs_create_u32("sum", 0444, dir, &sum); - if (!junk) { - // Abort module load. - printk(KERN_ALERT "debugfs_example2: failed to create /sys/kernel/debug/example2/add\n"); - return -1; - } + debugfs_create_u32("sum", 0444, dir, &sum); return 0; }