[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <77288a97-c87a-8ef2-60ab-e7f89cde07ff@gmail.com>
Date: Sun, 14 Jun 2020 11:40:42 +0700
From: Dio Putra <dioput12@...il.com>
To: gregkh@...uxfoundation.org
Cc: arve@...roid.com, tkjos@...roid.com, maco@...roid.com,
joel@...lfernandes.org, christian@...uner.io,
devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] staging: android: ashmem.c: Cleanup
Okay, my fault here. Changing the function a little bit didn't help unfortunately.
$ cd ~/git/linux/
$ make CC=clang W=1 M=drivers/staging/android
CC drivers/staging/android/ashmem.o
drivers/staging/android/ashmem.c:418:16: error: cannot assign to variable 'vmfile_fops' with const-qualified type 'const struct file_operations'
vmfile_fops = *vmfile->f_op;
~~~~~~~~~~~ ^
drivers/staging/android/ashmem.c:370:31: note: variable 'vmfile_fops' declared const here
const struct file_operations vmfile_fops;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
drivers/staging/android/ashmem.c:419:21: error: cannot assign to variable 'vmfile_fops' with const-qualified type 'const struct file_operations'
vmfile_fops.mmap = ashmem_vmfile_mmap;
~~~~~~~~~~~~~~~~ ^
drivers/staging/android/ashmem.c:370:31: note: variable 'vmfile_fops' declared const here
const struct file_operations vmfile_fops;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
drivers/staging/android/ashmem.c:420:34: error: cannot assign to variable 'vmfile_fops' with const-qualified type 'const struct file_operations'
vmfile_fops.get_unmapped_area =
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
drivers/staging/android/ashmem.c:370:31: note: variable 'vmfile_fops' declared const here
const struct file_operations vmfile_fops;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
3 errors generated.
make[1]: *** [scripts/Makefile.build:267: drivers/staging/android/ashmem.o] Error 1
make: *** [Makefile:1735: drivers/staging/android] Error 2
$
On 6/14/20 12:37 AM, Dio Putra wrote:
> Minor cleanup to make file_operations const once again.
>
> Signed-off-by: Dio Putra <dioput12@...il.com>
> ---
> drivers/staging/android/ashmem.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> base-commit: aa5af974127d317071d6225a0f3678c5f520e7ce
> diff --git a/drivers/staging/android/ashmem.c b/drivers/staging/android/ashmem.c
> index 8044510d8ec6..fbb6ac9ba1ab 100644
> --- a/drivers/staging/android/ashmem.c
> +++ b/drivers/staging/android/ashmem.c
> @@ -367,7 +367,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;
>
>
Powered by blists - more mailing lists