From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============3521560323375579074==" MIME-Version: 1.0 From: kernel test robot Subject: [PATCH] coccinelle: misc: fix swap.cocci warnings Date: Sat, 13 Nov 2021 20:20:55 +0800 Message-ID: <20211113122055.GA14265@43f9cea0cec7> In-Reply-To: <202111132049.i6gkVbng-lkp@intel.com> List-Id: To: kbuild@lists.01.org --===============3521560323375579074== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable CC: kbuild-all(a)lists.01.org CC: linux-kernel(a)vger.kernel.org TO: Denis Efremov CC: Julia Lawall CC: Vineet Gupta CC: "dean.yang_cp" CC: linux-snps-arc(a)lists.infradead.org CC: linux-kernel(a)vger.kernel.org From: kernel test robot arch/arc/kernel/unwind.c:251:22-23: WARNING opportunity for swap() arch/arc/kernel/unwind.c:254:18-19: WARNING opportunity for swap() Check for opencoded swap() implementation. Generated by: scripts/coccinelle/misc/swap.cocci CC: Denis Efremov Reported-by: kernel test robot Signed-off-by: kernel test robot --- tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git = master head: 66f4beaa6c1d28161f534471484b2daa2de1dce0 commit: 7845daa8bd72efa8bbc1de122edfce6e058bbe41 coccinelle: misc: add swap= script :::::: branch date: 16 hours ago :::::: commit date: 7 months ago Please take the patch only if it's a positive warning. Thanks! unwind.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) --- a/arch/arc/kernel/unwind.c +++ b/arch/arc/kernel/unwind.c @@ -247,12 +247,8 @@ static void swap_eh_frame_hdr_table_entr struct eh_frame_hdr_table_entry *e2 =3D p2; unsigned long v; = - v =3D e1->start; - e1->start =3D e2->start; - e2->start =3D v; - v =3D e1->fde; - e1->fde =3D e2->fde; - e2->fde =3D v; + swap(e1->start, e2->start); + swap(e1->fde, e2->fde); } = static void init_unwind_hdr(struct unwind_table *table, --===============3521560323375579074==--