[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250815015404.468511-9-zhao.xichao@vivo.com>
Date: Fri, 15 Aug 2025 09:53:57 +0800
From: Xichao Zhao <zhao.xichao@...o.com>
To: Song Liu <song@...nel.org>,
Yu Kuai <yukuai3@...wei.com>,
linux-raid@...r.kernel.org (open list:SOFTWARE RAID (Multiple Disks) SUPPORT),
linux-kernel@...r.kernel.org (open list)
Cc: Xichao Zhao <zhao.xichao@...o.com>
Subject: [PATCH v1 08/13] lib/raid6: Clean up code style in recov.c
Reduce or add spaces to clean up code style.
Clean up comment style.
No functional changes here.
Signed-off-by: Xichao Zhao <zhao.xichao@...o.com>
---
lib/raid6/recov.c | 44 +++++++++++++++++++++++++-------------------
1 file changed, 25 insertions(+), 19 deletions(-)
diff --git a/lib/raid6/recov.c b/lib/raid6/recov.c
index b5e47c008b41..bccf459c3914 100644
--- a/lib/raid6/recov.c
+++ b/lib/raid6/recov.c
@@ -24,26 +24,28 @@ static void raid6_2data_recov_intx1(int disks, size_t bytes, int faila,
const u8 *pbmul; /* P multiplier table for B data */
const u8 *qmul; /* Q multiplier table (for both) */
- p = (u8 *)ptrs[disks-2];
- q = (u8 *)ptrs[disks-1];
-
- /* Compute syndrome with zero for the missing data pages
- Use the dead data pages as temporary storage for
- delta p and delta q */
+ p = (u8 *)ptrs[disks - 2];
+ q = (u8 *)ptrs[disks - 1];
+
+ /*
+ * Compute syndrome with zero for the missing data pages
+ * Use the dead data pages as temporary storage for
+ * delta p and delta q
+ */
dp = (u8 *)ptrs[faila];
ptrs[faila] = raid6_get_zero_page();
- ptrs[disks-2] = dp;
+ ptrs[disks - 2] = dp;
dq = (u8 *)ptrs[failb];
ptrs[failb] = raid6_get_zero_page();
- ptrs[disks-1] = dq;
+ ptrs[disks - 1] = dq;
raid6_call.gen_syndrome(disks, bytes, ptrs);
/* Restore pointer table */
ptrs[faila] = dp;
ptrs[failb] = dq;
- ptrs[disks-2] = p;
- ptrs[disks-1] = q;
+ ptrs[disks - 2] = p;
+ ptrs[disks - 1] = q;
/* Now, pick the proper data tables */
pbmul = raid6_gfmul[raid6_gfexi[failb-faila]];
@@ -66,20 +68,22 @@ static void raid6_datap_recov_intx1(int disks, size_t bytes, int faila,
u8 *p, *q, *dq;
const u8 *qmul; /* Q multiplier table */
- p = (u8 *)ptrs[disks-2];
- q = (u8 *)ptrs[disks-1];
+ p = (u8 *)ptrs[disks - 2];
+ q = (u8 *)ptrs[disks - 1];
- /* Compute syndrome with zero for the missing data page
- Use the dead data page as temporary storage for delta q */
+ /*
+ * Compute syndrome with zero for the missing data page
+ * Use the dead data page as temporary storage for delta q
+ */
dq = (u8 *)ptrs[faila];
ptrs[faila] = raid6_get_zero_page();
- ptrs[disks-1] = dq;
+ ptrs[disks - 1] = dq;
raid6_call.gen_syndrome(disks, bytes, ptrs);
/* Restore pointer table */
ptrs[faila] = dq;
- ptrs[disks-1] = q;
+ ptrs[disks - 1] = q;
/* Now, pick the proper data tables */
qmul = raid6_gfmul[raid6_gfinv[raid6_gfexp[faila]]];
@@ -117,9 +121,11 @@ void raid6_dual_recov(int disks, size_t bytes, int faila, int failb, void **ptrs
/* P+Q failure. Just rebuild the syndrome. */
raid6_call.gen_syndrome(disks, bytes, ptrs);
} else {
- /* data+Q failure. Reconstruct data from P,
- then rebuild syndrome. */
- /* NOT IMPLEMENTED - equivalent to RAID-5 */
+ /*
+ * data+Q failure. Reconstruct data from P,
+ * then rebuild syndrome.
+ * NOT IMPLEMENTED - equivalent to RAID-5
+ */
}
} else {
if ( failb == disks-2 ) {
--
2.34.1
Powered by blists - more mailing lists