[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <62a6db49ef29745514b0263b9bb39b5a16f90efe.camel@perches.com>
Date: Sun, 06 Feb 2022 22:32:14 -0800
From: Joe Perches <joe@...ches.com>
To: Leonardo Araujo <leonardo.aa88@...il.com>,
gregkh@...uxfoundation.org
Cc: linux-kernel@...r.kernel.org, linux-staging@...ts.linux.dev
Subject: Re: [PATCH] Staging : android: Struct file_operations should be
const
On Mon, 2022-02-07 at 00:17 -0300, Leonardo Araujo wrote:
> From: "Leonardo Araujo" <leonardo.aa88@...il.com>
>
> WARNING: struct file_operations should normally be const
Always compile the files modified by a patch before you send it out.
[]
> diff --git 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;
> + static const struct file_operations vmfile_fops;
> struct ashmem_area *asma = file->private_data;
> int ret = 0;
>
<apply patch>
$ make allyesconfig
$ make drivers/staging/android/ashmem.o
[...]
CC drivers/staging/android/ashmem.o
drivers/staging/android/ashmem.c: In function ‘ashmem_mmap’:
drivers/staging/android/ashmem.c:431:37: error: assignment of read-only variable ‘vmfile_fops’
431 | vmfile_fops = *vmfile->f_op;
| ^
drivers/staging/android/ashmem.c:432:42: error: assignment of member ‘mmap’ in read-only object
432 | vmfile_fops.mmap = ashmem_vmfile_mmap;
| ^
drivers/staging/android/ashmem.c:433:55: error: assignment of member ‘get_unmapped_area’ in read-only object
433 | vmfile_fops.get_unmapped_area =
| ^
make[3]: *** [scripts/Makefile.build:289: drivers/staging/android/ashmem.o] Error 1
make[2]: *** [scripts/Makefile.build:572: drivers/staging/android] Error 2
make[1]: *** [scripts/Makefile.build:572: drivers/staging] Error 2
make: *** [Makefile:1965: drivers] Error 2
Powered by blists - more mailing lists