public inbox for linux-staging@lists.linux.dev
 help / color / mirror / Atom feed
From: "Fabio M. De Francesco" <fmdefrancesco@gmail.com>
To: linux-staging@lists.linux.dev, Krish Jain <krishjain02939@gmail.com>
Subject: Re: [PATCH] Declare the file_operations struct as const
Date: Fri, 27 Aug 2021 08:49:30 +0200	[thread overview]
Message-ID: <3634721.RBzQ2xsved@localhost.localdomain> (raw)
In-Reply-To: <CAPGkw+x+B1731SL=afoSKiWwH-n-FA5YJ+WOwYdv8iyFhWk1zA@mail.gmail.com>

On Friday, August 27, 2021 3:59:28 AM CEST Krish Jain wrote:
>  From: Krish Jain <krishjain02939@gmail.com>
> 
> Declare the file_operations struct as const as done elsewhere in the
> kernel, as there are no modifications to its fields.
> 
> Signed-off-by: Krish Jain <krishjain02939@gmail.com>
> ---
>  drivers/staging/android/ashmem.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/android/ashmem.c b/drivers/staging/android/ashmem.c
> index ddbde3f8430e..ec18f2ddd66c 100644
> --- a/drivers/staging/android/ashmem.c
> +++ b/drivers/staging/android/ashmem.c
> @@ -377,7 +377,7 @@ ashmem_vmfile_get_unmapped_area(struct file *file,
> unsigned long addr,
> 
>  static int ashmem_mmap(struct file *file, struct vm_area_struct *vma)
>  {
> -       static struct file_operations vmfile_fops;
> +       const static struct file_operations vmfile_fops;
>         struct ashmem_area *asma = file->private_data;
>         int ret = 0;
> 
> --
> 2.25.1

Are you sure that it works? I wouldn't be.
You didn't build this file. Please build your changes before submitting patches.

Furthermore, please always rebase to the current version of the staging tree.

Finally, please use the class modifier "static" as the first keyword of a declaration/definition
as it is done everywhere in the kernel (see "grep -rn "static const" drivers/staging/" and
then switch to "const static" and read the output).

Thanks,

Fabio




  reply	other threads:[~2021-08-27  6:49 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-27  1:59 [PATCH] Declare the file_operations struct as const Krish Jain
2021-08-27  6:49 ` Fabio M. De Francesco [this message]
2021-08-27  7:48   ` Fabio M. De Francesco
     [not found]     ` <CAPGkw+yJ=V0OwFE+uqCeWWS8JbJD=YBE3+Uk-OKpmHRnvSTh+A@mail.gmail.com>
     [not found]       ` <CAPGkw+w-y+iC3dMDLxi8DR3N+jf8roiJ2Vs_-uHxJ=i57eTiUA@mail.gmail.com>
2021-08-27 19:46         ` Krish Jain
2021-08-27 23:38           ` Bryan Brattlof
2021-08-28  9:37             ` Krish Jain
2021-08-28  9:46               ` Greg KH
2021-08-28  9:52                 ` Krish Jain
2021-08-28 11:13                   ` Fabio M. De Francesco
2021-08-29  2:13             ` Krish Jain
2021-08-29  2:16               ` Krish Jain
2021-08-29  6:16               ` Greg KH
2021-08-29  9:39                 ` Krish Jain
2021-08-27  6:52 ` Greg KH
  -- strict thread matches above, loose matches on Subject: below --
2021-08-29 14:45 Bryan Brattlof
2021-08-29 16:20 ` Krish Jain
2021-08-29 16:34   ` Krish Jain
2021-08-29 16:49   ` Bryan Brattlof
2021-08-29 16:56     ` Krish Jain
2021-08-29 18:28       ` Krish Jain
2021-08-29 18:46         ` Krish Jain
2021-08-29 21:00           ` Bryan Brattlof
2021-08-29 22:11             ` Krish Jain
2021-08-30 12:40               ` Krish Jain
2021-08-30 13:01                 ` Krish Jain
2021-08-31  0:42                   ` Krish Jain
2021-08-31 13:35                     ` Bryan Brattlof
2021-08-31 14:00                       ` Fabio M. De Francesco
2021-08-31 23:00                         ` Bryan Brattlof
2021-09-01 15:20                           ` Krish Jain
2021-09-01 15:30                             ` Greg KH
2021-09-01 15:34                               ` Krish Jain
2021-09-01 16:51                                 ` Greg KH
2021-09-01 17:34                                   ` Bryan Brattlof
2021-09-01 18:04                                     ` Krish Jain
2021-09-01 20:29                                       ` Bryan Brattlof

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=3634721.RBzQ2xsved@localhost.localdomain \
    --to=fmdefrancesco@gmail.com \
    --cc=krishjain02939@gmail.com \
    --cc=linux-staging@lists.linux.dev \
    /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