From patchwork Sat May 20 09:54:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aleksa Savic X-Patchwork-Id: 96748 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp269275vqo; Sat, 20 May 2023 03:12:35 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6vxkwztcpSITj5q6AO8+HQXL1jNGPL4qk+8c7axx6aYnCs6rDxBZc+Vc04PnWXkUgNDnB/ X-Received: by 2002:a05:6a21:985:b0:106:57b9:6da1 with SMTP id li5-20020a056a21098500b0010657b96da1mr3967165pzb.20.1684577555463; Sat, 20 May 2023 03:12:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684577555; cv=none; d=google.com; s=arc-20160816; b=wkYC+UzxQwyf/6VP5w334E4TuniFrdw055ufvHzdR1rsOCr3iUUR+BLZB2nP7J4Qm3 u5NwYOO2BRpw5qohIvEwT8C43i6QRAt/n8ig02KXHpoASuwT/qHNKtGOMqzb05aukSpF xHH+MX66PKlf7jCe1BN8W5uLKRQKKlFFDQ4F1r8rcY2jvrtp22Dg3NQ6FFixaWNnryPd ioM0Zcux1GG7+klevAfRha3MLATEDiQ4ciWZMnrHZuaZ3MRS/FCne3rutvUnPa2g0fuL uuEGWVCP8Tatl4v3FTx4O4kkKCvF37w9/9Q7xl7L6K9pLAR12MeHD/XUjmeNx0bpuKjH hG3A== 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=NOV4ikLHil+NmCoyv1115ovSQRMzJUspMmqIvjYUuKM=; b=xiZ8NewrKzOSKcG5jvPkQNU60liBgbYhIHzynqVOflsh5l1wn8Oicd/cUU90HbOsnV KwEGbgri6ZbOeDTju3igkrrPJ65V+QpfN4Yry3SpwJvWzRpIH5G5wYX4Te45yH6LkuYm 14VqS00hLXy73wClPcJBPj9RvVX0M+wjLeAFaXBFPnTdxjz7AdwMlZKk+sY9/BqS8NlI t743SJrNJeLKoD8F6e+X+2AY2qH8EoIgso6nyYeu+nCPu/11mzfEvDX0gNsen+7ENu+2 6k38Hfgv/3kEMx9mvbIo0LSm0eFLsf1ABafaw+AjD/qe0mzijU5jbeSWLmqlMwpP6e2w +KZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=FHcZ1k1g; 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 w12-20020a637b0c000000b0053415af4631si1336814pgc.73.2023.05.20.03.12.20; Sat, 20 May 2023 03:12:35 -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=FHcZ1k1g; 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 S231463AbjETJz2 (ORCPT + 99 others); Sat, 20 May 2023 05:55:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231464AbjETJz1 (ORCPT ); Sat, 20 May 2023 05:55:27 -0400 Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [IPv6:2a00:1450:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC9D6E5D; Sat, 20 May 2023 02:55:22 -0700 (PDT) Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-96f0678de80so761576466b.3; Sat, 20 May 2023 02:55:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684576521; x=1687168521; 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=NOV4ikLHil+NmCoyv1115ovSQRMzJUspMmqIvjYUuKM=; b=FHcZ1k1g7sXLkHNpv6ic4+tkTVXUywEYJzle/yG0N/CMNC1eFCzljipnXyyimtssOu kNHH8XvLOQb2n8xyGTQykpYfi+/I0nlvKEiGQ9CshuXejlWiJjeKupjzQu8HJ5HJuR1J xz7jQadwrVf8MH6KZ4itnQ+Q2agYYTyaDmlJ8HajEWuAKL+mMH5qvK6lMuAp0qjz+hg1 2nzvCVpJ1xLMl9lbt225ztlsl8b6T6btweSWuUEi3Q1U/ekpbw01mMW5T0jLQR4qb/xP oMs4VRKWa/LMdH5YSXdqeFldKM55hHHluz1Aoq1+1fkJolc9IoRWg7qGdqBMBAuEFa3a NdsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684576521; x=1687168521; 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=NOV4ikLHil+NmCoyv1115ovSQRMzJUspMmqIvjYUuKM=; b=JStZd+d28UP+LwsNEBmvntl5HmfT7T7Oh9dbrB4ZhUj6fUmmIa/pAMTbpMRy6bP4M5 +l417et8lo8TLG21y4ZpjDsNIJXu2K3bA8IzzwnpuOPUARYBoU6SNQDv4VOA3S8xlXKo vgZ16nmjs/FDmYLOZBOMD/DsOUPR3WYnvxvi9UOVe3yAVAzR5/mPlUYtDxxLFhG0QSOb rdIg1dIAJQVATRd07fgDA/0pfz6vUIwsurgy5mHdcGCQ6CdXyJwmRTLxl50EZIPj0/H2 DdIrHk5Tfa1ayHqGOMwaQvVvvSdxYNuVV/pONc+WrhcXyRf4PNHKB3SSiyIOK3dCf8FQ 7KrA== X-Gm-Message-State: AC+VfDy3GvmV+QPNNUQBA52tSxGrm+qfZq4teI/nrFEQ9L4wSFPVnK4Z kNzabOPEPD7+44yxNpCUUatd8cN6lawtrQ== X-Received: by 2002:a17:906:4d8f:b0:94f:3bf7:dacf with SMTP id s15-20020a1709064d8f00b0094f3bf7dacfmr4341977eju.71.1684576521184; Sat, 20 May 2023 02:55:21 -0700 (PDT) Received: from fedora.. ([87.116.164.240]) by smtp.gmail.com with ESMTPSA id jy18-20020a170907763200b0094e1344ddfdsm628335ejc.34.2023.05.20.02.55.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 20 May 2023 02:55:20 -0700 (PDT) From: Aleksa Savic To: linux-hwmon@vger.kernel.org Cc: main@ehvag.de, Aleksa Savic , Jack Doan , Jean Delvare , Guenter Roeck , Jonathan Corbet , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/2] hwmon: (aquacomputer_d5next) Rename AQC_TEMP_SENSOR_DISCONNECTED Date: Sat, 20 May 2023 11:54:46 +0200 Message-Id: <20230520095447.509287-2-savicaleksa83@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230520095447.509287-1-savicaleksa83@gmail.com> References: <20230520095447.509287-1-savicaleksa83@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, 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?1766407594773686557?= X-GMAIL-MSGID: =?utf-8?q?1766407594773686557?= Rename the macro in question to AQC_SENSOR_NA because more than just temperature sensors use this value to indicate that they don't have a reading. Implemented by Noah Bergbauer [1]. [1] https://github.com/aleksamagicka/aquacomputer_d5next-hwmon/pull/41 Originally-from: Noah Bergbauer Signed-off-by: Aleksa Savic --- Changes in v2: - Introduced this patch --- drivers/hwmon/aquacomputer_d5next.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/hwmon/aquacomputer_d5next.c b/drivers/hwmon/aquacomputer_d5next.c index a4fcd4ebf76c..834d011e220f 100644 --- a/drivers/hwmon/aquacomputer_d5next.c +++ b/drivers/hwmon/aquacomputer_d5next.c @@ -93,7 +93,7 @@ static u8 aquaero_secondary_ctrl_report[] = { #define AQC_FIRMWARE_VERSION 0xD #define AQC_SENSOR_SIZE 0x02 -#define AQC_TEMP_SENSOR_DISCONNECTED 0x7FFF +#define AQC_SENSOR_NA 0x7FFF #define AQC_FAN_PERCENT_OFFSET 0x00 #define AQC_FAN_VOLTAGE_OFFSET 0x02 #define AQC_FAN_CURRENT_OFFSET 0x04 @@ -1224,7 +1224,7 @@ static int aqc_raw_event(struct hid_device *hdev, struct hid_report *report, u8 sensor_value = get_unaligned_be16(data + priv->temp_sensor_start_offset + i * AQC_SENSOR_SIZE); - if (sensor_value == AQC_TEMP_SENSOR_DISCONNECTED) + if (sensor_value == AQC_SENSOR_NA) priv->temp_input[i] = -ENODATA; else priv->temp_input[i] = sensor_value * 10; @@ -1235,7 +1235,7 @@ static int aqc_raw_event(struct hid_device *hdev, struct hid_report *report, u8 sensor_value = get_unaligned_be16(data + priv->virtual_temp_sensor_start_offset + j * AQC_SENSOR_SIZE); - if (sensor_value == AQC_TEMP_SENSOR_DISCONNECTED) + if (sensor_value == AQC_SENSOR_NA) priv->temp_input[i] = -ENODATA; else priv->temp_input[i] = sensor_value * 10; @@ -1277,7 +1277,7 @@ static int aqc_raw_event(struct hid_device *hdev, struct hid_report *report, u8 sensor_value = get_unaligned_be16(data + priv->calc_virt_temp_sensor_start_offset + j * AQC_SENSOR_SIZE); - if (sensor_value == AQC_TEMP_SENSOR_DISCONNECTED) + if (sensor_value == AQC_SENSOR_NA) priv->temp_input[i] = -ENODATA; else priv->temp_input[i] = sensor_value * 10;