[LTP] [PATCH v2] ltp_block_dev: Check HAVE_LINUX_GENHD_H to include genhd.h
Petr Vorel
pvorel@suse.cz
Wed Jul 23 21:16:41 CEST 2025
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.
Merged with slightly reworded commit message.
Thank you!
> Suggested-by: Petr Vorel <pvorel@suse.cz>
> Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
> ---
> v2: Add Suggested-by tag
Thanks for sending v2. That was not needed, I could have added Suggested-by:
myself before merge, but I thought this module was unused and you plan to send
v2 with its removal (but you meant test_genhd.c).
Kind regards,
Petr
> +++ 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
More information about the ltp
mailing list