From: Bjorn Helgaas <helgaas@kernel.org>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: "Manivannan Sadhasivam" <mani@kernel.org>,
"Krzysztof Wilczyński" <kwilczynski@kernel.org>,
"Kishon Vijay Abraham I" <kishon@kernel.org>,
"Bjorn Helgaas" <bhelgaas@google.com>,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org,
linux-pci@vger.kernel.org
Subject: Re: [PATCH] scsi: target: Constify struct configfs_item_operations and configfs_group_operations
Date: Tue, 23 Dec 2025 10:22:22 -0600 [thread overview]
Message-ID: <20251223162222.GA4022020@bhelgaas> (raw)
In-Reply-To: <f1f05f6c1bc0c6f37cd680f012fe08c525364968.1765705512.git.christophe.jaillet@wanadoo.fr>
On Sun, Dec 14, 2025 at 10:45:29AM +0100, Christophe JAILLET wrote:
> '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.
Sounds plausible, except that there's no apparent connection with scsi
(as suggested by the subject). Will wait for a revision that matches
history of this file.
> On a x86_64, with allmodconfig:
> Before:
> ======
> text data bss dec hex filename
> 27503 12184 256 39943 9c07 drivers/pci/endpoint/pci-ep-cfs.o
>
> After:
> =====
> text data bss dec hex filename
> 27855 11832 256 39943 9c07 drivers/pci/endpoint/pci-ep-cfs.o
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> Compile tested only.
>
> This change is possible since commits f2f36500a63b and f7f78098690d.
> ---
> drivers/pci/endpoint/pci-ep-cfs.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/pci/endpoint/pci-ep-cfs.c b/drivers/pci/endpoint/pci-ep-cfs.c
> index ef50c82e647f..034a31c341c9 100644
> --- a/drivers/pci/endpoint/pci-ep-cfs.c
> +++ b/drivers/pci/endpoint/pci-ep-cfs.c
> @@ -85,7 +85,7 @@ static void pci_secondary_epc_epf_unlink(struct config_item *epc_item,
> pci_epc_remove_epf(epc, epf, SECONDARY_INTERFACE);
> }
>
> -static struct configfs_item_operations pci_secondary_epc_item_ops = {
> +static const struct configfs_item_operations pci_secondary_epc_item_ops = {
> .allow_link = pci_secondary_epc_epf_link,
> .drop_link = pci_secondary_epc_epf_unlink,
> };
> @@ -149,7 +149,7 @@ static void pci_primary_epc_epf_unlink(struct config_item *epc_item,
> pci_epc_remove_epf(epc, epf, PRIMARY_INTERFACE);
> }
>
> -static struct configfs_item_operations pci_primary_epc_item_ops = {
> +static const struct configfs_item_operations pci_primary_epc_item_ops = {
> .allow_link = pci_primary_epc_epf_link,
> .drop_link = pci_primary_epc_epf_unlink,
> };
> @@ -257,7 +257,7 @@ static void pci_epc_epf_unlink(struct config_item *epc_item,
> pci_epc_remove_epf(epc, epf, PRIMARY_INTERFACE);
> }
>
> -static struct configfs_item_operations pci_epc_item_ops = {
> +static const struct configfs_item_operations pci_epc_item_ops = {
> .allow_link = pci_epc_epf_link,
> .drop_link = pci_epc_epf_unlink,
> };
> @@ -508,7 +508,7 @@ static void pci_epf_release(struct config_item *item)
> kfree(epf_group);
> }
>
> -static struct configfs_item_operations pci_epf_ops = {
> +static const struct configfs_item_operations pci_epf_ops = {
> .allow_link = pci_epf_vepf_link,
> .drop_link = pci_epf_vepf_unlink,
> .release = pci_epf_release,
> @@ -662,7 +662,7 @@ static void pci_epf_drop(struct config_group *group, struct config_item *item)
> config_item_put(item);
> }
>
> -static struct configfs_group_operations pci_epf_group_ops = {
> +static const struct configfs_group_operations pci_epf_group_ops = {
> .make_group = &pci_epf_make,
> .drop_item = &pci_epf_drop,
> };
> --
> 2.52.0
>
prev parent reply other threads:[~2025-12-23 16:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-14 9:45 [PATCH] scsi: target: Constify struct configfs_item_operations and configfs_group_operations Christophe JAILLET
2025-12-23 16:22 ` Bjorn Helgaas [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251223162222.GA4022020@bhelgaas \
--to=helgaas@kernel.org \
--cc=bhelgaas@google.com \
--cc=christophe.jaillet@wanadoo.fr \
--cc=kernel-janitors@vger.kernel.org \
--cc=kishon@kernel.org \
--cc=kwilczynski@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=mani@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox