Skip to contentSkip to conversation

staging: andriod: ashmem: Declared file operation with const keyword

PATCH In review namratajanawade 3 participants 3 messages Mar 13, 2021 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: andriod: ashmem: Declared file operation with const keyword

Warning found by checkpatch.pl script.

---
 drivers/staging/android/ashmem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/android/ashmem.c +1 -1
index d66a64e42273..7854fd410efa 100644
@@ -376,7 +376,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;
 
Signature · 1 line
2.25.1
#1 lore raw
Quoted 2 lines · namratajanawade

Warning found by checkpatch.pl script.

That doesn't tell what you did or why you did it. Please write an appropriate commit description and resend the patch.

karthik

#2 lore raw
Quoted 9 lines · B K Karthik
Quoted 2 lines · namratajanawade

Warning found by checkpatch.pl script.

That doesn't tell what you did or why you did it. Please write an appropriate commit description and resend the patch.

karthik

This patch will not even build, it has been sent several times before...

https://lore.kernel.org/r/[email protected]/
https://lore.kernel.org/r/[email protected]/
https://lore.kernel.org/r/20201128121627.GA27317@worker-node1/
https://lore.kernel.org/r/[email protected]/
https://lore.kernel.org/r/[email protected]/
https://lore.kernel.org/r/[email protected]/
https://lore.kernel.org/r/[email protected]/
https://lore.kernel.org/r/[email protected]/

I once considered adding a comment above it saying that it should not be marked const but it is a good benchmark for seeing if people compile their patches before sending them out.

Cheers,
Nathan