From nobody Sun Feb 8 00:34:35 2026 Received: from relay.yourmailgateway.de (relay.yourmailgateway.de [188.68.63.174]) (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 C200429BDB0; Thu, 13 Nov 2025 10:07:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=188.68.63.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763028446; cv=none; b=N5JRwKx+deL78it2m5lflFxZ1hhUo/RmGU3S/twUciP11ynF/K+pLXWNWfx0i5P2Arn2hcozWO9t7cZ8cfQNm8moPnKOu3c89+PGDOWFsGsjZI3AqpwYviK2Qy/Qu6NOLjfxIucWQXDE8EL7M5C2waLftuHanOuren3atHqf608= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763028446; c=relaxed/simple; bh=hwOO8lce2sNESlltEsz9UBCVjNvi3fzRZbc3isrv7Kg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=D0ufwJvkqIcQeSTI8Mahc0QcziaytbJUX46lcHNLhxBMScKsyyNUh0mcQH05KXBGhhKWh0UNHYSDhwMtG9KMphqDE7ha80kzRtam39kZHf0x5qf8Mm3GGvChFKoGG/HCoehb9WYDBhCY8CBnm6iwGk4fBhWh1BKAUPy0l/lRo/8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=mariuszachmann.de; spf=pass smtp.mailfrom=mariuszachmann.de; dkim=pass (2048-bit key) header.d=mariuszachmann.de header.i=@mariuszachmann.de header.b=KGef3YPh; arc=none smtp.client-ip=188.68.63.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=mariuszachmann.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mariuszachmann.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=mariuszachmann.de header.i=@mariuszachmann.de header.b="KGef3YPh" Received: from mors-relay8204.netcup.net (localhost [127.0.0.1]) by mors-relay8204.netcup.net (Postfix) with ESMTPS id 4d6bPb2yc2z8gKn; Thu, 13 Nov 2025 10:00:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mariuszachmann.de; s=key2; t=1763028051; bh=hwOO8lce2sNESlltEsz9UBCVjNvi3fzRZbc3isrv7Kg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KGef3YPh77PeSFNBKrTpyW47lbXSRVKsu4daCDPes56vmua5W67/rrMWAl53IuNhi Ky1sGi1hZKQntpwTlvpyyBmG5Iq4Xs2ROu5JyzplwT5ULYVnvd1kkiUUxV/07u7mjK LLXNjn1z+CKVcDGErP03UORJSd+z/lsoHkQh8cqoqrvzXlt2BEXjOsFnOyCnCXCrBY qrLtJVF2Dv7g57EwFwCKA4TuVbl7m/eK/1eayROyKpkt/qlX7zvbrHYNBGGSbTS4p2 R+wLUsS3ovxvTPPjnEW0ngBhdyf6o0GYiq0QmNUcitQQtmzrjo3Y51QKonqAEmpsP2 lfyto4x/0UVNw== Received: from policy02-mors.netcup.net (unknown [46.38.225.35]) by mors-relay8204.netcup.net (Postfix) with ESMTPS id 4d6bPb2FlCz8gKj; Thu, 13 Nov 2025 10:00:51 +0000 (UTC) Received: from mxe9aa.netcup.net (unknown [10.243.12.53]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by policy02-mors.netcup.net (Postfix) with ESMTPS id 4d6bPb0RB9z8sbC; Thu, 13 Nov 2025 11:00:51 +0100 (CET) Received: from marius (dynamic-2a02-3102-8004-0800-b21c-0b06-5865-dcdb.310.pool.telefonica.de [IPv6:2a02:3102:8004:800:b21c:b06:5865:dcdb]) by mxe9aa.netcup.net (Postfix) with ESMTPSA id 149C08009E; Thu, 13 Nov 2025 11:00:50 +0100 (CET) Authentication-Results: mxe9aa; spf=pass (sender IP is 2a02:3102:8004:800:b21c:b06:5865:dcdb) smtp.mailfrom=mail@mariuszachmann.de smtp.helo=marius Received-SPF: pass (mxe9aa: connection is authenticated) From: Marius Zachmann To: linux@roeck-us.net Cc: mail@mariuszachmann.de, linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] Read temperature as a signed value. Date: Thu, 13 Nov 2025 11:00:23 +0100 Message-ID: <20251113100024.11103-2-mail@mariuszachmann.de> X-Mailer: git-send-email 2.51.2 In-Reply-To: <20251113100024.11103-1-mail@mariuszachmann.de> References: <20251113100024.11103-1-mail@mariuszachmann.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-PPP-Message-ID: <176302805038.2250114.13495403452605665157@mxe9aa.netcup.net> X-NC-CID: Tf9+vAFxafhT32NVSJoChcpQ2OXf9fmixHfx6Jftn5GxkM2EZ6c= X-Rspamd-Server: rspamd-worker-8404 X-Rspamd-Queue-Id: 149C08009E Content-Type: text/plain; charset="utf-8" Convert temperature to s16 to correctly read negative temperatures. Signed-off-by: Marius Zachmann --- drivers/hwmon/corsair-cpro.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/hwmon/corsair-cpro.c b/drivers/hwmon/corsair-cpro.c index b7b911f8359c..6e1c415f3e26 100644 --- a/drivers/hwmon/corsair-cpro.c +++ b/drivers/hwmon/corsair-cpro.c @@ -40,7 +40,7 @@ #define CTL_GET_TMP 0x11 /* * send: byte 1 is channel, rest zero * rcv: returns temp for channel in centi-degree celsius - * in bytes 1 and 2 + * in bytes 1 and 2 as a two's complement value * returns 0x11 in byte 0 if no sensor is connected */ #define CTL_GET_VOLT 0x12 /* @@ -258,7 +258,7 @@ static int ccp_read(struct device *dev, enum hwmon_sens= or_types type, ret =3D get_data(ccp, CTL_GET_TMP, channel, true); if (ret < 0) return ret; - *val =3D ret * 10; + *val =3D (s16) ret * 10; return 0; default: break; --=20 2.51.2 From nobody Sun Feb 8 00:34:35 2026 Received: from relay.yourmailgateway.de (relay.yourmailgateway.de [188.68.63.166]) (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 564BE2E3AF2; Thu, 13 Nov 2025 10:06:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=188.68.63.166 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763028389; cv=none; b=nI7EdEwI7C3UKUCfshHDRDXAk9BFpcH+x+xMpcmc7/qzYtd2cW2lCOfVugB4errgLtuNcQEKPPJVhyyD4osAVh9GAWfL/8D4vk4LPX6GT1e6OTkG9EHMFewOaSS1aPHv8fdnJc/kOmQC+qJMFq+iEiZ7I2AgSJ9fJpFbPdD1r5c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763028389; c=relaxed/simple; bh=pO8SwLnIvnuTHMLjXxP2KDEK/lQI9uUpXyBuVHnAocE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GNV4e9+B1YKxfzz485jF+mID/FYexQX7ytEDKyCIeJfPUMwenPjE+9KM6HAnvULQU+wx8DPmO87M44KG/nWt57PJwTcxEHD1XrJxi6BzaP22dKxta73oiEQDm20hh9oU5vr5V1UBnTv2frpsME+IGjcTFJJV5df5oFiHuxbqNTU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=mariuszachmann.de; spf=pass smtp.mailfrom=mariuszachmann.de; dkim=pass (2048-bit key) header.d=mariuszachmann.de header.i=@mariuszachmann.de header.b=KrgCdqcV; arc=none smtp.client-ip=188.68.63.166 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=mariuszachmann.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mariuszachmann.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=mariuszachmann.de header.i=@mariuszachmann.de header.b="KrgCdqcV" Received: from mors-relay-8202.netcup.net (localhost [127.0.0.1]) by mors-relay-8202.netcup.net (Postfix) with ESMTPS id 4d6bPc1p9wz47Gm; Thu, 13 Nov 2025 11:00:52 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mariuszachmann.de; s=key2; t=1763028052; bh=pO8SwLnIvnuTHMLjXxP2KDEK/lQI9uUpXyBuVHnAocE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KrgCdqcVGD+kPBS6mjHEwCdF24cJke1qxZFsZm7a7QmEIou0/aV643tDZ+u2SD+qm xmHwdwtA64rUyCttZjjmJfvRWwyDcKcWptlNipzBM9IKOqpmWC4z2BGZclrbhtfY3Y RrKGaGDZc7s1Sn+yeN0jIi3kDH4d+/LGaBJoixSvkGOYQWA89/jLR/ZtyivNo41GVi fMvnV7/yL22WVcPVGvoLNHcIz/7S5HY/d4E756pHtUeeqcuIjIZHj1ZYzT+OqyJhHQ 9abiV5RP6YlSsYL/X1goZns41GCzekHStwPSk/RtUNwdtEIQ4i639JMvqdv8xQwksU D/cC0eO0wrWGg== Received: from policy02-mors.netcup.net (unknown [46.38.225.35]) by mors-relay-8202.netcup.net (Postfix) with ESMTPS id 4d6bPc14mRz47GZ; Thu, 13 Nov 2025 11:00:52 +0100 (CET) Received: from mxe9aa.netcup.net (unknown [10.243.12.53]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by policy02-mors.netcup.net (Postfix) with ESMTPS id 4d6bPb6Lf6z8sbC; Thu, 13 Nov 2025 11:00:51 +0100 (CET) Received: from marius (dynamic-2a02-3102-8004-0800-b21c-0b06-5865-dcdb.310.pool.telefonica.de [IPv6:2a02:3102:8004:800:b21c:b06:5865:dcdb]) by mxe9aa.netcup.net (Postfix) with ESMTPSA id 0E6D48009C; Thu, 13 Nov 2025 11:00:51 +0100 (CET) Authentication-Results: mxe9aa; spf=pass (sender IP is 2a02:3102:8004:800:b21c:b06:5865:dcdb) smtp.mailfrom=mail@mariuszachmann.de smtp.helo=marius Received-SPF: pass (mxe9aa: connection is authenticated) From: Marius Zachmann To: linux@roeck-us.net Cc: mail@mariuszachmann.de, linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] Replace magic values with constants Date: Thu, 13 Nov 2025 11:00:24 +0100 Message-ID: <20251113100024.11103-3-mail@mariuszachmann.de> X-Mailer: git-send-email 2.51.2 In-Reply-To: <20251113100024.11103-1-mail@mariuszachmann.de> References: <20251113100024.11103-1-mail@mariuszachmann.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-PPP-Message-ID: <176302805133.2250130.5825952192716163697@mxe9aa.netcup.net> X-NC-CID: EsN6IQ3yOu//ecgIdG13T6L9hBJpmHpB6XDXUTYxr9BSku0tmvk= X-Rspamd-Server: rspamd-worker-8404 X-Rspamd-Queue-Id: 0E6D48009C Content-Type: text/plain; charset="utf-8" Replace two magic values in ccp_device with existing constants. Signed-off-by: Marius Zachmann --- drivers/hwmon/corsair-cpro.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/hwmon/corsair-cpro.c b/drivers/hwmon/corsair-cpro.c index 6e1c415f3e26..e755353dd461 100644 --- a/drivers/hwmon/corsair-cpro.c +++ b/drivers/hwmon/corsair-cpro.c @@ -90,10 +90,10 @@ struct ccp_device { u8 *cmd_buffer; u8 *buffer; int buffer_recv_size; /* number of received bytes in buffer */ - int target[6]; + int target[NUM_FANS]; DECLARE_BITMAP(temp_cnct, NUM_TEMP_SENSORS); DECLARE_BITMAP(fan_cnct, NUM_FANS); - char fan_label[6][LABEL_LENGTH]; + char fan_label[NUM_FANS][LABEL_LENGTH]; u8 firmware_ver[3]; u8 bootloader_ver[2]; }; --=20 2.51.2