From nobody Mon Feb 9 06:05:39 2026 Received: from smtp.smtpout.orange.fr (smtp-81.smtpout.orange.fr [80.12.242.81]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 60A3928C5D9 for ; Mon, 29 Dec 2025 11:32:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=80.12.242.81 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767007982; cv=none; b=NykV7GwNQGGdrlcBgVCkELKO2Uw/5vX5zHEbSw0mxQRyjDdd8D731Fh0qBAjdHNZQWtwIm9tKeOZM/VFqKp2TND9bjOfe7pS/L2cj5JNtR1JROUkN2rUy0ntt8SJENTAbvE/CSvPK9Wp14/ZToPxOObhUnITrvFAlrr6Gs0zlac= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767007982; c=relaxed/simple; bh=Tb71V1+Xe6Clkb/lBgJqXMWWU+Pn5d4rA79IFIVnxXU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=mSQpCu/aD83gJgO7mqtJkp1HmM/7EJESD4D9I6uwAi+CLdb4OEPRpkB8SVwINzSVOCnAsoVH3hdJrB0RTgeWNfsVQGB8MYeSBnNHFxM5/VX6RE8HGdGesh3b/CC5UzcG66sK3FwBK/QC9dQ2FuNMB2/8d0VbEdNsOnnT2y5QeLA= 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=aM9ufcXe; arc=none smtp.client-ip=80.12.242.81 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="aM9ufcXe" Received: from fedora.home ([IPv6:2a01:cb10:785:b00:8347:f260:7456:7662]) by smtp.orange.fr with ESMTPA id aBLwvRLEgibOdaBLwv8oxn; Mon, 29 Dec 2025 12:23:56 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1767007436; bh=s7qvpaZTIbNIbm8UTu0JejK4SAO6KRhiocxdfPVu3h4=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=aM9ufcXe772wavGCMhjx/YzmPgDkWnr4qtd0/mLgKi2G2NnBxfNDHV8gxWbjDgWMI ciQjJo8phJVAxxJqOp4mkNGhlHnKViBPeumQhiQvjuhnLjyyN/u+L0TNJdtvssU3Bq OqQJMznJPUGht2i9PKB9s9jbSMW+KHtuYmYr28dE+LLyj0x7PBV5NApO8W8vf4RbGP /TFRz4P+EXA/REsNrNgQLsmG4cDUmp8/31dXQSeA4a2MByDZ7pzNQ5dXvHY/9RjcA8 hpASiugj+5fh2JY+roCuR/AdH8iWHEmUL/SifJcE4R4KmyIfDHHSS/GB/JPMLjVJvT 5w9g5uaFg8G4Q== X-ME-Helo: fedora.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Mon, 29 Dec 2025 12:23:56 +0100 X-ME-IP: 2a01:cb10:785:b00:8347:f260:7456:7662 From: Christophe JAILLET To: Andreas Hindborg , Breno Leitao Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH] samples: configfs: Constify struct configfs_item_operations and configfs_group_operations Date: Mon, 29 Dec 2025 12:23:51 +0100 Message-ID: <70c5fd68fcc4d3ba1f18002012fae19acf4ce50b.1767007414.git.christophe.jaillet@wanadoo.fr> 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 7507 6504 64 14075 36fb samples/configfs/configfs_sample.o After: =3D=3D=3D=3D=3D text data bss dec hex filename 7827 6184 64 14075 36fb samples/configfs/configfs_sample.o Signed-off-by: Christophe JAILLET --- Compile tested only. This change is possible since commits f2f36500a63b and f7f78098690d. --- samples/configfs/configfs_sample.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/samples/configfs/configfs_sample.c b/samples/configfs/configfs= _sample.c index fd5d163828c5..c1b108ec4ea0 100644 --- a/samples/configfs/configfs_sample.c +++ b/samples/configfs/configfs_sample.c @@ -158,7 +158,7 @@ static void simple_child_release(struct config_item *it= em) kfree(to_simple_child(item)); } =20 -static struct configfs_item_operations simple_child_item_ops =3D { +static const struct configfs_item_operations simple_child_item_ops =3D { .release =3D simple_child_release, }; =20 @@ -215,7 +215,7 @@ static void simple_children_release(struct config_item = *item) kfree(to_simple_children(item)); } =20 -static struct configfs_item_operations simple_children_item_ops =3D { +static const struct configfs_item_operations simple_children_item_ops =3D { .release =3D simple_children_release, }; =20 @@ -223,7 +223,7 @@ static struct configfs_item_operations simple_children_= item_ops =3D { * Note that, since no extra work is required on ->drop_item(), * no ->drop_item() is provided. */ -static struct configfs_group_operations simple_children_group_ops =3D { +static const struct configfs_group_operations simple_children_group_ops = =3D { .make_item =3D simple_children_make_item, }; =20 @@ -292,7 +292,7 @@ static struct configfs_attribute *group_children_attrs[= ] =3D { * Note that, since no extra work is required on ->drop_item(), * no ->drop_item() is provided. */ -static struct configfs_group_operations group_children_group_ops =3D { +static const struct configfs_group_operations group_children_group_ops =3D= { .make_group =3D group_children_make_group, }; =20 --=20 2.52.0