Skip to content

Commit 1e37799

Browse files
Yang Guangliu-song-6
authored andcommitted
raid5-ppl: use swap() to make code cleaner
Use the macro `swap()` defined in `include/linux/minmax.h` to avoid opencoding it. Reported-by: Zeal Robot <[email protected]> Signed-off-by: Yang Guang <[email protected]> Signed-off-by: Song Liu <[email protected]>
1 parent 8c13ab1 commit 1e37799

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/md/raid5-ppl.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1081,7 +1081,7 @@ static int ppl_load_distributed(struct ppl_log *log)
10811081
struct ppl_conf *ppl_conf = log->ppl_conf;
10821082
struct md_rdev *rdev = log->rdev;
10831083
struct mddev *mddev = rdev->mddev;
1084-
struct page *page, *page2, *tmp;
1084+
struct page *page, *page2;
10851085
struct ppl_header *pplhdr = NULL, *prev_pplhdr = NULL;
10861086
u32 crc, crc_stored;
10871087
u32 signature;
@@ -1156,9 +1156,7 @@ static int ppl_load_distributed(struct ppl_log *log)
11561156
prev_pplhdr_offset = pplhdr_offset;
11571157
prev_pplhdr = pplhdr;
11581158

1159-
tmp = page;
1160-
page = page2;
1161-
page2 = tmp;
1159+
swap(page, page2);
11621160

11631161
/* calculate next potential ppl offset */
11641162
for (i = 0; i < le32_to_cpu(pplhdr->entries_count); i++)

0 commit comments

Comments
 (0)