Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp3849743rdb; Thu, 28 Dec 2023 01:55:52 -0800 (PST) X-Google-Smtp-Source: AGHT+IGBE7oCwOWEIcl2NpZvkSS2hnd3acBBtr3sckJg8pmTyxr6OblF4y4qGVy5b6KzslkvovAi X-Received: by 2002:a05:6a00:88e:b0:6d9:2ecc:7851 with SMTP id q14-20020a056a00088e00b006d92ecc7851mr5608177pfj.42.1703757352184; Thu, 28 Dec 2023 01:55:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703757352; cv=none; d=google.com; s=arc-20160816; b=I1awsXcVHLRXZosStiOFmagm5qb07XCab8XZWQ5efFMiDxlLwEs991tyYO7tfT3TSq sn6aoOfU5IxAT1jRrTmnhT8Vrqkk8eQ9OQViVfc59Rtlh1PT7JL1nV0yJZASZQNVvRu1 ukapg2nBNCtJxTXrg+2Pp7R7SvztHLpBiRb6x0Bb86oDAncJzecEqBV8QX1InfSICB/7 8OBGV06WbEepMzGsd8a+6+/Fg6V6jIpmZYpjdxZC44Or4cWVImX36Z3WdrvXfLFS9TBb u9p2iZZHJnGlUJiL2iY75xRsemhhss1ipbHlMYwZqUOFJ2IpckDDCMk9CQOpMPO5UbZV soUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=ui-outboundreport:content-transfer-encoding:subject:from:cc:to :content-language:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=vXuS+yU8Hwx16eb2E8w0ucNR2oVQ9MniwbAIMPwA3pg=; fh=IUK+Yqgv71aqBXrHBzznq4rkQ2XwNBWcHPsENmdJXw8=; b=qHNmI4ljSJNnNwSjt4pyswg8JqighszqK4qTfq5JPa9rfFfvVqmSotE1OkV0aS4YWn rGzE+cuFUhRFjimalgLQH2AWPwoSaTiI7o9vUjwsPKrISKR4aly+7SrYAPdCe4EcP9F5 ZjaDoqlVh1gcukSkotsG8F8BJZqazVyAPJjueVtjiSx59bhQEjv9yEOM0D3Q/QNBDCqc bKl/GIxTJVRRxi93bMI934OMRbiJ4KKBulLljwlzz3TBT/wUW/LXV8isU0mAqonJLStw EinN/byyAvC20qSo5OtvJC8aDsVwhHiibMy8QMdG4KmND5F+X1oDcFE6Kgc8ZRpKUWiy kbSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@web.de header.s=s29768273 header.b=QcCer+ma; spf=pass (google.com: domain of linux-kernel+bounces-12549-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12549-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=web.de Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id q14-20020a631f4e000000b005cdd3a5543bsi7848732pgm.438.2023.12.28.01.55.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Dec 2023 01:55:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-12549-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@web.de header.s=s29768273 header.b=QcCer+ma; spf=pass (google.com: domain of linux-kernel+bounces-12549-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12549-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=web.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id BEC2EB21B55 for ; Thu, 28 Dec 2023 09:55:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 66BA16ABD; Thu, 28 Dec 2023 09:55:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=web.de header.i=markus.elfring@web.de header.b="QcCer+ma" X-Original-To: linux-kernel@vger.kernel.org Received: from mout.web.de (mout.web.de [217.72.192.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0F4EF63A8; Thu, 28 Dec 2023 09:55:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=web.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=web.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=s29768273; t=1703757268; x=1704362068; i=markus.elfring@web.de; bh=LdODy8f52XjIOK0lSfQyj0RXaUr08zMyR40prr4dQGA=; h=X-UI-Sender-Class:Date:To:Cc:From:Subject; b=QcCer+malGs0R8tHkNVZJNODF7VXQCWs1FmPeLeDnHDA4R+NSAnmkg28sSKX6bjo e1hL+41LTyF8dfz+5DrSM84/YOz7Ou0c/mpIKb+5zz5osQiJ5K4UmW2x50or73Kq6 9zZIPh+7he+jlVDTsJnLXsFPpd171CTbMXTDiN30nCHPjwsn8up1DBv/oeSYD7Zxw /LOxW/pNv13hPm79dTSU2XBlyjefGToZlz8cwYUKtD990WQoLH9980X7WsSwdeGoG G/mh/cp3LcV2xgECQvevNyipV4Wl4V3TLiLBbvb1G6GQgw8+brkTq3PEzCBZ617hq TRs0Yiz1DS8o3F6i7w== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from [192.168.178.21] ([94.31.85.95]) by smtp.web.de (mrweb105 [213.165.67.124]) with ESMTPSA (Nemesis) id 1N1uAl-1r7cuT2k13-0124gY; Thu, 28 Dec 2023 10:54:28 +0100 Message-ID: <0d0c4876-37d7-4bee-912e-56324495454f@web.de> Date: Thu, 28 Dec 2023 10:54:27 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-GB To: platform-driver-x86@vger.kernel.org, kernel-janitors@vger.kernel.org, Hans de Goede , =?UTF-8?Q?Ilpo_J=C3=A4rvinen?= , Shyam Sundar S K Cc: LKML From: Markus Elfring Subject: [PATCH] platform/x86/amd/pmf: Return a status code only as a constant in two functions Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:jUyWQ8RdCi/tZgmPTVI41q7ZfAnELOCp0Gr+YCtZLiTgdfgay07 gGXqfKbOwAOWKrG67ZvuiZlekxdBzMMLpxHD/qONJxGq5nNQqFJxdvgUxzjGgziIDoGdzvZ WakR3etjiquyCRo49clUjpeSUWaBv+cd0P4nFVqOqj7m1GVJDfJL7oVmFbDBOGow9k/HVQw x/f+h/Po33VoWewuIx5ag== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:TmTrwd9GXRU=;a027FqgyvmWIt3MVpkxyigPDqmP acsYJhm5sPpKoXVvfh7Gf+SjuizSh9inE2myh2BEj4WtO1/1VB6AL0Q6plOUyEuwqRQ7Q7nk8 tU+k8UrcrwQcvUXD13RastM9QiqGPNnuOQtdveBb1mMKmiQdhnGKqnYLwmAYS0E+Epzv72761 htaNIx58/hCGS6akKG35Mwiv9z6U9YSK8+WrS2vSzqAjzyCRRQH3CKJnL6f09sw9KiaM4DI5x 5W8GRDquBMA+zimrP3cIfOh+URtHirL0L9pYTSvNCmiwqmvApngWXgWZJ564Sx/hU7QICSMUk 7SE1PpmxfFUn7uWPfLxP/ZtlI1n4+0qEqBD6VMqOwBLVOxyd8l/vraEzoloWTm2E+17hQ7RMU 4UWeqxMoo885EOcoO6ohdkK7BdZw3Rl/0P//aijDOO7c4jC2OZev6pNr9Pxy/Gke7BjEJEbbf 0OHUuic3iaysSYgibyt+0ZvRmZuu7G5thk0nxqRAGnS9Iq6nF4wsA4HKgCrBXLQEDRg+DPFBL 3F1Pr64sa+uDVDAMD2dQ5JgBOHZ1heOskBw424rdltztdCv2tD7PsVoDCdWp3GoQS+XX087W5 xfBISGMIatrHdUdyX2vzMUliId+NRfXqcvfjlzmHAyYiPmikF+5uRZWEM1rWrMDZ0k3RN0QCo sHTseRwbYQz3jemr5TypWn1oDTfI8EqIwPshqR+C/a6u1Tcwdd91YcgpfrZY+WgOjo93FDgza jtFLeqpT53t7SomsXg+KMQsh9qynyigtgeO6FSagAgJ0Jm3zAEUib02CkzmAgFn6U+tu+Sjmn 2hNnKiUcAo7wB8wJUlI6EvUbvgKdrbM2JXpUKy4npympipN4SRhLuT8g0jfBWgqjai/zBrIBH 2i/+rscupe+QBnzGbJI3NlPItlwA6/0jRP3P2Awm2ihsXqAQW4vNWTcl58R6Z5q+e3RIscZT2 cxOvMg== From: Markus Elfring Date: Thu, 28 Dec 2023 10:48:16 +0100 Return a status code without storing it in an intermediate variable. Signed-off-by: Markus Elfring =2D-- drivers/platform/x86/amd/pmf/acpi.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/drivers/platform/x86/amd/pmf/acpi.c b/drivers/platform/x86/am= d/pmf/acpi.c index 4ec7957eb707..ce00dd9a5391 100644 =2D-- a/drivers/platform/x86/amd/pmf/acpi.c +++ b/drivers/platform/x86/amd/pmf/acpi.c @@ -111,7 +111,6 @@ int apmf_os_power_slider_update(struct amd_pmf_dev *pd= ev, u8 event) struct os_power_slider args; struct acpi_buffer params; union acpi_object *info; - int err =3D 0; args.size =3D sizeof(args); args.slider_event =3D event; @@ -121,10 +120,10 @@ int apmf_os_power_slider_update(struct amd_pmf_dev *= pdev, u8 event) info =3D apmf_if_call(pdev, APMF_FUNC_OS_POWER_SLIDER_UPDATE, ¶ms); if (!info) - err =3D -EIO; + return -EIO; kfree(info); - return err; + return 0; } static void apmf_sbios_heartbeat_notify(struct work_struct *work) @@ -148,7 +147,6 @@ int apmf_update_fan_idx(struct amd_pmf_dev *pdev, bool= manual, u32 idx) union acpi_object *info; struct apmf_fan_idx args; struct acpi_buffer params; - int err =3D 0; args.size =3D sizeof(args); args.fan_ctl_mode =3D manual; @@ -158,14 +156,11 @@ int apmf_update_fan_idx(struct amd_pmf_dev *pdev, bo= ol manual, u32 idx) params.pointer =3D (void *)&args; info =3D apmf_if_call(pdev, APMF_FUNC_SET_FAN_IDX, ¶ms); - if (!info) { - err =3D -EIO; - goto out; - } + if (!info) + return -EIO; -out: kfree(info); - return err; + return 0; } int apmf_get_auto_mode_def(struct amd_pmf_dev *pdev, struct apmf_auto_mod= e *data) =2D- 2.43.0