From nobody Fri Apr 17 09:02:49 2026 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) (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 B7BDC305E10; Mon, 23 Feb 2026 21:17:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.69.126.157 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771881429; cv=none; b=g71vYFteuYHDYSsH7NEkRHc2O3lPUgsdl95824gMAVD5OEFeO2hpWvtI9lGPrZYYPhKYGOTm3ptq7L6XMvFIWWXen8BpA+rGFAWbXwGeRYczG21U/3rI+b8w8EbhL6wQP7neG4WS04Ewkh2hUcsJ2WlAp7kGdYKGuSo1GX4WWCQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771881429; c=relaxed/simple; bh=d66Pu061jZ1MLr2Gb+zXKHBMduZKmte9jKmRSaqae1U=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Og7TfcopM0IdarGHn7/q7p2az+tp+GSvex3kCQ9M8CW2cc3HsWA+z1Ke3d7e8o8hD0mqywur8p7SDiD3neIIzTERBEKUCFr+H13EH0kjjUk8CjW2d80qL7yklJlULQ6DNAHJX9axeBW546E2Szpg0HxFV2tHokmw/VVV3++0seo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net; spf=pass smtp.mailfrom=weissschuh.net; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b=dlzgQp3R; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="dlzgQp3R" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1771881425; bh=d66Pu061jZ1MLr2Gb+zXKHBMduZKmte9jKmRSaqae1U=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=dlzgQp3RtOAzp6RgVW4rW+arEuoiwcg3vVnOncE3GJGmZqNU13yDkCK+sVfHOimD2 7izHzhokWWHAhkQoSb2rHHOL8cIL091cEyx/QdLJLHRg2Pw3qpKBgzGsk4Tm+ctrQr DovN+1z5KCNXsJTyK4AzBf4KnvoPSvPdJIfPAHYw= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Mon, 23 Feb 2026 22:16:28 +0100 Subject: [PATCH 1/7] EDAC/altera: Drop unused field eccmgr_sysfs_attr 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: <20260223-sysfs-const-edac-v1-1-3ff0b87249e7@weissschuh.net> References: <20260223-sysfs-const-edac-v1-0-3ff0b87249e7@weissschuh.net> In-Reply-To: <20260223-sysfs-const-edac-v1-0-3ff0b87249e7@weissschuh.net> To: Dinh Nguyen , Borislav Petkov , Tony Luck , Johannes Thumshirn Cc: linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1771881425; l=605; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=d66Pu061jZ1MLr2Gb+zXKHBMduZKmte9jKmRSaqae1U=; b=DBZ7U1VFetZcQzGtky0xiQ1oDPrfLW0BI6HF4VZxLZ4Z+DkMZgYYdyeFArTn+/g4m3jFT1hFw YolaKdr1LCvATXiRrnkc7BVFLVdhR/audua7bCUMt9rDpAsRY0EW4do X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= This field is unused, drop it. Signed-off-by: Thomas Wei=C3=9Fschuh --- drivers/edac/altera_edac.h | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/edac/altera_edac.h b/drivers/edac/altera_edac.h index 7248d24c4908..f3e84172caa9 100644 --- a/drivers/edac/altera_edac.h +++ b/drivers/edac/altera_edac.h @@ -172,7 +172,6 @@ struct altr_sdram_prv_data { int ecc_irq_clr_mask; int ecc_cnt_rst_offset; int ecc_cnt_rst_mask; - struct edac_dev_sysfs_attribute *eccmgr_sysfs_attr; int ecc_enable_mask; int ce_set_mask; int ue_set_mask; --=20 2.53.0 From nobody Fri Apr 17 09:02:49 2026 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) (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 559F7374759; Mon, 23 Feb 2026 21:17:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.69.126.157 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771881429; cv=none; b=akIM/k3T9bBqAZQdxnKZv9zq1vYgre7xiPDWysOS51FwVd43OJWQyul2bv5FnsWx5G1/J9/AuFonUJEU8QReOXF4dNdzNHBlyz2885ePDBLlYvvwLWwRCA2Mlx5RbiTQfPCBbNMUXqfXIEI0YHhoQEGAjLRO0LStBUGuaWkDEp8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771881429; c=relaxed/simple; bh=OEWT5X2pzgtUky8GC9nV5gnBPw01d2i1GIn3qrr2SI8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=tV7tYRcLXDiJ3hsBl3dEoiibiSN53uTEl5Kr1GQyadGT1bXetw+19siFw81NNYY30cRGEMBho9GpVZCnZFeFpHS1/z+Rbpk+brmVSUhoe8B1lgGXSc7hw7vQA2+Ktc2MOzybdIxIQIEN4XJadc++UrKFvZlzKhPceAA/TIPmaBA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net; spf=pass smtp.mailfrom=weissschuh.net; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b=Tu7VHWlV; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="Tu7VHWlV" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1771881425; bh=OEWT5X2pzgtUky8GC9nV5gnBPw01d2i1GIn3qrr2SI8=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Tu7VHWlVSQ2Ch9aozvGK6W5VUBMXr+pyO38mv1WtKMOaA+I1SweJZxzBu5EKTE/q8 sHEci5IRLMF24ZuGHZA9SvydmoYZGbtlLkmHEimsGvenCiccr9OFpeal+qN6ko7SZ0 kWMKF1RtfKnEbnezqJYMqFOQPIOs8mHK/+zD/rY4= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Mon, 23 Feb 2026 22:16:29 +0100 Subject: [PATCH 2/7] EDAC/device: Drop unused macro to_edacdev_attr() 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: <20260223-sysfs-const-edac-v1-2-3ff0b87249e7@weissschuh.net> References: <20260223-sysfs-const-edac-v1-0-3ff0b87249e7@weissschuh.net> In-Reply-To: <20260223-sysfs-const-edac-v1-0-3ff0b87249e7@weissschuh.net> To: Dinh Nguyen , Borislav Petkov , Tony Luck , Johannes Thumshirn Cc: linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1771881425; l=679; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=OEWT5X2pzgtUky8GC9nV5gnBPw01d2i1GIn3qrr2SI8=; b=EAgSpXb4W4LmuXY4gUl+gWcmw7Ne7FrN8LbNymWW0TVndGDbXCwMNCMf0ju3PLsRkatUKV2Gm pMD2LMcNKvDAf2uzqVvWXlAbQlWR9ds8dMcRJm2umE8wJqf/LGXIlwP X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= This macro is unused, drop it. Signed-off-by: Thomas Wei=C3=9Fschuh --- drivers/edac/edac_device_sysfs.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/edac/edac_device_sysfs.c b/drivers/edac/edac_device_sy= sfs.c index fcebc4ffea26..9cc466b78982 100644 --- a/drivers/edac/edac_device_sysfs.c +++ b/drivers/edac/edac_device_sysfs.c @@ -21,8 +21,6 @@ #define EDAC_DEVICE_SYMLINK "device" =20 #define to_edacdev(k) container_of(k, struct edac_device_ctl_info, kobj) -#define to_edacdev_attr(a) container_of(a, struct edacdev_attribute, attr) - =20 /* * Set of edac_device_ctl_info attribute store/show functions --=20 2.53.0 From nobody Fri Apr 17 09:02:49 2026 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) (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 F00BA37419D; Mon, 23 Feb 2026 21:17:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.69.126.157 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771881429; cv=none; b=bs12NsrtoYXSxVl0PKWkaw/ASpN+5m1coc4PisF0zf0kQnQEcRrfvXq2sHYwe2yt4QBxrEYaz0+NNPMp7rhADVFHmUWvT5GTzf03DSyW9jnt51uRZ/wyD4jNDUL5ZvzKwmWHXWU+gwvhph2akAxTTrkKIwwQvk2J7AyppmENQBA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771881429; c=relaxed/simple; bh=6Z4Ymyzpd1Csbn4UtXS2PHnqH5lIkviU9wgVJQedY/U=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=J6YLDWKKUoYpSZzf68xyfcgfEfbLJGCmRBZ8iIx/6XMq5Gh03o5STYYQJDDov+9uLgpFewatAul2eLZUxFw+XSq5d4xiHyYnt+X4Iej/EKE89CBtyvXmfjswzTDX+B5twv6r/Ls924wh5LH1sKc6+mDCpj98cTWOVKDlp45iMmE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net; spf=pass smtp.mailfrom=weissschuh.net; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b=t4hqbQNK; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="t4hqbQNK" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1771881425; bh=6Z4Ymyzpd1Csbn4UtXS2PHnqH5lIkviU9wgVJQedY/U=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=t4hqbQNKwrnOO44BV9XNiTr6fEKgChtf8xt9T0mzdkCw4TDyHIU5aFpWOGtRvRRFw oIMeVjEDUwEYhJW9mleMYz9cFBryH/tsaaE7N3qf4u9uFNx8Tq0UcstSxF4Tzc+T3J ZISG1/OGuHrBK3YuqZgt3oujr2upLl/oAo4ovKOc= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Mon, 23 Feb 2026 22:16:30 +0100 Subject: [PATCH 3/7] EDAC/device: Drop unnecessary and dangerous tasks of attributes 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: <20260223-sysfs-const-edac-v1-3-3ff0b87249e7@weissschuh.net> References: <20260223-sysfs-const-edac-v1-0-3ff0b87249e7@weissschuh.net> In-Reply-To: <20260223-sysfs-const-edac-v1-0-3ff0b87249e7@weissschuh.net> To: Dinh Nguyen , Borislav Petkov , Tony Luck , Johannes Thumshirn Cc: linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1771881425; l=1667; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=6Z4Ymyzpd1Csbn4UtXS2PHnqH5lIkviU9wgVJQedY/U=; b=zAJqRG0cfET4+zsIrGgD/pqQe/inhse26caVaBbzV0UH3NNB0F55DEiFFRnTmN4f1JDeFNArB 0bserL2LDF4Bs8YCOqK9H+JMiU1NhMAZlzBO1o/eIMMPoxb+yG8xozz X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= These casts assume that the 'struct attribute' is at the beginning of 'struct edac_dev_sysfs_block_attribute'. This is can silently break if the field is moved, either manually or through struct randomization. Use proper member syntax to get the field address and drop the casts. Signed-off-by: Thomas Wei=C3=9Fschuh --- drivers/edac/edac_device_sysfs.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/edac/edac_device_sysfs.c b/drivers/edac/edac_device_sy= sfs.c index 9cc466b78982..1e79f36a91fa 100644 --- a/drivers/edac/edac_device_sysfs.c +++ b/drivers/edac/edac_device_sysfs.c @@ -573,8 +573,7 @@ static void edac_device_delete_block(struct edac_device= _ctl_info *edac_dev, for (i =3D 0; i < block->nr_attribs; i++, sysfs_attrib++) { =20 /* remove each block_attrib file */ - sysfs_remove_file(&block->kobj, - (struct attribute *) sysfs_attrib); + sysfs_remove_file(&block->kobj, &sysfs_attrib->attr); } } =20 @@ -734,7 +733,7 @@ static int edac_device_add_main_sysfs_attributes( */ while (sysfs_attrib->attr.name !=3D NULL) { err =3D sysfs_create_file(&edac_dev->kobj, - (struct attribute*) sysfs_attrib); + &sysfs_attrib->attr); if (err) goto err_out; =20 @@ -762,8 +761,7 @@ static void edac_device_remove_main_sysfs_attributes( sysfs_attrib =3D edac_dev->sysfs_attributes; if (sysfs_attrib) { while (sysfs_attrib->attr.name !=3D NULL) { - sysfs_remove_file(&edac_dev->kobj, - (struct attribute *) sysfs_attrib); + sysfs_remove_file(&edac_dev->kobj, &sysfs_attrib->attr); sysfs_attrib++; } } --=20 2.53.0 From nobody Fri Apr 17 09:02:49 2026 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) (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 B64B43793B6; Mon, 23 Feb 2026 21:17:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.69.126.157 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771881432; cv=none; b=jZPpXpjMtGvX9+XxcgW5pCXO7uiFlAbWy2P95IBXnFmD4OaQI6NTnsS5eAO2hrD+0fnTOnrWeqarCvwuJDx0qVHyn8Eu5vvNtIFFDX1JwOL0v7JW/QFAaZqMRhJTQnEgvgdxJIO65IO5Ax0PgD4eVA5lKt42ng0dFoNBvcZcIcg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771881432; c=relaxed/simple; bh=a+yIMqJ7dUxkiRYKVugG14fCgSuZdNdFzRaiCa3EvvM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=OlFZK/eVGjcB4siGX6jSYreQuIUIUPVjJu1QV171A8YMK/qVJs5PdR/zCvtq4XI89WDy8APA6EP++E7BHx32gE+PYXD8yqfqHHigAKPokZVyIYjDa1YRfPW5Vof0JChKowTaSnfow9cT3s18Ok2JeThY6MomhujJk7TOqUPOVXE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net; spf=pass smtp.mailfrom=weissschuh.net; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b=RRVi7lqq; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="RRVi7lqq" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1771881425; bh=a+yIMqJ7dUxkiRYKVugG14fCgSuZdNdFzRaiCa3EvvM=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=RRVi7lqq8sB4FqUPTu92IJlH+jb2QmOEsl/Hr1K3fOWqhZhGxbShmYLLUZy2d9tiI uaeHyeoCK5qSAvS2wcantPFDI5JPCi0nf+cWYElUJIK/AkAFOkBRJ+0RbWfAVvV34d I9OhWPmvW3uIe/nrWx7DtZF/bI4xnh4vKuBkFSGU= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Mon, 23 Feb 2026 22:16:31 +0100 Subject: [PATCH 4/7] EDAC/device: Constify info sysfs attributes 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: <20260223-sysfs-const-edac-v1-4-3ff0b87249e7@weissschuh.net> References: <20260223-sysfs-const-edac-v1-0-3ff0b87249e7@weissschuh.net> In-Reply-To: <20260223-sysfs-const-edac-v1-0-3ff0b87249e7@weissschuh.net> To: Dinh Nguyen , Borislav Petkov , Tony Luck , Johannes Thumshirn Cc: linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1771881425; l=2510; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=a+yIMqJ7dUxkiRYKVugG14fCgSuZdNdFzRaiCa3EvvM=; b=viQonSwMb3B5u2rAP0Y3UAPDGfuw6FPK+XkzQwaZzGTU1HYc6Q7OWK2NeCtw9Ofv4FNCBGubx 9vEfncFIdFRAPRvRrGqZnkhk2D6UiITQ0Ve7s6gQLvyg9iicFGw3gw1 X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= These structures are never modified, mark them read-only. Signed-off-by: Thomas Wei=C3=9Fschuh --- drivers/edac/edac_device_sysfs.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/edac/edac_device_sysfs.c b/drivers/edac/edac_device_sy= sfs.c index 1e79f36a91fa..754d44827942 100644 --- a/drivers/edac/edac_device_sysfs.c +++ b/drivers/edac/edac_device_sysfs.c @@ -109,14 +109,14 @@ struct ctl_info_attribute { }; =20 #define to_ctl_info(k) container_of(k, struct edac_device_ctl_info, kobj) -#define to_ctl_info_attr(a) container_of(a,struct ctl_info_attribute,attr) +#define to_ctl_info_attr(a) container_of_const(a, struct ctl_info_attribut= e, attr) =20 /* Function to 'show' fields from the edac_dev 'ctl_info' structure */ static ssize_t edac_dev_ctl_info_show(struct kobject *kobj, struct attribute *attr, char *buffer) { struct edac_device_ctl_info *edac_dev =3D to_ctl_info(kobj); - struct ctl_info_attribute *ctl_info_attr =3D to_ctl_info_attr(attr); + const struct ctl_info_attribute *ctl_info_attr =3D to_ctl_info_attr(attr); =20 if (ctl_info_attr->show) return ctl_info_attr->show(edac_dev, buffer); @@ -129,7 +129,7 @@ static ssize_t edac_dev_ctl_info_store(struct kobject *= kobj, const char *buffer, size_t count) { struct edac_device_ctl_info *edac_dev =3D to_ctl_info(kobj); - struct ctl_info_attribute *ctl_info_attr =3D to_ctl_info_attr(attr); + const struct ctl_info_attribute *ctl_info_attr =3D to_ctl_info_attr(attr); =20 if (ctl_info_attr->store) return ctl_info_attr->store(edac_dev, buffer, count); @@ -143,7 +143,7 @@ static const struct sysfs_ops device_ctl_info_ops =3D { }; =20 #define CTL_INFO_ATTR(_name,_mode,_show,_store) \ -static struct ctl_info_attribute attr_ctl_info_##_name =3D { \ +static const struct ctl_info_attribute attr_ctl_info_##_name =3D { \ .attr =3D {.name =3D __stringify(_name), .mode =3D _mode }, \ .show =3D _show, \ .store =3D _store, \ @@ -161,7 +161,7 @@ CTL_INFO_ATTR(poll_msec, S_IRUGO | S_IWUSR, edac_device_ctl_poll_msec_show, edac_device_ctl_poll_msec_store); =20 /* Base Attributes of the EDAC_DEVICE ECC object */ -static struct attribute *device_ctrl_attrs[] =3D { +static const struct attribute *const device_ctrl_attrs[] =3D { &attr_ctl_info_panic_on_ue.attr, &attr_ctl_info_log_ue.attr, &attr_ctl_info_log_ce.attr, --=20 2.53.0 From nobody Fri Apr 17 09:02:49 2026 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) (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 97D8A377576; Mon, 23 Feb 2026 21:17:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.69.126.157 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771881429; cv=none; b=FsRvg5o8fFm4J1EpUGu6XRWbeFXdGTCax+C7bavdV/VhfnYTXd9ZTlIzd+Ys5g9N4SjKWiMB1NvkzB0JoOs0fjg1km3dl7w0uyauoEfMXeOI8hBG0McNHnOr4sIAxpKxowmyUfm6g19cL4Fffn5P7TrCtUaqFKsBFSQqrCQzzYE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771881429; c=relaxed/simple; bh=yr4qx6td7d1BPQGTgBRZZYWFHwmZENKtcBXJTDjjkMk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=gFrlapedk7h3X3Zdihx0M9u2bqosvykFmKQFISm8l+UPHuXQqRP1usOoPI5ZLgsqdDAXk8uNkLk/LavubF8y+H8E5XOWtUtxReVNw2txsGhVGaidYlmZmbZaTcF0s+U3IUNe2mNywHvyfSi98urOqXERDhrfpxYWJszOi99j+7I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net; spf=pass smtp.mailfrom=weissschuh.net; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b=DRCQ1x3T; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="DRCQ1x3T" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1771881426; bh=yr4qx6td7d1BPQGTgBRZZYWFHwmZENKtcBXJTDjjkMk=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=DRCQ1x3TflgLNTT4Xmgc+EtJGcROSGzMfsbzmgbOqA2DRZsNLE1unyuX78+Uoc5SE JsP3GpxuNrXc3tj0HqVzrs/MLfkUJ0smi5gyKfB6BNOfoR5ZHf1hLp15y3MrCLqds5 WzqkzSR6KcgNk/qRv0BiAtV5y7/7RbUxtt0IicVo= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Mon, 23 Feb 2026 22:16:32 +0100 Subject: [PATCH 5/7] EDAC/pci_sysfs: Constify instance sysfs attributes 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: <20260223-sysfs-const-edac-v1-5-3ff0b87249e7@weissschuh.net> References: <20260223-sysfs-const-edac-v1-0-3ff0b87249e7@weissschuh.net> In-Reply-To: <20260223-sysfs-const-edac-v1-0-3ff0b87249e7@weissschuh.net> To: Dinh Nguyen , Borislav Petkov , Tony Luck , Johannes Thumshirn Cc: linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1771881425; l=2447; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=yr4qx6td7d1BPQGTgBRZZYWFHwmZENKtcBXJTDjjkMk=; b=KBpyO/8Iz8Q1+FIKuKHdJ7IeJjsT6bL/zu7H1XazunZN1vOx6B9tczC1p3+yMdXIZSSmfRVl/ o+z/BeiYaaoDs8NQy4asJEEQbkCUgiNwDaic6GiEiR4akNwhhGgKcwo X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= These structures are never modified, mark them read-only. Signed-off-by: Thomas Wei=C3=9Fschuh --- drivers/edac/edac_pci_sysfs.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/edac/edac_pci_sysfs.c b/drivers/edac/edac_pci_sysfs.c index 446fef0a9399..9f437f648e4e 100644 --- a/drivers/edac/edac_pci_sysfs.c +++ b/drivers/edac/edac_pci_sysfs.c @@ -68,7 +68,7 @@ static ssize_t instance_npe_count_show(struct edac_pci_ct= l_info *pci, } =20 #define to_instance(k) container_of(k, struct edac_pci_ctl_info, kobj) -#define to_instance_attr(a) container_of(a, struct instance_attribute, att= r) +#define to_instance_attr(a) container_of_const(a, struct instance_attribut= e, attr) =20 /* DEVICE instance kobject release() function */ static void edac_pci_instance_release(struct kobject *kobj) @@ -98,7 +98,7 @@ static ssize_t edac_pci_instance_show(struct kobject *kob= j, struct attribute *attr, char *buffer) { struct edac_pci_ctl_info *pci =3D to_instance(kobj); - struct instance_attribute *instance_attr =3D to_instance_attr(attr); + const struct instance_attribute *instance_attr =3D to_instance_attr(attr); =20 if (instance_attr->show) return instance_attr->show(pci, buffer); @@ -111,7 +111,7 @@ static ssize_t edac_pci_instance_store(struct kobject *= kobj, const char *buffer, size_t count) { struct edac_pci_ctl_info *pci =3D to_instance(kobj); - struct instance_attribute *instance_attr =3D to_instance_attr(attr); + const struct instance_attribute *instance_attr =3D to_instance_attr(attr); =20 if (instance_attr->store) return instance_attr->store(pci, buffer, count); @@ -125,7 +125,7 @@ static const struct sysfs_ops pci_instance_ops =3D { }; =20 #define INSTANCE_ATTR(_name, _mode, _show, _store) \ -static struct instance_attribute attr_instance_##_name =3D { \ +static const struct instance_attribute attr_instance_##_name =3D { \ .attr =3D {.name =3D __stringify(_name), .mode =3D _mode }, \ .show =3D _show, \ .store =3D _store, \ @@ -135,7 +135,7 @@ INSTANCE_ATTR(pe_count, S_IRUGO, instance_pe_count_show= , NULL); INSTANCE_ATTR(npe_count, S_IRUGO, instance_npe_count_show, NULL); =20 /* pci instance attributes */ -static struct attribute *pci_instance_attrs[] =3D { +static const struct attribute *const pci_instance_attrs[] =3D { &attr_instance_pe_count.attr, &attr_instance_npe_count.attr, NULL --=20 2.53.0 From nobody Fri Apr 17 09:02:49 2026 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) (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 AF7C33793B0; Mon, 23 Feb 2026 21:17:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.69.126.157 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771881432; cv=none; b=NeItcPhsqVAyFYJwg+AZHLe/y69+/4zooh7dXL7UoZCtrKWPMNwL0D709esW7B02oHPShfxouhF/nHdZD0jR9/H1i4zUci/eJ8E57o0utvUhzRZDGV7tgbHngGw6xVykVmA33Jbc5E0ZRcL4B9PeSCOYI51SDO5Fq9AthabiAq4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771881432; c=relaxed/simple; bh=wX5oiGqLv37w2xOfmI9Zm5xOoRjsTLXZ19/2Ce2Okjo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=dvHwfsA41LTcvqD0XgMkYJpqvt/5wPwjj42r5WZucQeONtAxIs+U4BLBQfJqJzEnAauaGHGN2KGTmovZEywZusk8iDRsFIOMNJs1GvvWbKjXLsuKyMN3CpJYFmENLKwEtMKqznbnCDpQIDzzCiLWn5uOhprB4KSLiepaNR63xgU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net; spf=pass smtp.mailfrom=weissschuh.net; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b=eNACA1w5; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="eNACA1w5" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1771881426; bh=wX5oiGqLv37w2xOfmI9Zm5xOoRjsTLXZ19/2Ce2Okjo=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=eNACA1w5lCg0tqwlZhXGvg3dBEV9K/kGl1b3lWgleLutmKqj506FkP7JjRZQHWS8A HDTvoyQlXVvLPzU+XlIOX/NU0ScNN+BWoM/4egJjHRPLdIm5z+0WiVZ/dBsRFlaHUU qQVY2oV8ScnjwfpLbKB4A5ywVqCTnlQV2hZYES9U= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Mon, 23 Feb 2026 22:16:33 +0100 Subject: [PATCH 6/7] EDAC/device: All addition of sysfs attributes 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: <20260223-sysfs-const-edac-v1-6-3ff0b87249e7@weissschuh.net> References: <20260223-sysfs-const-edac-v1-0-3ff0b87249e7@weissschuh.net> In-Reply-To: <20260223-sysfs-const-edac-v1-0-3ff0b87249e7@weissschuh.net> To: Dinh Nguyen , Borislav Petkov , Tony Luck , Johannes Thumshirn Cc: linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1771881425; l=1863; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=wX5oiGqLv37w2xOfmI9Zm5xOoRjsTLXZ19/2Ce2Okjo=; b=zhpkBYjByzu1sjWxKgQw1kjmdrkh1O1Gl86tlyBh0RcEl/xfue4oVGxuV9vF277P/odgpuRZb XlB8e+tIcxiBZVKYSQYMxJuG9aveLFKTm9qBSAzVMO3/2Gn1XqNb762 X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= The generic EDAC sysfs code does not need to modify these structs. Allow the drivers to add read-only ones. Signed-off-by: Thomas Wei=C3=9Fschuh --- drivers/edac/edac_device.h | 2 +- drivers/edac/edac_device_sysfs.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/edac/edac_device.h b/drivers/edac/edac_device.h index 034711d71ebf..24c1921aa490 100644 --- a/drivers/edac/edac_device.h +++ b/drivers/edac/edac_device.h @@ -163,7 +163,7 @@ struct edac_device_ctl_info { * If attributes are desired, then set to array of attributes * If no attributes are desired, leave NULL */ - struct edac_dev_sysfs_attribute *sysfs_attributes; + const struct edac_dev_sysfs_attribute *sysfs_attributes; =20 /* pointer to main 'edac' subsys in sysfs */ const struct bus_type *edac_subsys; diff --git a/drivers/edac/edac_device_sysfs.c b/drivers/edac/edac_device_sy= sfs.c index 754d44827942..b1c2717cd023 100644 --- a/drivers/edac/edac_device_sysfs.c +++ b/drivers/edac/edac_device_sysfs.c @@ -723,7 +723,7 @@ static void edac_device_delete_instances(struct edac_de= vice_ctl_info *edac_dev) static int edac_device_add_main_sysfs_attributes( struct edac_device_ctl_info *edac_dev) { - struct edac_dev_sysfs_attribute *sysfs_attrib; + const struct edac_dev_sysfs_attribute *sysfs_attrib; int err =3D 0; =20 sysfs_attrib =3D edac_dev->sysfs_attributes; @@ -752,7 +752,7 @@ static int edac_device_add_main_sysfs_attributes( static void edac_device_remove_main_sysfs_attributes( struct edac_device_ctl_info *edac_dev) { - struct edac_dev_sysfs_attribute *sysfs_attrib; + const struct edac_dev_sysfs_attribute *sysfs_attrib; =20 /* if there are main attributes, defined, remove them. First, * point to the start of the array and iterate over it --=20 2.53.0 From nobody Fri Apr 17 09:02:49 2026 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) (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 AF72E3793AA; Mon, 23 Feb 2026 21:17:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.69.126.157 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771881432; cv=none; b=SZbbyDIwSC31enBXOcD0R+Acmvz1phCwibDVvwWM7vp0hy/gCw7W81p1OllBv91fagLZ9SSYLHTxYGt3KQe2fkJtOc/hnPEs5HWUqUzK4Mt8vn73nyo5fugZ/Aq0CmhUmU8Cj1M7OyZUuAlboGxI6Cv8GOSas4AdUQoGYAprk7g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771881432; c=relaxed/simple; bh=lGzYjD0ui7QuV8qqwy9PRnEooyHvUrDsTD6oAyW6U90=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=AlN1YORvBLWCMsjYUo/oOepHvDUwaYAiWohZgosyNh4zIDkK/y9KSq34J7YtXpKq5bln/sv4nHO67rh+MZMHBosfCAEmK+U4O0MPgJEqW+Zlzcf5lkC+1Ukm86xCw5ghUS+i26FIFLG1IIXU4NCXeRHp7FVH5OIrrRH9VbNkP3U= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net; spf=pass smtp.mailfrom=weissschuh.net; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b=azpk/Na7; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="azpk/Na7" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1771881426; bh=lGzYjD0ui7QuV8qqwy9PRnEooyHvUrDsTD6oAyW6U90=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=azpk/Na7uKDLpuAcaT/7w2dwiX2r4Oaof58Rr9lUo7f2aiiZvBe2bWv1hEPs19uLr r8aHf1eyK3jtRm2SvLqAk46RYR4TnjEcnWzlCMoHusHYhMgB+cYjL+kKLhe5wIO97S HbSIuHNtR1d+mQ0fJ4qPaPgqlZeCiRKKvSg1uukE= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Mon, 23 Feb 2026 22:16:34 +0100 Subject: [PATCH 7/7] EDAC/mpc85xx: Constify device sysfs attributes 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: <20260223-sysfs-const-edac-v1-7-3ff0b87249e7@weissschuh.net> References: <20260223-sysfs-const-edac-v1-0-3ff0b87249e7@weissschuh.net> In-Reply-To: <20260223-sysfs-const-edac-v1-0-3ff0b87249e7@weissschuh.net> To: Dinh Nguyen , Borislav Petkov , Tony Luck , Johannes Thumshirn Cc: linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1771881425; l=783; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=lGzYjD0ui7QuV8qqwy9PRnEooyHvUrDsTD6oAyW6U90=; b=s2T0Lnmrc13QHpczKa05M45URkx7jHf6laLpgSDL8BWyf7FHu+s7PZK7mhvb9LNnPjoJFHXyZ d8EEC7SbUOQDSZyHfn/n+IJW47mRIytr71wJg1Ah/64Oj4HFs4XVhqd X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= Now that the EDAC core allows the registration of read-only attributes, make use of that in the mpc85xx driver. Signed-off-by: Thomas Wei=C3=9Fschuh --- drivers/edac/mpc85xx_edac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/edac/mpc85xx_edac.c b/drivers/edac/mpc85xx_edac.c index a45dc6b35ede..277f1c6bd522 100644 --- a/drivers/edac/mpc85xx_edac.c +++ b/drivers/edac/mpc85xx_edac.c @@ -399,7 +399,7 @@ static ssize_t mpc85xx_l2_inject_ctrl_store(struct edac= _device_ctl_info return 0; } =20 -static struct edac_dev_sysfs_attribute mpc85xx_l2_sysfs_attributes[] =3D { +static const struct edac_dev_sysfs_attribute mpc85xx_l2_sysfs_attributes[]= =3D { { .attr =3D { .name =3D "inject_data_hi", --=20 2.53.0