[LTP] [PATCH] device-drivers/block/block_dev_kernel: Delete test_genhd.c

Tiezhu Yang yangtiezhu@loongson.cn
Wed Jul 23 03:18:06 CEST 2025


test_genhd.c is not used any more, just delete it. While at it,
update README to reflect the reality.

Suggested-by: Petr Vorel <pvorel@suse.cz>
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
---
 testcases/kernel/device-drivers/block/README  | 17 +-----
 .../block/block_dev_kernel/test_genhd.c       | 53 -------------------
 2 files changed, 2 insertions(+), 68 deletions(-)
 delete mode 100644 testcases/kernel/device-drivers/block/block_dev_kernel/test_genhd.c

diff --git a/testcases/kernel/device-drivers/block/README b/testcases/kernel/device-drivers/block/README
index 812436bb8..1490fd295 100644
--- a/testcases/kernel/device-drivers/block/README
+++ b/testcases/kernel/device-drivers/block/README
@@ -5,19 +5,6 @@ Module under test: linux/block/genhd.c
  -----------------------------+---------------+---------------
   register_blkdev()           | linux/fs.h    | ltp_block_dev.c
   unregister_blkdev()         | linux/fs.h    | ltp_block_dev.c
-  blk_register_region()       | linux/genhd.h |
-  blk_unregister_region()     | linux/genhd.h |
-  add_disk()                  | linux/genhd.h |
-  del_gendisk()               | linux/genhd.h | test_genhd.c
-  blk_lookup_devt()           | linux/genhd.h |
-  alloc_disk()                | linux/genhd.h | test_genhd.c
-  alloc_disk_node()           | linux/genhd.h |
-  get_disk()                  | linux/genhd.h |
-  put_disk()                  | linux/genhd.h |
-  set_device_ro()             | linux/genhd.h |
-  set_disk_ro()               | linux/genhd.h |
-  bdev_read_only()            | linux/fs.h    |
-  invalidate_partition()      | linux/fs.h    |
 
-For possible test results please see "A POSIX conforming test framework" at
-http://www.gnu.org/software/dejagnu/manual/x47.html#posix
+For possible test results please see "A POSIX compliant test framework" at
+https://www.gnu.org/software/dejagnu/manual/A-POSIX-Conforming-Test-Framework.html
diff --git a/testcases/kernel/device-drivers/block/block_dev_kernel/test_genhd.c b/testcases/kernel/device-drivers/block/block_dev_kernel/test_genhd.c
deleted file mode 100644
index d34a236b4..000000000
--- a/testcases/kernel/device-drivers/block/block_dev_kernel/test_genhd.c
+++ /dev/null
@@ -1,53 +0,0 @@
-
-/*
- * Module under test: linux/block/genhd.c
- *
- * Only those functions are tested here which are declared in <linux/genhd.h>
- *
- * Usage:
- *   1. make
- *   2. su
- *   3. insmod ./test_genhd.ko
- *   4. Check the test results in "dmesg"
- *   5. rmmod test_genhd
- */
-
-#include <linux/module.h>
-#include <linux/genhd.h>
-
-MODULE_AUTHOR("Márton Németh <nm127@freemail.hu>");
-MODULE_DESCRIPTION("Test block drivers");
-MODULE_LICENSE("GPL");
-
-#define BLK_DEV_NAME		"test_block"
-#define MAX_MAJOR		255
-
-static void tc20(void)
-{
-	struct gendisk *gd_ptr;
-
-	gd_ptr = alloc_disk(1);
-	if (!gd_ptr) {
-		return;
-	}
-	printk(KERN_DEBUG "gd_ptr after alloc=%p\n", gd_ptr);
-
-	del_gendisk(gd_ptr);
-}
-
-static int test_init_module(void)
-{
-	printk(KERN_INFO "Starting test_genhd module\n");
-
-	tc20();
-
-	return 0;
-}
-
-static void test_exit_module(void)
-{
-	printk(KERN_DEBUG "Unloading test_genhd module\n");
-}
-
-module_init(test_init_module);
-module_exit(test_exit_module);
-- 
2.42.0



More information about the ltp mailing list