From nobody Mon Jun 8 23:58:06 2026 Received: from smtp.smtpout.orange.fr (smtp-79.smtpout.orange.fr [80.12.242.79]) (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 A5AB53264D9 for ; Mon, 25 May 2026 12:36:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=80.12.242.79 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779712605; cv=none; b=ATlilOI3KQdq1Q/YpiBoVvhCWkNsPFA3l/RGTcl8XKI9hVsYvQM289MSdBwA1Jl2VjaEOZUrc5sXikekOO10sWKUlUKnl5ep9mnYzFgDJwECcwf2wL6JB8Ds/JAsvkpPt9RHbUxVrKA9oy/OxEcJu7U2Ri1VR7UJdCPZgiKcl1o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779712605; c=relaxed/simple; bh=TZOaeH+vP4WW5Gs9wH47yeeHPvP/6SqcD+GMNd6E5gI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=HwCWjfVpVwa7G1nvFrfGaNr0KNSAxilKt9yaokIwNsv8rZ99yQouhO5s530mg4NOUqtQ/N+IQaaugwJxx0mw8OvTlaVUwaAKV9oLKWAcFND5akZhr8BXwlZ5+LYcQERS0tnEDVb2XqMsga9QVOKnPYWToexqzhR6PgJ4BGPYKIc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wanadoo.fr; spf=pass smtp.mailfrom=wanadoo.fr; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b=WIonNY/4; arc=none smtp.client-ip=80.12.242.79 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b="WIonNY/4" Received: from fedora.home ([10.65.86.64]) by smtp.orange.fr with ESMTP id RUWnwAa6tjnMPRUWnwWTxi; Mon, 25 May 2026 14:35:29 +0200 Received: from fedora.home ([IPv6:2a01:cb10:785:b00:8347:f260:7456:7662]) by smtp.orange.fr with ESMTPSA id RUWdwkexnb370RUWdw6JPe; Mon, 25 May 2026 14:35:21 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1779712522; bh=ljvFcHVr5NanSDqM3RBqxRSwTWh7Ck4wjtjVJuilOnw=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=WIonNY/4gKDnfqCVHquYVLbYKe9nCgMH5xepGWVv/w096T2UKTolcCStk+GyLi5l0 vQbrw7FbnzLiPeZY+RJi+PpvZw49lJP89HSXBntrI7sXBeoC3Uj2LOTIDLQXkA/aM3 VKbaxv31PLQFBr9cVOie//0eO9jqEzN20lCsgt6sXNFoTez8A40Y2ozcXSrlSnGARe 4IWetzYobZFiUrKIa79A7YKWq37adtSgYBxq0HYWI829T9PwIctZ4GmBJJxZEOwmvc vZN3pGJXaX9feHVrwzs1hvFDlObXadBpryj2JXIkkrX4ovIac3q79zpJLxsjixYqPI agIenAIN/4jQQ== X-ME-Helo: fedora.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Mon, 25 May 2026 14:35:22 +0200 X-ME-IP: 2a01:cb10:785:b00:8347:f260:7456:7662 From: Christophe JAILLET To: Matthew Brost , =?UTF-8?q?Thomas=20Hellstr=C3=B6m?= , Rodrigo Vivi , David Airlie , Simona Vetter Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , intel-xe@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH] drm/xe/configfs: Constify struct configfs_item_operations and configfs_group_operations Date: Mon, 25 May 2026 14:35:15 +0200 Message-ID: X-Mailer: git-send-email 2.54.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 'struct configfs_item_operations' and 'configfs_group_operations' are not modified in this driver. Constifying these structures moves some data to a read-only section, so increases overall security, especially when the structure holds some function pointers. On a x86_64, with allmodconfig, as an example: Before: =3D=3D=3D=3D=3D=3D text data bss dec hex filename 34095 15704 128 49927 c307 drivers/gpu/drm/xe/xe_configfs.o After: =3D=3D=3D=3D=3D text data bss dec hex filename 34447 15352 128 49927 c307 drivers/gpu/drm/xe/xe_configfs.o Signed-off-by: Christophe JAILLET --- Compile tested only. --- drivers/gpu/drm/xe/xe_configfs.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/xe/xe_configfs.c b/drivers/gpu/drm/xe/xe_confi= gfs.c index 32102600a148..5c2072f18a57 100644 --- a/drivers/gpu/drm/xe/xe_configfs.c +++ b/drivers/gpu/drm/xe/xe_configfs.c @@ -838,7 +838,7 @@ static void xe_config_device_release(struct config_item= *item) kfree(dev); } =20 -static struct configfs_item_operations xe_config_device_ops =3D { +static const struct configfs_item_operations xe_config_device_ops =3D { .release =3D xe_config_device_release, }; =20 @@ -855,7 +855,7 @@ static bool xe_config_device_is_visible(struct config_i= tem *item, return true; } =20 -static struct configfs_group_operations xe_config_device_group_ops =3D { +static const struct configfs_group_operations xe_config_device_group_ops = =3D { .is_visible =3D xe_config_device_is_visible, }; =20 @@ -950,7 +950,7 @@ static bool xe_config_sriov_is_visible(struct config_it= em *item, return true; } =20 -static struct configfs_group_operations xe_config_sriov_group_ops =3D { +static const struct configfs_group_operations xe_config_sriov_group_ops = =3D { .is_visible =3D xe_config_sriov_is_visible, }; =20 @@ -1054,7 +1054,7 @@ static struct config_group *xe_config_make_device_gro= up(struct config_group *gro return &dev->group; } =20 -static struct configfs_group_operations xe_config_group_ops =3D { +static const struct configfs_group_operations xe_config_group_ops =3D { .make_group =3D xe_config_make_device_group, }; =20 --=20 2.54.0