From nobody Wed Dec 17 21:26:11 2025 Received: from mail-vs1-f54.google.com (mail-vs1-f54.google.com [209.85.217.54]) (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 CE805487A5 for ; Wed, 18 Dec 2024 02:56:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.217.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734490571; cv=none; b=bxL3kWFA0UhM20yWQ9Y4PLnQ5EUqs1Gaa+lKuP16RS7706e9rU6ya1XbMZP+zqh0M+oKEaiK1L7ZulLu+D6oA98AVdSKu/8HGsDCBZjmIH2PqNALOoml4vjx0DAoVykS5CrJ7H+v9p9eZTrGTRokFxBBBkLAGg0PwvAaytrKeVA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734490571; c=relaxed/simple; bh=HMT7ymrg7muZbCh4orsKnOowhGi0scta8H0Ya7UnDs8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc; b=RaqiXb7qEI8K/8/EYiZt66PcajY1+qOQxaRlNkepoz8bZqomewNq6ArQOgSlVwgJ0671o5QST5xK9dNaGHYvO+3KZp76wCPm1wfstEuHSqLQAXXGuc6E1Gdhqeq/THCA+plmjwMlm5YIwSPP7vougg/JLnCpZiouDm/K8Ee/J6w= 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=RM3z9/wu; arc=none smtp.client-ip=209.85.217.54 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="RM3z9/wu" Received: by mail-vs1-f54.google.com with SMTP id ada2fe7eead31-4afecb2731dso1714362137.3 for ; Tue, 17 Dec 2024 18:56:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734490568; x=1735095368; darn=vger.kernel.org; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:from:to:cc:subject:date:message-id:reply-to; bh=/MGnTuEMctB6wlh4CNFaMVpSKzC3AE17XrRVHhf36cc=; b=RM3z9/wuPlJoZ5Y++/6vckjCsJylE3WT0pRzSCc4cqclnVFdWtLTEckf7ttmyellYy V761wp8kG3GiRbbrV5t4I8wt+tS9GdsECJMcDRsIKXgH2lg6eHpS1iwRIZfwxijXYHUT caex3BzKLUosXSHYrlE2/GuVjFiVzx0gkw7AzqhiBFtTl/UmEuScP/EqbIR1I5Ksd0vS gAwZeIrYh4NzYtgAdesqXCReN5cFTEaJn7WRIonuNwWdOn5u9BXxoUk0pPGREJBHIl9H H8SRrYk3RaPoCX3/LuSRPsDqRcBhBH7FSGcWXtXzj/aOwmD3aJZJq9+8zd/vmxur5rFT 4lbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734490568; x=1735095368; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=/MGnTuEMctB6wlh4CNFaMVpSKzC3AE17XrRVHhf36cc=; b=MADewXt91JYpb3/ZQEfo3N9PYol3U63hCgUBS/Z0EkNwKS9bOR8w0oW4Fap435yFnN 5usJZX3zzBGdMG5gRnEHqNIgahaIfyGvopdNbGA6f1uMXbBDQscR0jQZJhJ3+YuwOkbr ooKFuFPfHXXDst+AL1dtGiFOG/GSGW17CvJw2llpOWMIAZH3dq0aI/HYLpx0Z+7QGWUR A+Ounfq8LdnLLFIn8C8oa11m9IwsMvRCej/zlyMG4C7O/BrViKYaVsZo3arOK12YY7fS aeF87SClhxHL+ajqOApGxTw6DxrDSbeWhlLaubCuxWjMwEH6BjsthXGJ8c89X2HNFXHu xR2Q== X-Forwarded-Encrypted: i=1; AJvYcCWsYLGdak94YbMoBte1Wz0VtSmbYJP6xh+B8tmE95nNtpJSy9JxyU8mkEogRoQ6gy8o4w9WPEqRYx1JQTo=@vger.kernel.org X-Gm-Message-State: AOJu0YydGSOiDRqjiT0YgtxYF4oK6Ao+GFiHGdB2QhZWJ5ZEJLcLKMws 1bS6iAEXk6mYekWMUm4tA4GwYTStt3ExtKlaOx+dmCdCBpwOtfu5 X-Gm-Gg: ASbGncsxfPEX27yrmRXMFDXG6dvuK5HILIpAY8qUJjobdfI9+zlxPlcDdmr9nUYU0UJ Eyt4ldKIz4GXHOLhpXmNMUSqNSTh5PtiHwv44/90yOb4Y8eYyhzOxBWvQPWBHnPwV+pnc6sKIX2 At3A4+of0HqHJiMHrkrceP1ZdMncnt8xgFkdP/IolLOM1TcbY8tCtsoOUDKdHSnh2LaYvIgQoUP w9lxAdK37jsL2jGsD2wGzVWX56N39hZt5jYRhAjK3F3kTMoKi7CYn68jSEiNaEjc1EtSzauVLWQ PJkk/QS/mg7YXPNujyuz+iaJWoiFQOsRkJKDdF3QAg== X-Google-Smtp-Source: AGHT+IG8BM3RRv86o6y32VDpnRH4tLU3ksmo2dZ91zFqb+jsyb+VxkLDFBtcAttyZUzXjbObDwB3wg== X-Received: by 2002:a05:6102:160e:b0:4b1:5cc6:92df with SMTP id ada2fe7eead31-4b2ae549730mr1552937137.0.1734490568555; Tue, 17 Dec 2024 18:56:08 -0800 (PST) Received: from granite.localdomain (syn-142-197-128-048.res.spectrum.com. [142.197.128.48]) by smtp.gmail.com with ESMTPSA id ada2fe7eead31-4b270293014sm1331149137.19.2024.12.17.18.56.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Dec 2024 18:56:07 -0800 (PST) From: Luis Felipe Hernandez Date: Tue, 17 Dec 2024 21:55:41 -0500 Subject: [PATCH v2] macintosh: declare ctl_table as const Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241217-constify_ctl_table-v1-1-402ebceaeb8e@gmail.com> X-B4-Tracking: v=1; b=H4sIAKw5YmcC/x3MQQqAIBBA0avErBNSgqSrRERNMzUgGipRRHdPW r7F/w8kikIJ+uqBSKckCb5A1xXgPvuNlKzFYBrTaqM7hcGnLHxPmN2U58WRslYzMqO1TQslPCK xXP90gNPA+L4fFu3yMWgAAAA= X-Change-ID: 20241217-constify_ctl_table-881fcffc8804 To: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux@weissschuh.net, rbm@suse.com Cc: Luis Felipe Hernandez X-Mailer: b4 0.15-dev-355e8 X-Developer-Signature: v=1; a=ed25519-sha256; t=1734490567; l=1564; i=luis.hernandez093@gmail.com; s=20241216; h=from:subject:message-id; bh=HMT7ymrg7muZbCh4orsKnOowhGi0scta8H0Ya7UnDs8=; b=0PNWNN2JVTvzrOmkicivMrgTvoKiGT+RPAT1Xa139wKp2C6izj+VT5jqRYDZvHSNv9HTFIoBb PgSFsQcn/6rBa1KaH6oHfBOCujPmP91pCESf2J6PpEVJPSBU1tZhdP3 X-Developer-Key: i=luis.hernandez093@gmail.com; a=ed25519; pk=E4Sj8ywxKbE+P0rYLQl7e84XZJfcVOiqNallR7p5IO4= Since commit 7abc9b53bd51 ("sysctl: allow registration of const struct ctl_table"), the sysctl registration API allows struct ctl_table variables to be placed into read-only memory. mac_hid_files is registered as a sysctl table and should be treated as read-only. By declaring the mac_hid_files structure as const, we ensure that it cannot be accidentally modified. This change improves safety. Suggested-by: Thomas Wei=C3=9Fschuh Suggested-by: Ricardo B. Marliere Reviewed-by: Ricardo B. Marliere Signed-off-by: Luis Felipe Hernandez --- Changes in v2: * Remove redundant commit reference * Fix Suggested-by tags --- drivers/macintosh/mac_hid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/macintosh/mac_hid.c b/drivers/macintosh/mac_hid.c index b461b1bed25b2df106ecf612b82efaedf69f62b0..369d72f59b3c10869bc914f31e7= dcb73e029ef7f 100644 --- a/drivers/macintosh/mac_hid.c +++ b/drivers/macintosh/mac_hid.c @@ -215,7 +215,7 @@ static int mac_hid_toggle_emumouse(const struct ctl_tab= le *table, int write, } =20 /* file(s) in /proc/sys/dev/mac_hid */ -static struct ctl_table mac_hid_files[] =3D { +static const struct ctl_table mac_hid_files[] =3D { { .procname =3D "mouse_button_emulation", .data =3D &mouse_emulate_buttons, --- base-commit: fdb298fa865b0136f7be842e6c2e6310dede421a change-id: 20241217-constify_ctl_table-881fcffc8804 Best regards, --=20 Luis Felipe Hernandez