* [LTP] [PATCH] ltp_block_dev: Check HAVE_LINUX_GENHD_H to include genhd.h
@ 2025-07-22 11:52 Tiezhu Yang
2025-07-22 13:09 ` Petr Vorel
0 siblings, 1 reply; 2+ messages in thread
From: Tiezhu Yang @ 2025-07-22 11:52 UTC (permalink / raw)
To: Linux Test Project
After the LTP commit d4dd360b05f8 ("device-drivers/acpi/ltp_acpi_cmds:
Fix build errors"), HAVE_LINUX_GENHD_H is defined to 1 if you have the
<linux/genhd.h> header file.
The macro definition DISK_NAME_LEN may be completely removed, so it is
better to use #ifdef HAVE_LINUX_GENHD_H to include genhd.h.
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
---
By the way, it seems that the following file is not used, should it be
deleted? If yes, I will send a formal patch later.
testcases/kernel/device-drivers/block/block_dev_kernel/test_genhd.c
.../device-drivers/block/block_dev_kernel/ltp_block_dev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/testcases/kernel/device-drivers/block/block_dev_kernel/ltp_block_dev.c b/testcases/kernel/device-drivers/block/block_dev_kernel/ltp_block_dev.c
index 0fd278981..f50530f23 100644
--- a/testcases/kernel/device-drivers/block/block_dev_kernel/ltp_block_dev.c
+++ b/testcases/kernel/device-drivers/block/block_dev_kernel/ltp_block_dev.c
@@ -13,7 +13,7 @@
#include <linux/device.h>
#include <linux/fs.h>
#include <linux/blkdev.h>
-#ifndef DISK_NAME_LEN
+#ifdef HAVE_LINUX_GENHD_H
# include <linux/genhd.h>
#endif
--
2.42.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [LTP] [PATCH] ltp_block_dev: Check HAVE_LINUX_GENHD_H to include genhd.h
2025-07-22 11:52 [LTP] [PATCH] ltp_block_dev: Check HAVE_LINUX_GENHD_H to include genhd.h Tiezhu Yang
@ 2025-07-22 13:09 ` Petr Vorel
0 siblings, 0 replies; 2+ messages in thread
From: Petr Vorel @ 2025-07-22 13:09 UTC (permalink / raw)
To: Tiezhu Yang; +Cc: Linux Test Project
Hi Tiezhu,
> After the LTP commit d4dd360b05f8 ("device-drivers/acpi/ltp_acpi_cmds:
> Fix build errors"), HAVE_LINUX_GENHD_H is defined to 1 if you have the
> <linux/genhd.h> header file.
> The macro definition DISK_NAME_LEN may be completely removed, so it is
> better to use #ifdef HAVE_LINUX_GENHD_H to include genhd.h.
Suggested-by: Petr Vorel <pvorel@suse.cz> # :)
https://lore.kernel.org/ltp/20250718063028.GA1387837@pevik/
> Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
> ---
> By the way, it seems that the following file is not used, should it be
> deleted? If yes, I will send a formal patch later.
Indeed, at least 4.12 based kernel does not need it.
In that case please send a new patch. Thanks!
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-07-22 13:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-22 11:52 [LTP] [PATCH] ltp_block_dev: Check HAVE_LINUX_GENHD_H to include genhd.h Tiezhu Yang
2025-07-22 13:09 ` Petr Vorel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox