public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/mm: Directly return instead of using local ret variable
@ 2022-03-28  2:12 Haowen Bai
  2022-03-28  2:49 ` Dave Hansen
  2022-03-28  7:49 ` kernel test robot
  0 siblings, 2 replies; 4+ messages in thread
From: Haowen Bai @ 2022-03-28  2:12 UTC (permalink / raw)
  To: dave.hansen, luto, peterz; +Cc: linux-kernel, Haowen Bai

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@meizu.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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-03-28  7:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-28  2:12 [PATCH] x86/mm: Directly return instead of using local ret variable Haowen Bai
2022-03-28  2:49 ` Dave Hansen
2022-03-28  3:02   ` 答复: " 白浩文
2022-03-28  7:49 ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox