From patchwork Sat Jun 17 18:11:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Joaqu=C3=ADn_Ignacio_Aramend=C3=ADa?= X-Patchwork-Id: 109544 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2109601vqr; Sat, 17 Jun 2023 11:14:36 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6q814rRdKo+UH3NcztXUsoxdv6E7dyQUc4UPjd+h1/Xf8cBKn5HBKMDQ34/w+KCjJRtUt+ X-Received: by 2002:a17:903:258e:b0:1b1:78ba:f350 with SMTP id jb14-20020a170903258e00b001b178baf350mr4919944plb.46.1687025676620; Sat, 17 Jun 2023 11:14:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687025676; cv=none; d=google.com; s=arc-20160816; b=lBbhIf14+SjQg2bFJTMAUfMwirj//T4gmuvFH0QIllsb/y2xcD/j7ufdou42mhUqr5 e64hNGO/nV4/OG8hYNTA1Nw4JwtOOXJrpiZsbcDXYbg1zo/RVR6dK8mrlIdHhVWIWbi0 92+GfCGVwDJR3kiU8FjumYaIdL/McKN5Ui8Swt1Dfs9umI7sPGrD7fo5vlKQb/1r8tH2 54zTmCPQYnBk8PgXxyWHdlFbu2siQ1EfjVl6Mtveu7HB47eSRbiwfIm4nApeRjZNCzGt twfuHQd5sxAq64mn5IyncG6LFClFmgdtx00mQr1fm/2hMpsXeQhfcPwAiaBy59sci+4M Y88w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=gEWKXD1JPIR01NtGjO/1uFZNTSbl7uG9HOegtq9F5wg=; b=FsrZ/Gq+mI2+US2qhL8HWLzmBcAnk8Qi6rOb334kkvJy6hB4kKtaEOvZhbdHoaadIy NDucTDYPkep8vonvXqPmBFEnln/kaJMovDmf9+kHiIISxWeBv3X3oaiE7qjTbkjO/Sf3 vA2E4hbdmNKqbDcZFabA+sgUWEhsmWM377BQta2QUNORp3qFhRAHkF3zU9Bhq+1cZazQ AInwNthCMSMLh/XOfAiEBS96ery1h2Myjw1Jtuc8x7qripFyps6pPe4sZQH9v90sLKmd MfQkpTVJCWB01YCuXVe0gHPD/r8ZSTP1ON9LBEHmfSjvAILdys6HDahWgO9wkjs6I3IW 4leQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=UB7XnrfF; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w10-20020a170902e88a00b001b55160783dsi866901plg.545.2023.06.17.11.14.22; Sat, 17 Jun 2023 11:14:36 -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; dkim=pass header.i=@gmail.com header.s=20221208 header.b=UB7XnrfF; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346378AbjFQSMb (ORCPT + 99 others); Sat, 17 Jun 2023 14:12:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229487AbjFQSMV (ORCPT ); Sat, 17 Jun 2023 14:12:21 -0400 Received: from mail-ot1-x332.google.com (mail-ot1-x332.google.com [IPv6:2607:f8b0:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B13C173B; Sat, 17 Jun 2023 11:12:20 -0700 (PDT) Received: by mail-ot1-x332.google.com with SMTP id 46e09a7af769-6b28eefb49cso1422773a34.0; Sat, 17 Jun 2023 11:12:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687025539; x=1689617539; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=gEWKXD1JPIR01NtGjO/1uFZNTSbl7uG9HOegtq9F5wg=; b=UB7XnrfFZID0xVijy5FeylEcs0AEpj4ICxAHu9hlLWfdDqdGmx/VzsRnnqoUi7KaPu 7a18RiLJjUU2IJiSkEs0xW/Natm3F2vxujLnUlF6BI2w14E4gqLNo2mHiIdEBqj9SdFZ NqTy73hFmpgtXZYYoxn5shn9M8QDJYEymf4q9/ZialIJ1XosiUfXcYwIW6IseOF44m8o agtnUeCu0MhZxu8Ir9Im38Qtlk7C/ciw1Nwo9GLjQUpQvNqg4Pp+5yc7c7DYHJAXpTKv olywZJ3gUPG1PsPCrJ5BpfJyGbtUJ46y8i8gMw78YXEoaoJ8+S1fABtMXv88pRwgYYbx HA2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687025539; x=1689617539; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gEWKXD1JPIR01NtGjO/1uFZNTSbl7uG9HOegtq9F5wg=; b=MUKDiv0e9e2ptQdUpCArwkmjiRk24MTLJuQj4Y+W/CGcVFxn8w5kM2mMeHRGSrB339 bgG7FnFtn1DhHgTjxJELCiqnV9BbIj4yS93bEU6HwyM9pA6Nviy76XczsGBj2sMTph3T bz0f9Vw8KkgEteau7tnUgasX8cn5edZ7fkZkpex+exhgOd/AvIrEFOkxRF7P7x3f/iVR W08uUmXKUBBxFHO1EsgP/ymqLCJ7NeKuuE0ikDWhnaKmutInpo8YBJNgEN6RUU/oOt2/ 7RVa4j6YqceVO0PdsLAME85F1+M+bF0Th3tGSfita6pouUID/QtFYTJSLJvMWv6fhopT NhhQ== X-Gm-Message-State: AC+VfDwKeJce01ZeOG17t4JmLN+zRWQliPg0NeksFR2GU8JDihTREVy2 JkrGI8yRrOo5O76o9vI8/UaBxLrTZEo= X-Received: by 2002:a05:6830:208b:b0:6b1:1f0a:80e3 with SMTP id y11-20020a056830208b00b006b11f0a80e3mr1778605otq.20.1687025539408; Sat, 17 Jun 2023 11:12:19 -0700 (PDT) Received: from smeagol.fibertel.com.ar ([201.235.4.68]) by smtp.gmail.com with ESMTPSA id j24-20020a9d7698000000b006adda5cddb7sm6604927otl.62.2023.06.17.11.12.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Jun 2023 11:12:19 -0700 (PDT) From: =?utf-8?q?Joaqu=C3=ADn_Ignacio_Aramend=C3=ADa?= To: linux@roeck-us.net Cc: =?utf-8?q?Joaqu=C3=ADn_Ignacio_Aramend=C3=ADa?= , derekjohn.clark@gmail.com, jdelvare@suse.com, linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] hwmon: (oxp-sensors) Remove unused header Date: Sat, 17 Jun 2023 15:11:42 -0300 Message-ID: <20230617181159.32844-2-samsagax@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230617181159.32844-1-samsagax@gmail.com> References: <20230617181159.32844-1-samsagax@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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?1768974635940971484?= X-GMAIL-MSGID: =?utf-8?q?1768974635940971484?= We are not using , remove that. Signed-off-by: Joaquín Ignacio Aramendía --- drivers/hwmon/oxp-sensors.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/hwmon/oxp-sensors.c b/drivers/hwmon/oxp-sensors.c index be36d38f13d9..584e48d8106e 100644 --- a/drivers/hwmon/oxp-sensors.c +++ b/drivers/hwmon/oxp-sensors.c @@ -16,7 +16,6 @@ */ #include -#include #include #include #include From patchwork Sat Jun 17 18:11:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Joaqu=C3=ADn_Ignacio_Aramend=C3=ADa?= X-Patchwork-Id: 109545 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2114298vqr; Sat, 17 Jun 2023 11:27:43 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5k3SEtItTFXisjhH1y3Ux79wCCHiZHkyrPhdFq/Rdq0CrsSqmGH10luMO/VjQRefNqgaCE X-Received: by 2002:a25:738c:0:b0:bb1:650c:8c04 with SMTP id o134-20020a25738c000000b00bb1650c8c04mr2689830ybc.56.1687026462979; Sat, 17 Jun 2023 11:27:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687026462; cv=none; d=google.com; s=arc-20160816; b=SIS2o/96gAHO2Hfx+7VYNUhiDM9zcoAZslkwi+rhi3JK6PGT9vID+Sn72WtBa0Mtp4 Jto/xr1ejI+6Ellp3r0tLiB2he/WKrpOBqpMXtxxsYpExUaDEKY+ZDUra/yJWWYpeSWf MnQTvGRC59ReqP9gtjnrd4Fz1No/jtIooQ3p02rrcN205j3d2EFRo24Ra1zSBg7zQXMx qruIgsJuBdxKmgnYXSgIPKh1Jc/+7mhalzPje6udRZGrCkH8ZG5CCxh0sabYb1ULz1BU YGuiAxh0Zji99Mex0jsTpXH2YnL7Aq1gy5oe6WkZ3KGTRf3WJdSSikK49aMWIMDARG0A khbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=uuu6We15tgBmKRFOQq5fqWqC4GtSw1jpgOaeBi0Ayzw=; b=wmwpb82UMV3jiUgyDqg8xJ7/ZiLDhsWj7+ixe05tFf9inB/d3SFEOnTThnl0VcXMkP o3V8Hury57HT/De42jeXDi/wQUXlxCyoSQwkrcRTatlX+sHUe1McuwOWui314LfE8IKV J8+IyxGr0+o9rzpq10D/pRUOL7PhCbDFnD+1bLR/GlMWEFMdCA7B9oH7jWJQ4bHUVdeF n+LnaE1OIyP1H3JnE/dFisS8vKEowHL4Kf9esXrn3Zqv3UB+CvS++CQxfT4aa9wED148 20FdfKsQ6xmzDnSUL0QWQu5NOebEl+eG/A4ina7Eqpr/UKxq3zcVEKqO4B0PUBbzvpr4 0xeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=GuQlaFua; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x63-20020a17090a6c4500b00250a6b87c76si4179449pjj.142.2023.06.17.11.27.30; Sat, 17 Jun 2023 11:27:42 -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; dkim=pass header.i=@gmail.com header.s=20221208 header.b=GuQlaFua; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346138AbjFQSMd (ORCPT + 99 others); Sat, 17 Jun 2023 14:12:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41190 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231321AbjFQSM0 (ORCPT ); Sat, 17 Jun 2023 14:12:26 -0400 Received: from mail-ot1-x334.google.com (mail-ot1-x334.google.com [IPv6:2607:f8b0:4864:20::334]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3DA02198C; Sat, 17 Jun 2023 11:12:23 -0700 (PDT) Received: by mail-ot1-x334.google.com with SMTP id 46e09a7af769-6b1fa5a03daso1554334a34.1; Sat, 17 Jun 2023 11:12:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687025542; x=1689617542; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=uuu6We15tgBmKRFOQq5fqWqC4GtSw1jpgOaeBi0Ayzw=; b=GuQlaFuamEMUSH3O3JUPfT1Q8M9k7XQjABYy/f0Aspn3IGugK6KxvmlKZ5jUK6C6Lh 7nLciggPgc+08RGGaGvljPD5h5oYGm3LM4qrX+Uas1bGmFSSnt4MpwYHY/8zG3C8VxnK H8QibuiAe8DcHlaVmGq08MFk8Z0E585x385RK+CXCu8YenzOJ5AgDW/L/3mlBRehwfPM Fq0GXF3IqzovoHnJr8V98pB70ReYBAkgpEDRRrrx2ZJWnvfx++yMJR31lllUBvCEdWIa R8KpndFm1cl3wZAyls2+RUUInUKAYG2+a05HWIwZx6NlGpiBew1pTLNqYXLtCq9E3oed 2sUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687025542; x=1689617542; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uuu6We15tgBmKRFOQq5fqWqC4GtSw1jpgOaeBi0Ayzw=; b=hFF0PBok9uRYCJPgu55kgH/mVkPMsfmvYqCvVVYFjOYZ97YIUdzkcVA+0F5Oy8p68K vvBgyEM7qGRvAwxdj+jvXF7aTWeq1/8Vx7AXYF/K2hAoiXfyD1u6esBcudAMR51aiU3p dT4ii7LELEGVRPMS5pBZkC7u1+YQydqEoOSAwAy4K10TZ+llJf4xDwbcOT+2EvQWUVXg B8XhaCLAku/cGiLoW9nRXZSEfkLY1dUksFZtrTtFCqQlZlhP9lSn+ikidxUBu97MmYeW yypGeKaSNLWVScrB3hGf90RAtJWu/LyrNlCbFXSxrWRNSz/Fc5sErnB99twYtb6CSGDb BBgQ== X-Gm-Message-State: AC+VfDz4/aMfYECHIb7c1qwTJVKSapMJkZFmzR2xLwIkm54Bycvow7Rx nyJkhSaLh8/WraqcgZHyybM= X-Received: by 2002:a9d:7448:0:b0:6af:7fed:1fd3 with SMTP id p8-20020a9d7448000000b006af7fed1fd3mr2677314otk.31.1687025542520; Sat, 17 Jun 2023 11:12:22 -0700 (PDT) Received: from smeagol.fibertel.com.ar ([201.235.4.68]) by smtp.gmail.com with ESMTPSA id j24-20020a9d7698000000b006adda5cddb7sm6604927otl.62.2023.06.17.11.12.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Jun 2023 11:12:22 -0700 (PDT) From: =?utf-8?q?Joaqu=C3=ADn_Ignacio_Aramend=C3=ADa?= To: linux@roeck-us.net Cc: =?utf-8?q?Joaqu=C3=ADn_Ignacio_Aramend=C3=ADa?= , derekjohn.clark@gmail.com, jdelvare@suse.com, linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] hwmon: (oxp-sensors) Simplify logic of error return Date: Sat, 17 Jun 2023 15:11:43 -0300 Message-ID: <20230617181159.32844-3-samsagax@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230617181159.32844-1-samsagax@gmail.com> References: <20230617181159.32844-1-samsagax@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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?1768975460212389016?= X-GMAIL-MSGID: =?utf-8?q?1768975460212389016?= Take return logic on error out of if-else, eliminating duplicated code in tt_togle_store() function. Signed-off-by: Joaquín Ignacio Aramendía --- drivers/hwmon/oxp-sensors.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/hwmon/oxp-sensors.c b/drivers/hwmon/oxp-sensors.c index 584e48d8106e..1e59d97219c4 100644 --- a/drivers/hwmon/oxp-sensors.c +++ b/drivers/hwmon/oxp-sensors.c @@ -226,13 +226,12 @@ static ssize_t tt_toggle_store(struct device *dev, if (value) { rval = tt_toggle_enable(); - if (rval) - return rval; } else { rval = tt_toggle_disable(); - if (rval) - return rval; } + if (rval) + return rval; + return count; }