mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yihao Han <hanyihao@vivo.com>
To: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>,
	Helge Deller <deller@gmx.de>,
	Kefeng Wang <wangkefeng.wang@huawei.com>,
	David Hildenbrand <david@redhat.com>,
	Yihao Han <hanyihao@vivo.com>,
	Christophe Leroy <christophe.leroy@c-s.fr>,
	"Matthew Wilcox (Oracle)" <willy@infradead.org>,
	Sven Schnelle <svens@stackframe.org>,
	linux-parisc@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: kernel@vivo.com
Subject: [PATCH] parisc: using swap() instead of tmp
Date: Sun, 31 Oct 2021 19:10:45 -0700	[thread overview]
Message-ID: <20211101021047.22945-1-hanyihao@vivo.com> (raw)

swap() was used instead of the tmp variable to swap values

Signed-off-by: Yihao Han <hanyihao@vivo.com>
---
 arch/parisc/mm/init.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/arch/parisc/mm/init.c b/arch/parisc/mm/init.c
index 65f50f072a87..b705a423be85 100644
--- a/arch/parisc/mm/init.c
+++ b/arch/parisc/mm/init.c
@@ -127,16 +127,13 @@ static void __init setup_bootmem(void)
 		int j;
 
 		for (j = i; j > 0; j--) {
-			physmem_range_t tmp;
 
 			if (pmem_ranges[j-1].start_pfn <
 			    pmem_ranges[j].start_pfn) {
 
 				break;
 			}
-			tmp = pmem_ranges[j-1];
-			pmem_ranges[j-1] = pmem_ranges[j];
-			pmem_ranges[j] = tmp;
+			swap(pmem_ranges[j-1], pmem_ranges[j]);
 		}
 	}
 
-- 
2.17.1


             reply	other threads:[~2021-11-01  2:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-01  2:10 Yihao Han [this message]
2021-11-01  2:21 ` Matthew Wilcox
2021-11-01  3:03 Yihao Han

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=20211101021047.22945-1-hanyihao@vivo.com \
    --to=hanyihao@vivo.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=christophe.leroy@c-s.fr \
    --cc=david@redhat.com \
    --cc=deller@gmx.de \
    --cc=kernel@vivo.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-parisc@vger.kernel.org \
    --cc=svens@stackframe.org \
    --cc=wangkefeng.wang@huawei.com \
    --cc=willy@infradead.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®