lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1648433573-25735-1-git-send-email-baihaowen@meizu.com>
Date:   Mon, 28 Mar 2022 10:12:53 +0800
From:   Haowen Bai <baihaowen@...zu.com>
To:     <dave.hansen@...ux.intel.com>, <luto@...nel.org>,
        <peterz@...radead.org>
CC:     <linux-kernel@...r.kernel.org>, Haowen Bai <baihaowen@...zu.com>
Subject: [PATCH] x86/mm: Directly return instead of using local ret variable

fixes coccinelle warning:
./arch/x86/mm/pf_in.c:133:18-20: Unneeded variable: "rv". Return "OTHERS" on line 144

Signed-off-by: Haowen Bai <baihaowen@...zu.com>
---
 arch/x86/mm/pf_in.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/x86/mm/pf_in.c b/arch/x86/mm/pf_in.c
index 3f83e31..4eff3ee 100644
--- a/arch/x86/mm/pf_in.c
+++ b/arch/x86/mm/pf_in.c
@@ -130,7 +130,6 @@ enum reason_type get_ins_type(unsigned long ins_addr)
 	unsigned char *p;
 	struct prefix_bits prf;
 	int i;
-	enum reason_type rv = OTHERS;
 
 	p = (unsigned char *)ins_addr;
 	p += skip_prefix(p, &prf);
@@ -141,7 +140,7 @@ enum reason_type get_ins_type(unsigned long ins_addr)
 	CHECK_OP_TYPE(opcode, imm_wop, IMM_WRITE);
 
 exit:
-	return rv;
+	return OTHERS;
 }
 #undef CHECK_OP_TYPE
 
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ