From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============4162734901416342836==" MIME-Version: 1.0 From: kernel test robot Subject: [PATCH] coccinelle: misc: fix swap.cocci warnings Date: Mon, 19 Jul 2021 03:14:45 +0800 Message-ID: <20210718191445.GA41934@bf04f50c309a> In-Reply-To: <202107190342.c0IauZpb-lkp@intel.com> List-Id: To: kbuild@lists.01.org --===============4162734901416342836== 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: "Gustavo A. R. Silva" 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: 1d67c8d993baf8ab6be8a2154b1a94ec1311c869 commit: 7845daa8bd72efa8bbc1de122edfce6e058bbe41 coccinelle: misc: add swap= script :::::: branch date: 20 hours ago :::::: commit date: 3 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, --===============4162734901416342836==--