From patchwork Wed Nov 2 12:37:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: zhang.songyi@zte.com.cn X-Patchwork-Id: 14214 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3598933wru; Wed, 2 Nov 2022 05:52:27 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7+xJ6uQ04LLrCXi6CFupAb8SVPGjEaEwOQCHKxrq1w4Fb6z3D1TlsSGqWv31UHSUbcoY2q X-Received: by 2002:aa7:cfda:0:b0:461:9d22:3484 with SMTP id r26-20020aa7cfda000000b004619d223484mr25196722edy.142.1667393547119; Wed, 02 Nov 2022 05:52:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667393547; cv=none; d=google.com; s=arc-20160816; b=0seGtn4+5XmRiTh0gttZWUsuDO9dOI0Bq4BKwQvQtfw+o4Eiyz0ZF+UI9YhtmN/HNR YxoaHHKNZQu+Okaovi2fa9+juGhtEb+kSF2xsVfezI0eIDRL5rIW8aDkKFn2I7iBNAe7 xXnKaqLqpDvpAyVLNC/ti3avU29ABgVVqZoFfQoUup77AsneE96jyTQaU5NOxm8ggGUX Jl2hc7HXFyNpNjpZpvgJPNO/P0G0Gp98tIMm0dhRc/L717R6ILbAdiUkJ3kF7GlGhirb QVbcVJu6dofShnCBnsmjP+E4mUO9K2+JKsWIHvYzR1qjglGJ/U4oBKeA6AbPC9B0WxmB W3sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:mime-version:message-id:date; bh=BvmWWyEXzLnmz4T1/XM/fTICjRhaMea+5Lyojv9sdlI=; b=KJOja3woSES6o7tpfbkpNF+Gboh2QwFBUp30A6DjRfv5HJZr3+vRCErse217gi83P1 o2GGIClKyndApojcB/uAjuHgyTzDA8PF7T+q4NRYcld4tjVFaDGZcS1t6TgWMIJS8fzN v4NOMdx2zTDiUM8a8OntnyAb3gjVTlwo0/hTaERyR6tGFF18QbotCE2Tt2nwRC3lAi+G Hk9qStLRvOtIkWiI9gu+zxbBVcMaeoG18vGfohxuaChmUO/+6iUuPyhSd8toTejfIVVr JqCfHqadsTvNfT40hfI0AteCxHwSagZY7mjwaCsZsserBub45ltAmgTLaZuD0YuLwLjt Awxg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=zte.com.cn Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r4-20020a170906280400b0078356aaeb63si10998028ejc.288.2022.11.02.05.52.03; Wed, 02 Nov 2022 05:52:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=zte.com.cn Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229880AbiKBMpY (ORCPT + 99 others); Wed, 2 Nov 2022 08:45:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229598AbiKBMpV (ORCPT ); Wed, 2 Nov 2022 08:45:21 -0400 X-Greylist: delayed 367 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Wed, 02 Nov 2022 05:45:20 PDT Received: from mxus.zte.com.cn (mxus.zte.com.cn [20.112.44.237]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CE09238B8; Wed, 2 Nov 2022 05:45:20 -0700 (PDT) Received: from mxhk.zte.com.cn (unknown [192.168.250.138]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mxus.zte.com.cn (FangMail) with ESMTPS id 4N2RJP5pstz9tyD7; Wed, 2 Nov 2022 20:38:29 +0800 (CST) Received: from mse-fl2.zte.com.cn (unknown [10.5.228.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mxhk.zte.com.cn (FangMail) with ESMTPS id 4N2RHq6VKpz5BNRf; Wed, 2 Nov 2022 20:37:59 +0800 (CST) Received: from xaxapp01.zte.com.cn ([10.88.40.50]) by mse-fl2.zte.com.cn with SMTP id 2A2CbsFU049223; Wed, 2 Nov 2022 20:37:54 +0800 (+08) (envelope-from zhang.songyi@zte.com.cn) Received: from mapi (xaxapp01[null]) by mapi (Zmail) with MAPI id mid31; Wed, 2 Nov 2022 20:37:57 +0800 (CST) Date: Wed, 2 Nov 2022 20:37:57 +0800 (CST) X-Zmail-TransId: 2af9636264a57d5a1a4f X-Mailer: Zmail v1.0 Message-ID: <202211022037573160098@zte.com.cn> Mime-Version: 1.0 From: To: Cc: , , , , , , , , , , Subject: =?utf-8?q?=5BPATCH_linux-next=5D_x86/MCE/AMD=3A_remove_redundant_re?= =?utf-8?q?t_variable?= X-MAIL: mse-fl2.zte.com.cn 2A2CbsFU049223 X-Fangmail-Gw-Spam-Type: 0 X-FangMail-Miltered: at 10-207-168-7 with ID 636264C4.000 by FangMail milter! X-FangMail-Envelope: 1667392710/4N2RJP5pstz9tyD7/636264C4.000/192.168.250.138/[192.168.250.138]/mxhk.zte.com.cn/ X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 636264C4.000/4N2RJP5pstz9tyD7 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748388856067367106?= X-GMAIL-MSGID: =?utf-8?q?1748388856067367106?= From 7fd536f480bfd526f40870c1567caf3263a584e7 Mon Sep 17 00:00:00 2001 From: zhang songyi 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 Signed-off-by: zhang songyi --- arch/x86/kernel/cpu/mce/amd.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) -- 2.15.2 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 = {