From nobody Mon Feb 9 09:21:22 2026 Received: from smtp.smtpout.orange.fr (smtp-78.smtpout.orange.fr [80.12.242.78]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C21151FDE39 for ; Tue, 23 Dec 2025 13:16:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=80.12.242.78 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766495822; cv=none; b=c8ej41n0eOhS303+5Izj6s5RXjgZ5ddXAJnqMY4+AfUFQpUkWPtZ0E+YjDGqTGtdNvjj5yrLR5l61nkxUvObkUStAiIwOljcJpAwFSTzB0XU3ZHJ5UtEvLffk5lW4WLZI3D3KlnwAc4axDjumQZjbf3uNIXUfnHKDmO6zoXzv70= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766495822; c=relaxed/simple; bh=kVU/+6blnsjkzThTBedF5ZKxzE0HqS/4TFBxEaddouQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=jlG9nde6utUE8CUSMTw2IP/lGf04kRHgPYc6/erMGvloZMP3jFs8joRIw93uPcwKepL/QqE/n3cMVp9TaLTyVpSARk+I9BGBUtMh5Brpmg09zUoiqqfy5qAI6U2b2/EIkpSit/e22N64I81SH872pauXoXr9IEUiWf0Dgp4/Pk8= 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=LU7DAtOO; arc=none smtp.client-ip=80.12.242.78 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="LU7DAtOO" Received: from fedora.home ([IPv6:2a01:cb10:785:b00:8347:f260:7456:7662]) by smtp.orange.fr with ESMTPA id Y2EtvzLWXwYLQY2EtvKyNV; Tue, 23 Dec 2025 14:15:48 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1766495748; bh=FAm5OXDCCcakGDLeza+eId1cVx9jGuE6ABYHL7lw1xI=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=LU7DAtOOKbuGi1wNrPIZXyh5DhPfebC6stUnB6RfYDrcqmkwL6d6I3knVzkscKRQA TFR8q3hBqTbZIXTCaTLKecHKI7KSpbEc1mRtX+2n/AYFkRcWYNHZfDOxu90+6Rv/rY 94IUptBAyQ2xkDcn1PkGiwEvVx2UfcbOcALU3+bJx+oEKgyIHtC3UQdnEfTxdBPvJH 32Z1+Bc3jVsDvG8UilfTnASMQuZXuD4hB+cjp8RAoFT4fFMyjrVQNQm5o9dXWZDny6 sjUm27X6YitDY+7LPuo9LBAQy+axOz4dcFXmLtRdeVDpZTxkedkg5lSiIcpVabGrwy h5ar7oPh+jrtw== X-ME-Helo: fedora.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Tue, 23 Dec 2025 14:15:48 +0100 X-ME-IP: 2a01:cb10:785:b00:8347:f260:7456:7662 From: Christophe JAILLET To: Parthiban Veerasooran , Christian Gromm Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH] most: Constify struct configfs_item_operations and configfs_group_operations Date: Tue, 23 Dec 2025 14:15:44 +0100 Message-ID: X-Mailer: git-send-email 2.52.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: Before: =3D=3D=3D=3D=3D=3D text data bss dec hex filename 21305 12664 320 34289 85f1 drivers/most/configfs.o After: =3D=3D=3D=3D=3D text data bss dec hex filename 21785 12184 320 34289 85f1 drivers/most/configfs.o Signed-off-by: Christophe JAILLET --- Compile tested only. This change is possible since commits f2f36500a63b and f7f78098690d. --- drivers/most/configfs.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/most/configfs.c b/drivers/most/configfs.c index 36d8c917f65f..e9d7a25ced6d 100644 --- a/drivers/most/configfs.c +++ b/drivers/most/configfs.c @@ -399,7 +399,7 @@ static void mdev_link_release(struct config_item *item) kfree(to_mdev_link(item)); } =20 -static struct configfs_item_operations mdev_link_item_ops =3D { +static const struct configfs_item_operations mdev_link_item_ops =3D { .release =3D mdev_link_release, }; =20 @@ -454,7 +454,7 @@ static void most_common_release(struct config_item *ite= m) kfree(to_most_common(group->cg_subsys)); } =20 -static struct configfs_item_operations most_common_item_ops =3D { +static const struct configfs_item_operations most_common_item_ops =3D { .release =3D most_common_release, }; =20 @@ -466,7 +466,7 @@ static void most_common_disconnect(struct config_group = *group, module_put(mc->mod); } =20 -static struct configfs_group_operations most_common_group_ops =3D { +static const struct configfs_group_operations most_common_group_ops =3D { .make_item =3D most_common_make_item, .disconnect_notify =3D most_common_disconnect, }; @@ -571,11 +571,11 @@ static void most_snd_grp_release(struct config_item *= item) kfree(group); } =20 -static struct configfs_item_operations most_snd_grp_item_ops =3D { +static const struct configfs_item_operations most_snd_grp_item_ops =3D { .release =3D most_snd_grp_release, }; =20 -static struct configfs_group_operations most_snd_grp_group_ops =3D { +static const struct configfs_group_operations most_snd_grp_group_ops =3D { .make_item =3D most_snd_grp_make_item, }; =20 @@ -625,7 +625,7 @@ static void most_sound_disconnect(struct config_group *= group, module_put(ms->mod); } =20 -static struct configfs_group_operations most_sound_group_ops =3D { +static const struct configfs_group_operations most_sound_group_ops =3D { .make_group =3D most_sound_make_group, .disconnect_notify =3D most_sound_disconnect, }; --=20 2.52.0