[PATCH 2/2] Replace magic values with constants

Marius Zachmann posted 2 patches 2 months, 3 weeks ago
[PATCH 2/2] Replace magic values with constants
Posted by Marius Zachmann 2 months, 3 weeks ago
Replace two magic values in ccp_device with
existing constants.

Signed-off-by: Marius Zachmann <mail@mariuszachmann.de>
---
 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];
 };
-- 
2.51.2
Re: [PATCH 2/2] Replace magic values with constants
Posted by Guenter Roeck 2 months, 3 weeks ago
On Thu, Nov 13, 2025 at 11:00:24AM +0100, Marius Zachmann wrote:
> Replace two magic values in ccp_device with
> existing constants.
> 
> Signed-off-by: Marius Zachmann <mail@mariuszachmann.de>

Applied. Please watch out for the subject line in the future. It should
start with "hwmon: (corsair-cpro)".

Thanks,
Guenter