From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============1164023641004978021==" MIME-Version: 1.0 From: kernel test robot Subject: [PATCH] coccinelle: misc: fix swap.cocci warnings Date: Tue, 14 Dec 2021 01:02:34 +0800 Message-ID: <20211213170234.GA26066@fc879cd9d3cb> List-Id: To: kbuild@lists.01.org --===============1164023641004978021== 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: Jeff Dike CC: Richard Weinberger CC: Anton Ivanov CC: Johannes Berg CC: linux-um(a)lists.infradead.org CC: linux-kernel(a)vger.kernel.org From: kernel test robot arch/um/os-Linux/sigio.c:81:28-29: 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: 2585cf9dfaaddf00b069673f27bb3f8530e2039c commit: 7845daa8bd72efa8bbc1de122edfce6e058bbe41 coccinelle: misc: add swap= script :::::: branch date: 18 hours ago :::::: commit date: 8 months ago Please take the patch only if it's a positive warning. Thanks! sigio.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) --- a/arch/um/os-Linux/sigio.c +++ b/arch/um/os-Linux/sigio.c @@ -77,9 +77,7 @@ static int write_sigio_thread(void *unus "write_sigio_thread : " "read on socket failed, " "err =3D %d\n", errno); - tmp =3D current_poll; - current_poll =3D next_poll; - next_poll =3D tmp; + swap(current_poll, next_poll); respond_fd =3D sigio_private[1]; } else { --===============1164023641004978021==--