[LTP] [PATCH v2 1/3] libswap: Split long lines (readability)
Petr Vorel
pvorel@suse.cz
Tue May 21 09:49:53 CEST 2024
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
Changes v1->v2:
* Separated from the next commit
libs/libltpswap/libswap.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/libs/libltpswap/libswap.c b/libs/libltpswap/libswap.c
index eb066df71..0066ca734 100644
--- a/libs/libltpswap/libswap.c
+++ b/libs/libltpswap/libswap.c
@@ -93,7 +93,9 @@ static int file_is_contiguous(const char *filename)
fd = SAFE_OPEN(filename, O_RDONLY);
- fiemap = (struct fiemap *)SAFE_MALLOC(sizeof(struct fiemap) + sizeof(struct fiemap_extent));
+ fiemap = (struct fiemap *)SAFE_MALLOC(sizeof(struct fiemap)
+ + sizeof(struct fiemap_extent));
+
memset(fiemap, 0, sizeof(struct fiemap) + sizeof(struct fiemap_extent));
fiemap->fm_start = 0;
@@ -243,7 +245,8 @@ bool is_swap_supported(const char *filename)
*/
int tst_max_swapfiles(void)
{
- unsigned int swp_migration_num = 0, swp_hwpoison_num = 0, swp_device_num = 0, swp_pte_marker_num = 0;
+ unsigned int swp_migration_num = 0, swp_hwpoison_num = 0,
+ swp_device_num = 0, swp_pte_marker_num = 0;
struct tst_kconfig_var migration = TST_KCONFIG_INIT("CONFIG_MIGRATION");
struct tst_kconfig_var memory = TST_KCONFIG_INIT("CONFIG_MEMORY_FAILURE");
struct tst_kconfig_var device = TST_KCONFIG_INIT("CONFIG_DEVICE_PRIVATE");
@@ -281,7 +284,8 @@ int tst_max_swapfiles(void)
swp_pte_marker_num = 1;
}
- return DEFAULT_MAX_SWAPFILE - swp_migration_num - swp_hwpoison_num - swp_device_num - swp_pte_marker_num;
+ return DEFAULT_MAX_SWAPFILE - swp_migration_num - swp_hwpoison_num
+ - swp_device_num - swp_pte_marker_num;
}
/*
--
2.43.0
More information about the ltp
mailing list