public inbox for linux-s390@vger.kernel.org
 help / color / mirror / Atom feed
From: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
To: agordeev@linux.ibm.com
Cc: gerald.schaefer@linux.ibm.com, hca@linux.ibm.com,
	gor@linux.ibm.com, borntraeger@linux.ibm.com,
	svens@linux.ibm.com, linux-s390@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
	Abaci Robot <abaci@linux.alibaba.com>
Subject: [PATCH] s390/vmem: Use swap() instead of open coding it
Date: Tue, 17 Jan 2023 14:02:23 +0800	[thread overview]
Message-ID: <20230117060223.58583-1-jiapeng.chong@linux.alibaba.com> (raw)

Swap is a function interface that provides exchange function. To avoid
code duplication, we can use swap function.

./arch/s390/mm/vmem.c:680:10-11: WARNING opportunity for swap().

Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=3786
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
 arch/s390/mm/vmem.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/arch/s390/mm/vmem.c b/arch/s390/mm/vmem.c
index 78d7768f93d7..774a71b94f5c 100644
--- a/arch/s390/mm/vmem.c
+++ b/arch/s390/mm/vmem.c
@@ -674,11 +674,8 @@ static void __init memblock_region_swap(void *a, void *b, int size)
 {
 	struct memblock_region *r1 = a;
 	struct memblock_region *r2 = b;
-	struct memblock_region swap;
 
-	swap = *r1;
-	*r1 = *r2;
-	*r2 = swap;
+	swap(*r1, *r2);
 }
 
 /*
-- 
2.20.1.7.g153144c


             reply	other threads:[~2023-01-17  6:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-17  6:02 Jiapeng Chong [this message]
2023-01-17  8:44 ` [PATCH] s390/vmem: Use swap() instead of open coding it Heiko Carstens

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=20230117060223.58583-1-jiapeng.chong@linux.alibaba.com \
    --to=jiapeng.chong@linux.alibaba.com \
    --cc=abaci@linux.alibaba.com \
    --cc=agordeev@linux.ibm.com \
    --cc=borntraeger@linux.ibm.com \
    --cc=gerald.schaefer@linux.ibm.com \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=svens@linux.ibm.com \
    /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