From: Matthew Sakai <msakai@redhat.com>
To: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Cc: dm-devel@lists.linux.dev, linux-kernel@vger.kernel.org,
Abaci Robot <abaci@linux.alibaba.com>,
Mike Snitzer <snitzer@kernel.org>
Subject: Re: [PATCH] dm vdo indexer: Use swap() instead of open coding it
Date: Tue, 28 May 2024 22:00:21 -0400 [thread overview]
Message-ID: <a1ceff08-164f-d0b4-36b6-41a7798b82be@redhat.com> (raw)
In-Reply-To: <20240524074109.13433-1-jiapeng.chong@linux.alibaba.com>
On 5/24/24 03:41, Jiapeng Chong wrote:
> Swap is a function interface that provides exchange function. To avoid
> code duplication, we can use swap function.
>
> ./drivers/md/dm-vdo/indexer/index.c:207:43-44: WARNING opportunity for swap().
>
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=9173
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Reviewed-by: Matthew Sakai <msakai@redhat.com>
Mike, can you make sure this gets applied with the rest of the pending
dm patches?
> ---
> 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;
> }
>
prev parent reply other threads:[~2024-05-29 2:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-24 7:41 Jiapeng Chong
2024-05-24 13:48 ` Markus Elfring
2024-05-29 2:00 ` Matthew Sakai [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a1ceff08-164f-d0b4-36b6-41a7798b82be@redhat.com \
--to=msakai@redhat.com \
--cc=abaci@linux.alibaba.com \
--cc=dm-devel@lists.linux.dev \
--cc=jiapeng.chong@linux.alibaba.com \
--cc=linux-kernel@vger.kernel.org \
--cc=snitzer@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®