mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/5] cdev: make file operations const
@ 2017-05-30 14:09 Philipp Zabel
  2017-05-30 14:09 ` [PATCH 2/5] commands: mount: combine dev and devstr, which are the same Philipp Zabel
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Philipp Zabel @ 2017-05-30 14:09 UTC (permalink / raw)
  To: barebox

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 <p.zabel@pengutronix.de>
---
 include/driver.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/driver.h b/include/driver.h
index 52e06f7d62..086e44636b 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;
-- 
2.11.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-06-01  9:37 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-30 14:09 [PATCH 1/5] cdev: make file operations const Philipp Zabel
2017-05-30 14:09 ` [PATCH 2/5] commands: mount: combine dev and devstr, which are the same Philipp Zabel
2017-05-30 14:09 ` [PATCH 3/5] fs: add parseopt_b for loop mount option Philipp Zabel
2017-05-30 14:09 ` [PATCH 4/5] fs: add cdev_create_from_file " Philipp Zabel
2017-06-01  6:31   ` Sascha Hauer
2017-06-01  9:37     ` Philipp Zabel
2017-05-30 14:09 ` [PATCH 5/5] commands: mount: mention file loop mounts in the help text Philipp Zabel
2017-06-01  6:32 ` [PATCH 1/5] cdev: make file operations const Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox