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>] [day] [month] [year] [list]
Date:   Wed, 2 Nov 2022 20:37:57 +0800 (CST)
From:   <zhang.songyi@....com.cn>
To:     <tony.luck@...el.com>
Cc:     <bp@...en8.de>, <tglx@...utronix.de>, <mingo@...hat.com>,
        <dave.hansen@...ux.intel.com>, <x86@...nel.org>, <hpa@...or.com>,
        <linux-edac@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        <jiang.xuexin@....com.cn>, <xue.zhihong@....com.cn>,
        <zhang.songyi@....com.cn>
Subject: [PATCH linux-next] x86/MCE/AMD: remove redundant ret variable

>From 7fd536f480bfd526f40870c1567caf3263a584e7 Mon Sep 17 00:00:00 2001
From: zhang songyi <zhang.songyi@....com.cn>
Date: Wed, 2 Nov 2022 16:48:44 +0800
Subject: [PATCH linux-next] x86/MCE/AMD: remove redundant ret variable

Return value from show() and store() directly instead of taking this in
another redundant variable.

Reported-by: Zeal Robot <zealci@....com.cn>
Signed-off-by: zhang songyi <zhang.songyi@....com.cn>
---
 arch/x86/kernel/cpu/mce/amd.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/arch/x86/kernel/cpu/mce/amd.c b/arch/x86/kernel/cpu/mce/amd.c
index 10fb5b5c9efa..425d0803eeb6 100644
--- a/arch/x86/kernel/cpu/mce/amd.c
+++ b/arch/x86/kernel/cpu/mce/amd.c
@@ -1009,11 +1009,8 @@ static ssize_t show(struct kobject *kobj, struct attribute *attr, char *buf)
 {
    struct threshold_block *b = to_block(kobj);
    struct threshold_attr *a = to_attr(attr);
-   ssize_t ret;

-   ret = a->show ? a->show(b, buf) : -EIO;
-
-   return ret;
+   return a->show ? a->show(b, buf) : -EIO;
 }

 static ssize_t store(struct kobject *kobj, struct attribute *attr,
@@ -1021,11 +1018,8 @@ static ssize_t store(struct kobject *kobj, struct attribute *attr,
 {
    struct threshold_block *b = to_block(kobj);
    struct threshold_attr *a = to_attr(attr);
-   ssize_t ret;
-
-   ret = a->store ? a->store(b, buf, count) : -EIO;

-   return ret;
+   return a->store ? a->store(b, buf, count) : -EIO;
 }

 static const struct sysfs_ops threshold_ops = {
--
2.15.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ