lkml.org 
[lkml]   [2020]   [Jun]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: [PATCH] staging: android: ashmem.c: Cleanup
From
Date
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@gmail.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;
>
>

\
 
 \ /
  Last update: 2020-06-14 06:42    [W:0.091 / U:3.980 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site