diff options
author | Yang Guang <yang.guang5@zte.com.cn> | 2021-10-28 11:48:05 +0300 |
---|---|---|
committer | Song Liu <songliubraving@fb.com> | 2021-11-02 21:41:45 +0300 |
commit | 1e37799b50eccb79c59c660b330746a7848c346b (patch) | |
tree | 1d8f107b9eba94ce7153130d508736fbf8e55553 /drivers | |
parent | 8c13ab115b577bd09097b9d77916732e97e31b7b (diff) | |
download | linux-1e37799b50eccb79c59c660b330746a7848c346b.tar.xz |
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 <zealci@zte.com.cn>
Signed-off-by: Yang Guang <yang.guang5@zte.com.cn>
Signed-off-by: Song Liu <songliubraving@fb.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/md/raid5-ppl.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/md/raid5-ppl.c b/drivers/md/raid5-ppl.c index 3ddc2aa0b530..4ab417915d7f 100644 --- a/drivers/md/raid5-ppl.c +++ b/drivers/md/raid5-ppl.c @@ -1081,7 +1081,7 @@ static int ppl_load_distributed(struct ppl_log *log) struct ppl_conf *ppl_conf = log->ppl_conf; struct md_rdev *rdev = log->rdev; struct mddev *mddev = rdev->mddev; - struct page *page, *page2, *tmp; + struct page *page, *page2; struct ppl_header *pplhdr = NULL, *prev_pplhdr = NULL; u32 crc, crc_stored; u32 signature; @@ -1156,9 +1156,7 @@ static int ppl_load_distributed(struct ppl_log *log) prev_pplhdr_offset = pplhdr_offset; prev_pplhdr = pplhdr; - tmp = page; - page = page2; - page2 = tmp; + swap(page, page2); /* calculate next potential ppl offset */ for (i = 0; i < le32_to_cpu(pplhdr->entries_count); i++) |