* [PATCH] cifs: Constify static struct genl_ops
@ 2021-05-26 20:35 Rikard Falkeborn
2021-06-05 20:47 ` Steve French
0 siblings, 1 reply; 2+ messages in thread
From: Rikard Falkeborn @ 2021-05-26 20:35 UTC (permalink / raw)
To: Steve French; +Cc: linux-cifs, samba-technical, linux-kernel, Rikard Falkeborn
The only usage of cifs_genl_ops[] is to assign its address to the ops
field in the genl_family struct, which is a pointer to const. Make it
const to allow the compiler to put it in read-only memory.
Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
---
fs/cifs/netlink.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/cifs/netlink.c b/fs/cifs/netlink.c
index 5aaabe4cc0a7..291cb606f149 100644
--- a/fs/cifs/netlink.c
+++ b/fs/cifs/netlink.c
@@ -30,7 +30,7 @@ static const struct nla_policy cifs_genl_policy[CIFS_GENL_ATTR_MAX + 1] = {
[CIFS_GENL_ATTR_SWN_RESOURCE_NAME] = { .type = NLA_STRING},
};
-static struct genl_ops cifs_genl_ops[] = {
+static const struct genl_ops cifs_genl_ops[] = {
{
.cmd = CIFS_GENL_CMD_SWN_NOTIFY,
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
--
2.31.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] cifs: Constify static struct genl_ops
2021-05-26 20:35 [PATCH] cifs: Constify static struct genl_ops Rikard Falkeborn
@ 2021-06-05 20:47 ` Steve French
0 siblings, 0 replies; 2+ messages in thread
From: Steve French @ 2021-06-05 20:47 UTC (permalink / raw)
To: Rikard Falkeborn; +Cc: CIFS, samba-technical, LKML, Samuel Cabrero
merged into cifs-2.6.git for-next
On Wed, May 26, 2021 at 4:06 PM Rikard Falkeborn
<rikard.falkeborn@gmail.com> wrote:
>
> The only usage of cifs_genl_ops[] is to assign its address to the ops
> field in the genl_family struct, which is a pointer to const. Make it
> const to allow the compiler to put it in read-only memory.
>
> Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
> ---
> fs/cifs/netlink.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/cifs/netlink.c b/fs/cifs/netlink.c
> index 5aaabe4cc0a7..291cb606f149 100644
> --- a/fs/cifs/netlink.c
> +++ b/fs/cifs/netlink.c
> @@ -30,7 +30,7 @@ static const struct nla_policy cifs_genl_policy[CIFS_GENL_ATTR_MAX + 1] = {
> [CIFS_GENL_ATTR_SWN_RESOURCE_NAME] = { .type = NLA_STRING},
> };
>
> -static struct genl_ops cifs_genl_ops[] = {
> +static const struct genl_ops cifs_genl_ops[] = {
> {
> .cmd = CIFS_GENL_CMD_SWN_NOTIFY,
> .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
> --
> 2.31.1
>
--
Thanks,
Steve
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-06-05 20:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-26 20:35 [PATCH] cifs: Constify static struct genl_ops Rikard Falkeborn
2021-06-05 20:47 ` Steve French
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).