[LTP] [PATCH] ltp_block_dev: Check HAVE_LINUX_GENHD_H to include genhd.h

Petr Vorel pvorel@suse.cz
Tue Jul 22 15:09:01 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.

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


More information about the ltp mailing list