From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f48.google.com (mail-pj1-f48.google.com [209.85.216.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DADEC2DCBF8 for ; Sat, 30 May 2026 22:14:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780179273; cv=none; b=mUfReoCV0ZXxmVge976X8ysGV8PcXo472slJDPvQrdW0ik1HbIXpyq5W6KmHT4l74bhw0oro2j1UQA8+zjKBBLw/oZL4W+ZfAi6lWDDEzPZzOa+hCLef6kugWp/Khoyz0TPf7FD8u0Pb9Bt85BGXL8k3U/fLJP4zCEj8SpJOyXc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780179273; c=relaxed/simple; bh=FeHdaBBfyV4F3PeK8+YiWOaoq1RUM3CERCLEzLvj6vI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Vnj95xwaAUzVB80Fp89lbN98XmSrTAW4Isqm5LeDp0EWt64ZBOvqrx5BbpzYFmngFETAhQpRdID5Ijy8LFFuHMDxGkMDp34ty7KD+IWwlJ80Aydor8eb/L+yYwS3kBAtJcx0i1svJSa59RDlgVdawSpVLzwgAp5uoGKREftwyYM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=VJClpdV9; arc=none smtp.client-ip=209.85.216.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="VJClpdV9" Received: by mail-pj1-f48.google.com with SMTP id 98e67ed59e1d1-36d98c9b596so78409a91.3 for ; Sat, 30 May 2026 15:14:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1780179271; x=1780784071; darn=vger.kernel.org; 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=aUVvVFEPyFCdwPbawuwyV/+BICpnO9Bhunehl4oYhLs=; b=VJClpdV99Zkhu0zMMuwfyeCfod1IHs+QZ234KPDy6WBjtrIFIqDvIJ4PXrGyjM/HDx siyNcBFwOpo1sFVsbzQfeYQGUHi9TfWsXFloQZGaY1zGibrTjyj0tVYVhZg00WlqU7pr lvB6lhwQTDtSn8bicxbLuBVsNrPgDsCGk6Kl3uPRvuidMr43WKtC8/7I0D6F6xBoyU+0 UPlaR4LCmLcbDgfShHRNjBpUug7tOtSDiaB67Gqa9rura18fA15GqU8+JM+vebUFon4t C8jYL8b5S08efLRrXivjIijR+QIdcgn+Gzozipkt6gnIbeLKpYG549vSNRkSWcmFR8WA 5EbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780179271; x=1780784071; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=aUVvVFEPyFCdwPbawuwyV/+BICpnO9Bhunehl4oYhLs=; b=Kj0zncqZL1lpsee6RIDImaH2VEWl/6f9aRHFi2CZ7f7KPieosUkGI75QKOiGVK1ok4 8lvhw/T5Ir7KiaR5lHU7EjHdI80umACNOYF2Yd3/efpj7Ca7CW02EKE9sDLgUpn7xEYB VcjzT0Hq34dKmtMev+uNlShqjtQZVG4/Oa8YMT+ctkbVmGcq9omqXj+vuP1M2xGCmNIh vwLgBCiCAKWB+ZxUkoT3aKEfDPMv3bJpaD6Q69GMs+mxb5vjsYAam+UFlXvKcJVxqWVb qyBfwNUac1dawvqeC1E9BSi33sbAZLWBZ9nI+VPAvB0GObGr9V/uI6HbVotITtsFOBpq Bilw== X-Forwarded-Encrypted: i=1; AFNElJ+CdvRX/m9r3FJdkf9MsmbfuSucuOxnr1l1UYLbYTJHZ+cVeZyOb+5YEEDGLQzcAzuFMwDkVK52I75iz/E=@vger.kernel.org X-Gm-Message-State: AOJu0YxBVp3rc6yYRsJUziU0ZQsc2cziApa7PxpsB/y43md76vgtzy+A H9NCWN1ckU9Ry1hiUdEZLbNLQWP2QfG7ndOiSh45vGQW458sWdgAnC8A X-Gm-Gg: Acq92OGwS7+c6gwaVT5E1Dao80yyAAwVQLd7t+Q1v0+4UoxgDuzW05xvqtLFahqoz25 ecAMebHOP4d2WSA/Wd/2ITYBsilBkoxUKcjb+0pV3uNeBQi60wDRXzOacklTui/Rv25XNPxMqcV hjKli+aeAEhGZd2wgsIjukFdBjL/9it2iUe5tVHHdIXHIhdjVAcym/ySq3LFmd5GQXWyDAtjjVI 1Np+bbPfUKPUAXeumQ2VACKhgusWfkVkqo9Spjp+A3ftEpBjlNt5j8Pzb7oO68SctZ3T4Ix7GgD AXkAt1CaMLzq6xLijbt2JnWKtSq4Bgf3SAc6WHRoDdEqWMz550InsKTMfRlgzvJVkoyk7ctm3ch NIpUnFQBI/tEyJqv6QVZoFdSGHN/eDSBEX7Wi4GKBhl5pt+wBA3jqyuOvqYIcoOkIIjHPYn1ZeZ 2VmijPKFlEyTPvI4VJjHbYyqu49SV+7y2Jva9CGdxetvn/RMKErbE7TisDdGz4lUDMIkkZVLfHs y5iGuuV14SQj0E= X-Received: by 2002:a05:6300:279a:10b0:3b2:92e0:99f0 with SMTP id adf61e73a8af0-3b427e62a8bmr2776268637.6.1780179271103; Sat, 30 May 2026 15:14:31 -0700 (PDT) Received: from Ubuntu.. ([49.37.171.82]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-c85771a9299sm5515226a12.7.2026.05.30.15.14.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 May 2026 15:14:30 -0700 (PDT) From: Manish Baing To: linux@roeck-us.net, jdelvare@suse.com, nuno.sa@analog.com Cc: abdurrahman@nexthop.ai, bartosz.golaszewski@oss.qualcomm.com, linusw@kernel.org, linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org, skhan@linuxfoundation.org, me@brighamcampbell.com, manishbaing2789@gmail.com Subject: [PATCH 4/7] hwmon: nct6683: Use zero-initialization instead of memset() Date: Sat, 30 May 2026 22:13:49 +0000 Message-ID: <20260530221353.159461-5-manishbaing2789@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260530221353.159461-1-manishbaing2789@gmail.com> References: <20260530221353.159461-1-manishbaing2789@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Reduce the scope of 'struct resource res' by moving it inside the for-loop and using empty brace initialization (= {}). This ensures the structure is safely zero-initialized on every iteration, allowing for the safe removal of explicit memset() call. No functional change. Signed-off-by: Manish Baing --- drivers/hwmon/nct6683.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/hwmon/nct6683.c b/drivers/hwmon/nct6683.c index 0581770380cc..bd30867f9e7c 100644 --- a/drivers/hwmon/nct6683.c +++ b/drivers/hwmon/nct6683.c @@ -1437,7 +1437,6 @@ static int __init sensors_nct6683_init(void) { struct nct6683_sio_data sio_data; int sioaddr[2] = { 0x2e, 0x4e }; - struct resource res; bool found = false; int address; int i, err; @@ -1454,6 +1453,8 @@ static int __init sensors_nct6683_init(void) * nct6683 hardware monitor, and call probe() */ for (i = 0; i < ARRAY_SIZE(pdev); i++) { + struct resource res = { }; + address = nct6683_find(sioaddr[i], &sio_data); if (address <= 0) continue; @@ -1471,7 +1472,6 @@ static int __init sensors_nct6683_init(void) if (err) goto exit_device_put; - memset(&res, 0, sizeof(res)); res.name = DRVNAME; res.start = address + IOREGION_OFFSET; res.end = address + IOREGION_OFFSET + IOREGION_LENGTH - 1; -- 2.43.0