[PATCH 1/7] hwmon: drivetemp: Use zero-initialization instead of memset()
From: Manish Baing
Date: Sat May 30 2026 - 18:14:15 EST
Use empty brace initialization (={}) instead of explicit memset()
to zero-initialize stack memory to simplify the code.
No functional change.
Signed-off-by: Manish Baing <manishbaing2789@xxxxxxxxx>
---
drivers/hwmon/drivetemp.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/hwmon/drivetemp.c b/drivers/hwmon/drivetemp.c
index 002e0660a0b8..b75cd5f5246e 100644
--- a/drivers/hwmon/drivetemp.c
+++ b/drivers/hwmon/drivetemp.c
@@ -161,11 +161,10 @@ static int drivetemp_scsi_command(struct drivetemp_data *st,
u8 ata_command, u8 feature,
u8 lba_low, u8 lba_mid, u8 lba_high)
{
- u8 scsi_cmd[MAX_COMMAND_SIZE];
+ u8 scsi_cmd[MAX_COMMAND_SIZE] = { };
enum req_op op;
int err;
- memset(scsi_cmd, 0, sizeof(scsi_cmd));
scsi_cmd[0] = ATA_16;
if (ata_command == ATA_CMD_SMART && feature == SMART_WRITE_LOG) {
scsi_cmd[1] = (5 << 1); /* PIO Data-out */
--
2.43.0