From 46188f4174ff4f1e0f6da76cfcf06521b6350794 Mon Sep 17 00:00:00 2001 From: Philipp Zabel Date: Tue, 30 May 2017 16:09:43 +0200 Subject: cdev: make file operations const scripts/checkpatch.pl warns that struct file_operations should be const, but cdev->ops is not const, so without this patch we can choose between a warning from checkpatch and a warning from the compiler about discarding the const attribute when assigning the struct file_operations cdev->ops. Since there is no reason to modify the contents of cdev->ops after probing, make it const. Signed-off-by: Philipp Zabel Signed-off-by: Sascha Hauer --- include/driver.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/driver.h b/include/driver.h index b743ed8b77..1edc1575c8 100644 --- a/include/driver.h +++ b/include/driver.h @@ -440,7 +440,7 @@ struct file_operations { #define MAX_PARTUUID_STR sizeof("00112233-4455-6677-8899-AABBCCDDEEFF") struct cdev { - struct file_operations *ops; + const struct file_operations *ops; void *priv; struct device_d *dev; struct device_node *device_node; -- cgit v1.2.3