public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: <zhang.songyi@zte.com.cn>
To: <tony.luck@intel.com>
Cc: <bp@alien8.de>, <tglx@linutronix.de>, <mingo@redhat.com>,
	<dave.hansen@linux.intel.com>, <x86@kernel.org>, <hpa@zytor.com>,
	<linux-edac@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<jiang.xuexin@zte.com.cn>, <xue.zhihong@zte.com.cn>,
	<zhang.songyi@zte.com.cn>
Subject: [PATCH linux-next] x86/MCE/AMD: remove redundant ret variable
Date: Wed, 2 Nov 2022 20:37:57 +0800 (CST)	[thread overview]
Message-ID: <202211022037573160098@zte.com.cn> (raw)

From 7fd536f480bfd526f40870c1567caf3263a584e7 Mon Sep 17 00:00:00 2001
From: zhang songyi <zhang.songyi@zte.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@zte.com.cn>
Signed-off-by: zhang songyi <zhang.songyi@zte.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

                 reply	other threads:[~2022-11-02 12:45 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202211022037573160098@zte.com.cn \
    --to=zhang.songyi@zte.com.cn \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=jiang.xuexin@zte.com.cn \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=tony.luck@intel.com \
    --cc=x86@kernel.org \
    --cc=xue.zhihong@zte.com.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox