[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20240529021231.21043-1-jiapeng.chong@linux.alibaba.com>
Date: Wed, 29 May 2024 10:12:31 +0800
From: Jiapeng Chong <jiapeng.chong@...ux.alibaba.com>
To: msakai@...hat.com
Cc: dm-devel@...ts.linux.dev,
linux-kernel@...r.kernel.org,
Jiapeng Chong <jiapeng.chong@...ux.alibaba.com>,
Abaci Robot <abaci@...ux.alibaba.com>
Subject: [PATCH v2] dm vdo indexer: Use swap() in swap_open_chapter()
Use existing swap() function rather than duplicating its implementation.
/drivers/md/dm-vdo/indexer/index.c:207:43-44: WARNING opportunity for swap().
Reported-by: Abaci Robot <abaci@...ux.alibaba.com>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=9173
Signed-off-by: Jiapeng Chong <jiapeng.chong@...ux.alibaba.com>
---
Changes in v2:
-Amend commit message to make it more clear.
drivers/md/dm-vdo/indexer/index.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/md/dm-vdo/indexer/index.c b/drivers/md/dm-vdo/indexer/index.c
index 1ba767144426..df4934846244 100644
--- a/drivers/md/dm-vdo/indexer/index.c
+++ b/drivers/md/dm-vdo/indexer/index.c
@@ -197,15 +197,12 @@ static int finish_previous_chapter(struct uds_index *index, u64 current_chapter_
static int swap_open_chapter(struct index_zone *zone)
{
int result;
- struct open_chapter_zone *temporary_chapter;
result = finish_previous_chapter(zone->index, zone->newest_virtual_chapter);
if (result != UDS_SUCCESS)
return result;
- temporary_chapter = zone->open_chapter;
- zone->open_chapter = zone->writing_chapter;
- zone->writing_chapter = temporary_chapter;
+ swap(zone->open_chapter, zone->writing_chapter);
return UDS_SUCCESS;
}
--
2.20.1.7.g153144c
Powered by blists - more mailing lists