Skip to contentSkip to conversation

block_dev: Convert to new API

PATCH In review Ricardo B. Marliere via ltp 2 participants 2 messages Oct 21, 2024 – Oct 22, 2024

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 block_dev: Convert to new API

---
v1->v2:
- Added ifdef for including genhd.h in older kernels
- Removed unused pointer
- Fixed make check linter warnings
- Link to v1: https://lore.kernel.org/r/[email protected]
v1:
- Tested against v6.11

---
 .../block/block_dev_kernel/ltp_block_dev.c         |  4 +-
 .../block/block_dev_user/block_dev.c               | 77 +++++++++-------------
 2 files changed, 34 insertions(+), 47 deletions(-)
testcases/kernel/device-drivers/block/block_dev_kernel/ltp_block_dev.c +3 -1
index 17047c0d5ae3f6556f3fa4b0eb2a17a86e5f05a6..5ce145c9f87d1c8a13c32505595990145d24a928 100644
@@ -12,8 +12,10 @@
 #include <linux/module.h>
 #include <linux/device.h>
 #include <linux/fs.h>
-#include <linux/genhd.h>
 #include <linux/blkdev.h>
+#ifndef DISK_NAME_LEN
+#include <linux/genhd.h>
+#endif
 
 MODULE_AUTHOR("Márton Németh <[email protected]>");
 MODULE_AUTHOR("Copyright (c) 2013 Oracle and/or its affiliates");
testcases/kernel/device-drivers/block/block_dev_user/block_dev.c +31 -46

108 lines not on this page · raw message

---
base-commit: 47aff4decc81ac837fd745278def6883fc2f197b
change-id: 20241018-block_dev-c322152e03ad

Best regards,

Signature · 5 lines
Ricardo B. Marliere <[email protected]>


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#1 lore raw

Hi!
Pushed with a minor changes, thanks.

Since you added SPDX identifier I've removed the long license text and also converted the description to docparse comment.

Signature · 5 lines
Cyril Hrubis
[email protected]

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp