Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp4482270rwo; Tue, 25 Jul 2023 06:50:00 -0700 (PDT) X-Google-Smtp-Source: APBJJlEuPjPQsF5c//txOKook8cHYMJFmk1qkzJDy+jFaqwY8iYwkIjFpyyS1+51XMLMKj4JAToJ X-Received: by 2002:a05:6402:1514:b0:521:7ab6:b954 with SMTP id f20-20020a056402151400b005217ab6b954mr11167588edw.1.1690292999747; Tue, 25 Jul 2023 06:49:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690292999; cv=none; d=google.com; s=arc-20160816; b=hTA/92LceUtMnt2KhrpMY7j8ITozplECst3iqlm0uz86oxFPvgGif91o/QHm0I8TyM RnAvq18qMDzTZftMgDfWboGnS5Y8G9JP+VhJiAOl18GU3zhAusIF+xqo6kUrgZatl/7X jAictZEIh1KUzVmCozwHkmVDdLiwgAqyv+H3Yy3yvr7NmFE7tYqHuWS6lyAvO9Hx0dP5 DeYjtJfI+MVae6fj1qglVX1llKQo48n/XKbl06kqaKE5DeeI5eh0iMD02ti377mH2upF 0P3onklAnuXkgajhKxDSPEtWCJWnAr31owq5QDLoL48K1rLaIpQ/4IgE8JhDu6LI0Mgu wiNg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=3Puz3ztq+s5PMQIYSFqmtMplo+slwUgkmSW9O9rbzaQ=; fh=Sy2DcC8iBcoj93plRSksEF0esK794/0rw7KBx0/+VmQ=; b=hqEzAy+w3s4ZyJsFLt4eisNlb8/3O3Gz2dgLBw+4Sg4uiqtJ4zFu8ggPR2k7tkZfGx QTfKCYOc5W3ZQP31wxYwhQvJlZJ2lNRXhe+bN1YNR6EPuUibd3l6hKdP2ElwmtCmMlg3 vB7ZMwdMjS97KiUhTa/jj4V5m6sOVktoe2FA0SXQUOtX06JNEvIsw3HF5QWcgIpOcODL r7QdzJ7ms9drlPrXkqpewcK8jOLoeYDUGVGahtzpKVhXIKJrY8o4uApIdi7rLtPAXD9f zekdZwOa5T0GGMeH5KOazXx8pD4dvf6elnK6CDTVp8z5gyeJ9DxcN2U1CymRxDWTIvtD gnLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@9elements.com header.s=google header.b="hVigPGX/"; 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=NONE dis=NONE) header.from=9elements.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bo19-20020a0564020b3300b0051e2340f298si7990231edb.468.2023.07.25.06.49.34; Tue, 25 Jul 2023 06:49:59 -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=@9elements.com header.s=google header.b="hVigPGX/"; 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=NONE dis=NONE) header.from=9elements.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229524AbjGYMua (ORCPT + 99 others); Tue, 25 Jul 2023 08:50:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232317AbjGYMt7 (ORCPT ); Tue, 25 Jul 2023 08:49:59 -0400 Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E85C1AA for ; Tue, 25 Jul 2023 05:49:58 -0700 (PDT) Received: by mail-ej1-x629.google.com with SMTP id a640c23a62f3a-977e0fbd742so874666766b.2 for ; Tue, 25 Jul 2023 05:49:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=9elements.com; s=google; t=1690289397; x=1690894197; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=3Puz3ztq+s5PMQIYSFqmtMplo+slwUgkmSW9O9rbzaQ=; b=hVigPGX//gTdtgmRuslLbiD1/zcY/J9BI9iISd0U4KzwumlLvSTCrKq4TVJCmKI5+Y gzNDIQRzCKFPphY9vbQsCB8Y0OcWy802EvA7wpSi8njOBNCZyNsNx/TovT71NWTTal0M 6zJrn0OCpMUMog1LoXLLbfPPloeuSf5Cq8Uahs3w58Hu2gJWKIe3wuYNrb7kmA1Az+r8 7FksdF0bC/1r8yXmfBqwolspgGX32xjGunx2VBJr1MCnDU3TgC0/DZjGxFrO0qaQHvOl 5etfhfrRaDodt9q7a6NlRCuoNzeq16P4nKo/Z8ODRTBH31SSfxr53sAIi+ClzWSGRUMT jStg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690289397; x=1690894197; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=3Puz3ztq+s5PMQIYSFqmtMplo+slwUgkmSW9O9rbzaQ=; b=hZqjNWzoMkL8KYHut0nNJQ7Dv5CBY+Me+EVLZussicORR8/ga0ofwZSHBPeH3HGs7u cyrBFLlM6M3fAQQ9ihj/1o+sarMmWfkf/32aB8YUHlJdfYn2UAf7GQ5iy8NUsZ1uElIT Z3xcjifUMuu2y1PbxlTrwcgEd+A/56Iz+Quyxxmd/neWYHUZzGAxvUmkqEO1ldf/0x6N zkZluMnXTL3joztj/r3RTM6uiG1A0wcXbLByAYEQxWPpFCoefNL2MXTor0Qf3QNwRxfD w+d/d4toBUTZiAXFnVnW1ySqLBgOU9DfDa6jQvPacdE3CG6D+4xpwHE4vfTvSImxoz8i iy2w== X-Gm-Message-State: ABy/qLal9Goqk/8PdQwMAQpXvs9QvRvL6L2sH8JdixWUTw8YHdLNb+D5 WMiSImhKMSVAPvizDUyTzf4VsQ== X-Received: by 2002:a17:906:2d9:b0:973:d076:67ab with SMTP id 25-20020a17090602d900b00973d07667abmr12076828ejk.42.1690289396804; Tue, 25 Jul 2023 05:49:56 -0700 (PDT) Received: from stroh80.sec.9e.network (ip-078-094-000-051.um19.pools.vodafone-ip.de. [78.94.0.51]) by smtp.gmail.com with ESMTPSA id pk15-20020a170906d7af00b00997e8b6eaa1sm8133283ejb.41.2023.07.25.05.49.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Jul 2023 05:49:56 -0700 (PDT) From: Naresh Solanki X-Google-Original-From: Naresh Solanki To: Guenter Roeck , linux-hwmon@vger.kernel.org, Jean Delvare Cc: Patrick Rudolph , Naresh Solanki , linux-kernel@vger.kernel.org Subject: [PATCH 1/3] pmbus_core: Refactor pmbus_is_enabled function Date: Tue, 25 Jul 2023 14:49:50 +0200 Message-ID: <20230725124954.3824954-1-Naresh.Solanki@9elements.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable 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 From: Patrick Rudolph Refactor the pmbus_is_enabled() function to return the raw status without any additional processing as its already done in _pmbus_is_enabled function. Signed-off-by: Patrick Rudolph Signed-off-by: Naresh Solanki --- drivers/hwmon/pmbus/pmbus_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hwmon/pmbus/pmbus_core.c b/drivers/hwmon/pmbus/pmbus_core.c index fa06325f5a7c..42fb7286805b 100644 --- a/drivers/hwmon/pmbus/pmbus_core.c +++ b/drivers/hwmon/pmbus/pmbus_core.c @@ -2768,7 +2768,7 @@ static int __maybe_unused pmbus_is_enabled(struct device *dev, u8 page) ret = _pmbus_is_enabled(dev, page); mutex_unlock(&data->update_lock); - return !!(ret & PB_OPERATION_CONTROL_ON); + return ret; } #define to_dev_attr(_dev_attr) \ base-commit: 55612007f16b5d7b1fb83a7b0f5bb686829db7c7 -- 2.41.0