From patchwork Sun Mar 12 04:31:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Crawford X-Patchwork-Id: 13171124 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7E245C6FA99 for ; Sun, 12 Mar 2023 04:37:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229614AbjCLEhI (ORCPT ); Sat, 11 Mar 2023 23:37:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46746 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229437AbjCLEhH (ORCPT ); Sat, 11 Mar 2023 23:37:07 -0500 X-Greylist: delayed 302 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Sat, 11 Mar 2023 20:37:04 PST Received: from ipmail06.adl3.internode.on.net (ipmail06.adl3.internode.on.net [150.101.137.16]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8817B591F2 for ; Sat, 11 Mar 2023 20:37:04 -0800 (PST) IronPort-SDR: 640d55be_8CZrL38BEd1QqhUnvy3PcnG0lA9rzJTA9jBapA0+8lq4ac3 B9Dym/grMN7op+E+MQlEB0rU6R65SZnZYv/ixeA== X-SMTP-MATCH: 0 X-IPAS-Result: A2BUAgAwVA1kjPQc8jxagRKBRoIugk+Vf51RgX4PAQ8BAUQEAQGFBQKFMyY0CQ4BAgQBAQEBAwIDAQEBAQEBAwEBBgEBAQEBAQYEFAEBAQFARYVoDYZWAgEDJwsBDQEBNwEPGThXBgESgn6CXbBGM4EBgggBAQaCYppogV4JgUCLbYEWgzZ6Qj+BToR9hAuGeJg+CoE0dYEgDkpzgQYCCQIRa4ESCGiBfkECDWULDnSBYAKBCQMJAwcFS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7rS/BvMWZA8i+QoEISmfljpSPfksNkQPsWukqtX3Ep M5r3ed+UrL6PiguuJ8GC5GW+LATaRKcLklQaKhF0IJTOE+EYxC0+zyFC37pS/N3P/aQrHOJU Z1/FPxARzGV9XiorAlCIYUuPrUtvvoixORaS4PRPWRc7oeu9Gt4gqnxqBr7qnQgGeh1sMAHL YjUSTKOP0qQiVZQmE7PtMN0AXW5U/ZVeDzD2P2Jz8tRG6IhqO1MdWQA4omwtViRMypl+Euah xOcRqn0y+c5959gsbGxGYp+BiK1C+jJasK2zC6Jve9jV+j/afX1i1tNq33MHRhnAr8KatEmy ZWPqIHW2W3GjpYXUkfYuZuKEocS18DjTdh8b8b9HERHlBS7Rf7c3hon0EK7IKxvj9lyyJSGR Qy5Sc3obv8TeY5X60N0YhhkMSQ2KvrIfIL/gxiivtKOIBQ5+i7WHuONrHPGQzlSSX4VBsfYF ATxhceL2vlZi4Z9XDk/GPBsBs5DEm/JAKcJWYX4imiFMzOOnFiHh7rFkCgg4xHtDl2vMp7zw bDBdyjEWCWCgoP65/AHjNUqpTwSNmh3vscodEFE+9JWtSGzPFRbEcsja6c5GrNmuQ2s8qGha D/0OT5oTW23WDlfahzz7ejyRgrVVKREJt79ISdv5E+OLTu/AISbGrZ66yN8+DFMdyD+yP28Y 8QrkpEq0sNdHrkyLQrL2sGGvA== IronPort-HdrOrdr: A9a23:NptCH64D/yeTr663wgPXwBLXdLJyesId70hD6qkQc3ZomwKj9v xG+85rrCMd6l4qNU3I/OrtBEDuewK+yXcY2+Ys1PKZLW3bUQiTXedfBPXZsl/d8kTFn4Y36U 4jSdkYNDSaNzhHZKjBjjVRnLsbsaG6GdiT9ILjJm9WPH1Xgr9bnnpE49mgYzZLrNgvP+tCKK ah X-IronPort-Anti-Spam-Filtered: true Received: from 60-242-28-244.static.tpgi.com.au (HELO bits.crawford.emu.id.au) ([60.242.28.244]) by ipmail06.adl3.internode.on.net with ESMTP; 12 Mar 2023 15:01:58 +1030 Received: from agc.crawford.emu.id.au (agc.crawford.emu.id.au [IPv6:fdd2:7aad:d478:1:0:0:cb10:cc07]) (authenticated bits=0) by bits.crawford.emu.id.au (8.17.1/8.17.1) with ESMTPSA id 32C4VeSJ3479492 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sun, 12 Mar 2023 15:31:54 +1100 Authentication-Results: bits.crawford.emu.id.au; arc=none smtp.remote-ip=fdd2:7aad:d478:1::cb10:cc07 DKIM-Filter: OpenDKIM Filter v2.11.0 bits.crawford.emu.id.au 32C4VeSJ3479492 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crawford.emu.id.au; s=s1; t=1678595514; bh=DU+Xftfb7lcjjyP8d/5ETdYh91GfD9FO/DD0RbJwLdI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hEgI9ZIZ9vF07vBTlru+DvfxnAyGNLq2X9XQv5BzA2vKgCLI4F/xouYrU/ppDYvuT gAN87Vl2vMpmK1JzGJdmqtfuu6MwDg4Ck0GPIIw4wn2XRTEbs4T2iDv3P31+sB8VA7 0vqNdgmZ8gL6MkTU/exv42zfqHvK9D8bHjqiziHyOFs3Oq3iEi2BGWt4QtlEMEwHFu rFbvN5UmeA5LqbyA7tJ2kM2nWuepZr3rhAvXeux90W5NAJe4ffkq8XBkZs2DdSU/2D tKIgatQXFm2tr8AEYyfjig3ZcwINy+syb4B2P50/dft28vRXvsf1rtBw6aUnplnrXU +kooA+ZG8hKzA== From: Frank Crawford To: Jean Delvare , Guenter Roeck Cc: linux-hwmon@vger.kernel.org, Frank Crawford Subject: [PATCH v1 1/3] hwmon (it87): Added support for 11mV ADC Date: Sun, 12 Mar 2023 15:31:35 +1100 Message-Id: <20230312043137.1744885-2-frank@crawford.emu.id.au> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230312043137.1744885-1-frank@crawford.emu.id.au> References: <20230312043137.1744885-1-frank@crawford.emu.id.au> MIME-Version: 1.0 X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.6.4 (bits.crawford.emu.id.au [IPv6:fdd2:7aad:d478:1:0:0:cb10:cc01]); Sun, 12 Mar 2023 15:31:54 +1100 (AEDT) X-Virus-Scanned: clamav-milter 0.103.8 at bits.crawford.emu.id.au X-Virus-Status: Clean Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org Add support of all know ADC values currently identified for it87 chips. Includes adding support for 11mV ADC reported on IT8613E and IT8625E. Signed-off-by: Frank Crawford --- drivers/hwmon/it87.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c index 66f7ceaa7c3f..fe1291d5be4b 100644 --- a/drivers/hwmon/it87.c +++ b/drivers/hwmon/it87.c @@ -312,6 +312,7 @@ struct it87_devices { * chips to avoid the problem. */ #define FEAT_CONF_NOEXIT BIT(19) /* Chip should not exit conf mode */ +#define FEAT_11MV_ADC BIT(20) static const struct it87_devices it87_devices[] = { [it87] = { @@ -515,6 +516,7 @@ static const struct it87_devices it87_devices[] = { #define has_six_temp(data) ((data)->features & FEAT_SIX_TEMP) #define has_vin3_5v(data) ((data)->features & FEAT_VIN3_5V) #define has_conf_noexit(data) ((data)->features & FEAT_CONF_NOEXIT) +#define has_11mv_adc(data) ((data)->features & FEAT_11MV_ADC) struct it87_sio_data { int sioaddr; @@ -608,6 +610,8 @@ static int adc_lsb(const struct it87_data *data, int nr) lsb = 120; else if (has_10_9mv_adc(data)) lsb = 109; + else if (has_11mv_adc(data)) + lsb = 110; else lsb = 160; if (data->in_scaled & BIT(nr)) @@ -2002,7 +2006,8 @@ static ssize_t show_label(struct device *dev, struct device_attribute *attr, if (has_vin3_5v(data) && nr == 0) label = labels[0]; - else if (has_12mv_adc(data) || has_10_9mv_adc(data)) + else if (has_12mv_adc(data) || has_10_9mv_adc(data) || + has_11mv_adc(data)) label = labels_it8721[nr]; else label = labels[nr]; From patchwork Sun Mar 12 04:31:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Crawford X-Patchwork-Id: 13171126 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B3575C6FD19 for ; Sun, 12 Mar 2023 04:37:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229621AbjCLEhO (ORCPT ); Sat, 11 Mar 2023 23:37:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229437AbjCLEhN (ORCPT ); Sat, 11 Mar 2023 23:37:13 -0500 Received: from ipmail06.adl3.internode.on.net (ipmail06.adl3.internode.on.net [150.101.137.16]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 11C5D59E62 for ; Sat, 11 Mar 2023 20:37:11 -0800 (PST) IronPort-SDR: 640d55c2_Bec6gPmH2KrnnduYGSammt0anZz1Amiv29RG8Ubo1g38c6x zmq8m1mVOy6jDCKOMNawpEeoX7cxc24OEYNUy5Q== X-SMTP-MATCH: 0 X-IPAS-Result: A2BTAgAwVA1kjPQc8jxaHgEBCxIMSYE7C4Iugk+zUIF+DwEPAQFEBAEBhQUChTMmNAkOAQIEAQEBAQMCAwEBAQEBAQMBAQYBAQEBAQEGBBQBAQEBQEWFaA2GVgIBAycLAQ0BATcBDxk4VwYBEoJ+gl2wRjOBAYIIAQEGgmKaaIFeCYFAi22BFoM2ekI/gU6BFYJ6boQ3hkyYPgqBNHWBIA5Kc4EGAgkCEWuBEghogX5BAg1lCw50gWACgQkDCQMHBUlAAwsYDRY6Eyw1FCFebC4SEgUDCxUqRwQIOQYbNBECCA8SDyxEDkI3NBMGXAEpCw4RA09CGWwEgg4GASgknDlTKB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OpE/pIWLVrDeTq35yeCG3qxduxJOfbO102yU O5qGe5iSDW803yogg0AJKtRPYJxouEl1OACdpzvO2QClbmV9RhtkZDI8xnBlH0ZeMpvnek9O 7HuWWq7SELIvkRtmkjJsMVgEUi7a4NdZATDgcaEwN9QHJcH6OxRYUU+14WvhEqsMSxlwUOwn BjCbKro3eBd2dxSv4/zIJ5iWSSwC/3ODdqtzi7iku5zfevuMNjPvTw7slPIHRpbFppPVsVVl Yaiis/W3kTEjbMyC2vIxpuKEocS18DjTdh8b8b9HERHlBS7Rf7c3hon0EK7IKxvj9lyyJSGR Qy5Sc3obv8TeY5X60N0YhhkMSQ2KvrIfIL/gxiivtKOIBQ5+i7WHuONrHPGQzlSSX4VBsfYF ATxhceL2vlZi4Z9XDk/GPBsBs5DEm/JAKcJWYX4imiFMzOOnFiHh7rFkCgg4xHtDl2vMp7zw bDBdyjEWCWCgoP65/AHjNUqpTwSNmh3vscodEFE+9JWtSGzPFRbEcsja6c5GrNmuQ2s8qGha D/0OT5oTW23WDlfahzz7ejyRgrVVKREJt79ISdv5E+OLTu/AISbGrZ66yN8+DFMdyD+yP28Y 8QrkpEq0sNdHrkyLQrL2sGGvA== IronPort-HdrOrdr: A9a23:8iEumag5amtCP1D7krYhlPxucXBQXgAji2hC6mlwRA09TyX5ra qTdTogtCMc7wxhIU3J+7i7VZVoJEmxyXcb2/hzAV7PZmbbUS6TXeVfBOjZslvd8lPFh4xgPM 5bGsAUNDSzNykcsS+Q2mmF+rgbruVuf82T9J/jJg9WPGRXgrlbnntE4xigYzBLrdZ9dOEE/E v13Ls8mwad X-IronPort-Anti-Spam-Filtered: true Received: from 60-242-28-244.static.tpgi.com.au (HELO bits.crawford.emu.id.au) ([60.242.28.244]) by ipmail06.adl3.internode.on.net with ESMTP; 12 Mar 2023 15:02:01 +1030 Received: from agc.crawford.emu.id.au (agc.crawford.emu.id.au [IPv6:fdd2:7aad:d478:1:0:0:cb10:cc07]) (authenticated bits=0) by bits.crawford.emu.id.au (8.17.1/8.17.1) with ESMTPSA id 32C4VeSK3479492 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sun, 12 Mar 2023 15:31:57 +1100 Authentication-Results: bits.crawford.emu.id.au; arc=none smtp.remote-ip=fdd2:7aad:d478:1::cb10:cc07 DKIM-Filter: OpenDKIM Filter v2.11.0 bits.crawford.emu.id.au 32C4VeSK3479492 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crawford.emu.id.au; s=s1; t=1678595518; bh=csh4yILaXByk+BmlKyVMAylrDHSNbNk98uAL9wEBXYY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rt7uRzQqkngDBMklk/4oPaDtcfuXCF6ATnZqqCPX2iCQxMfYRL5vvpgoRhCTCjvtV +hNQvLc3d7OfyuZ95h+qpQoaeF+w54ooikQ79suE+dfFJPX2T06PtCrycaprfC3Z8f dcgN16wVKTamwGA+vqkSMnWUo1Ed2kdGIe21520DxSWmoJTVSv9RQqP603MY50PWMv yvWa6ZJVtOESLoIpd3Mro7lXONs5XGYNrOx+ptukQcxnde7wUNPBVguzOIp32HRL2u AGrgjG/VXUPciXXwYP+IKtKQ1BFherXvFMW8ixXi/Mr7qn8gOXUOfsE/j8vfRJEFlC pSyiiEB0TXdZw== From: Frank Crawford To: Jean Delvare , Guenter Roeck Cc: linux-hwmon@vger.kernel.org, Frank Crawford Subject: [PATCH v1 2/3] hwmon (it87): Add scaling macro for recent ADC voltages Date: Sun, 12 Mar 2023 15:31:36 +1100 Message-Id: <20230312043137.1744885-3-frank@crawford.emu.id.au> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230312043137.1744885-1-frank@crawford.emu.id.au> References: <20230312043137.1744885-1-frank@crawford.emu.id.au> MIME-Version: 1.0 X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.6.4 (bits.crawford.emu.id.au [IPv6:fdd2:7aad:d478:1:0:0:cb10:cc01]); Sun, 12 Mar 2023 15:31:58 +1100 (AEDT) X-Virus-Scanned: clamav-milter 0.103.8 at bits.crawford.emu.id.au X-Virus-Status: Clean Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org Generalise scaling to include all recent ADC values and match the labels for internal voltage sensor to match. This includes correction of an existing error for voltage scaling for chips that have 10.9mV ADCs, where scaling was not performed. Signed-off-by: Frank Crawford --- drivers/hwmon/it87.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c index fe1291d5be4b..ca4b79839d98 100644 --- a/drivers/hwmon/it87.c +++ b/drivers/hwmon/it87.c @@ -517,6 +517,9 @@ static const struct it87_devices it87_devices[] = { #define has_vin3_5v(data) ((data)->features & FEAT_VIN3_5V) #define has_conf_noexit(data) ((data)->features & FEAT_CONF_NOEXIT) #define has_11mv_adc(data) ((data)->features & FEAT_11MV_ADC) +#define has_scaling(data) ((data)->features & (FEAT_12MV_ADC | \ + FEAT_10_9MV_ADC | \ + FEAT_11MV_ADC)) struct it87_sio_data { int sioaddr; @@ -2006,8 +2009,7 @@ static ssize_t show_label(struct device *dev, struct device_attribute *attr, if (has_vin3_5v(data) && nr == 0) label = labels[0]; - else if (has_12mv_adc(data) || has_10_9mv_adc(data) || - has_11mv_adc(data)) + else if (has_scaling(data)) label = labels_it8721[nr]; else label = labels[nr]; @@ -3139,7 +3141,7 @@ static int it87_probe(struct platform_device *pdev) "Detected broken BIOS defaults, disabling PWM interface\n"); /* Starting with IT8721F, we handle scaling of internal voltages */ - if (has_12mv_adc(data)) { + if (has_scaling(data)) { if (sio_data->internal & BIT(0)) data->in_scaled |= BIT(3); /* in3 is AVCC */ if (sio_data->internal & BIT(1)) From patchwork Sun Mar 12 04:31:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Crawford X-Patchwork-Id: 13171127 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1D34EC6FA99 for ; Sun, 12 Mar 2023 04:37:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229665AbjCLEhQ (ORCPT ); Sat, 11 Mar 2023 23:37:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46816 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229437AbjCLEhP (ORCPT ); Sat, 11 Mar 2023 23:37:15 -0500 Received: from ipmail06.adl3.internode.on.net (ipmail06.adl3.internode.on.net [150.101.137.16]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id F3A755A6D8 for ; Sat, 11 Mar 2023 20:37:13 -0800 (PST) IronPort-SDR: 640d55cb_a3pd9P025ssBjao0qlzSdqeOX5BAovuzVjWxGpkH+JrayMe kLp/4gLnNH/JLXOsbSZkcTQtD7Ve3iJ8ZrzwrEQ== X-SMTP-MATCH: 0 X-IPAS-Result: A2BTAgAwVA1kjPQc8jxaHgEBCxIMSYE7C4Iugk+zUIF+DwEPAQFEBAEBhQUChTMmNAkOAQIEAQEBAQMCAwEBAQEBAQMBAQYBAQEBAQEGBBQBAQEBQEWFaA2GVgIBAycLAQ0BATcBDxk4VwYBEoJ+gl2wRjOBAYIIAQEGgmKaaIFeCYFAi22BFoM2ekI/gU6EfYQLhniYPgqBNHWBIA5Kc4EGAgkCEWuBEghogX5BAg1lCw50gWACgQkDCQMHBUlAAwsYDRY6Eyw1FCFebC4SEgUDCxUqRwQIOQYbNBECCA8SDyxEDkI3NBMGXAEpCw4RA09CGWwEgg4GASgkm0dygQ7GRoQEgVefE0yBRqd5l2YgoyOEKwIKBxaBYoIVTR8ZgyJPAxkPjiAZghORU2E7AgcLAQEDCYhqglkBAQ IronPort-PHdr: A9a23:VvPV9BAmqGsVt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8RcruhlE 9n/Lwm9K223gWdYv0Tvr8MeY2qxXoQiVT3Gheuw9L0EKoIHvORSanoN67qTvUvEFCt8/hmRg hHPWL+O8cxm1rZXvtXNFodtOlyKDO3dBcWyzRCLktVRbNnwH9/EmCELp3LGYQlHH7sjdO5mt LaKse/y2BvOres0WGX3wKuERrh7zpi2VtpqL8vIFWRrrRaDfOTO4BIz3X+yBrIUsdFa5+ihH xCZbunpf/Eret5t/l9nQAkALAQ4FILMcbbGpwmxi9+uGyot+1XLA/3//EC4cFwBUDEDPqPPL zPdutGs14h+l5tNDhpVPMNWKcZ0D3G7UJR3auCrkyeTC1SppVawurHCsx4EwhOTA1mmFPfK2 770diLcRj+T5p6RlMp4trZstCI5FHx+2Ok8XnwM8u5M1gyVMjQ0EvQ/A74nVLdkyyD87cStL nWFJm4vEj70Ujl4YA3xqoarFBuWAusVfMz1PHo19keTcD27H56EHKAnzCp7/nNqYXH2+YlL8 z3FFqHYZXBdGq1UeNs= IronPort-HdrOrdr: A9a23:++qfP6PO7oc/rcBcThujsMiBIKoaSvp037BK7SpMoNJuE/Bw8P re5cjyt3fP5Qr5PUtNpTnuAtjifZqxz/FICMwqTNOftWrdyQ2Vxf9ZnOnfKlTbckWUygce79 YGT0EUMr3N5DZB4/oTb2SDYq4dKaG8gcWVbP/lvgtQpB9RGtxdBthCe32m+pwffng9OaYE X-IronPort-Anti-Spam-Filtered: true Received: from 60-242-28-244.static.tpgi.com.au (HELO bits.crawford.emu.id.au) ([60.242.28.244]) by ipmail06.adl3.internode.on.net with ESMTP; 12 Mar 2023 15:02:11 +1030 Received: from agc.crawford.emu.id.au (agc.crawford.emu.id.au [IPv6:fdd2:7aad:d478:1:0:0:cb10:cc07]) (authenticated bits=0) by bits.crawford.emu.id.au (8.17.1/8.17.1) with ESMTPSA id 32C4VeSL3479492 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sun, 12 Mar 2023 15:32:01 +1100 Authentication-Results: bits.crawford.emu.id.au; arc=none smtp.remote-ip=fdd2:7aad:d478:1::cb10:cc07 DKIM-Filter: OpenDKIM Filter v2.11.0 bits.crawford.emu.id.au 32C4VeSL3479492 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crawford.emu.id.au; s=s1; t=1678595521; bh=tGiY6EjJyqdn5h84EWG/fnSzuttx241dxR8mvw527V8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=p4xZyfisECsOwwy9OtGjOQexXmS1bHDKpQ9LGRwlt1xnyubJk6EphOqAOZlKa5K8v N8Z9FIir3NGkGE/iObQHaJhEDoFAzr5PWOGnYvs+mXiMfsffnbcPRsNb1sTom/hTT4 aWPmYWu99m9J+hqFuAzaPJYYRAtnB05V3mqLfbod7N7ca24oeMrUY9r9kdMKIbxB7j ECvJzAq28nIoCm4Ol89Q/UaJBjbjr/28qqPafGTy4i4mALfhFTB5UZCTxgEtj22Ast hhX+W35uGb9O/QDZSfFlZT3NUw8Rj38+g35RRcRpEgY7KrnYLQhuaoX7DXwmVcbASF mVySvge+GacYQ== From: Frank Crawford To: Jean Delvare , Guenter Roeck Cc: linux-hwmon@vger.kernel.org, Frank Crawford Subject: [PATCH v1 3/3] hwmon (it87): Minor optimisation of return value Date: Sun, 12 Mar 2023 15:31:37 +1100 Message-Id: <20230312043137.1744885-4-frank@crawford.emu.id.au> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230312043137.1744885-1-frank@crawford.emu.id.au> References: <20230312043137.1744885-1-frank@crawford.emu.id.au> MIME-Version: 1.0 X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.6.4 (bits.crawford.emu.id.au [IPv6:fdd2:7aad:d478:1:0:0:cb10:cc01]); Sun, 12 Mar 2023 15:32:01 +1100 (AEDT) X-Virus-Scanned: clamav-milter 0.103.8 at bits.crawford.emu.id.au X-Virus-Status: Clean Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org Optimisation of return value from previously applied patch sets. Signed-off-by: Frank Crawford --- drivers/hwmon/it87.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c index ca4b79839d98..7780a5cfd352 100644 --- a/drivers/hwmon/it87.c +++ b/drivers/hwmon/it87.c @@ -2865,7 +2865,7 @@ static int __init it87_find(int sioaddr, unsigned short *address, sio_data->skip_pwm |= dmi_data->skip_pwm; exit: - superio_exit(sioaddr, config ? has_conf_noexit(config) : false); + superio_exit(sioaddr, config && has_conf_noexit(config)); return err; }