diff options
author | Bhumika Goyal <bhumirks@gmail.com> | 2017-01-05 17:55:05 +0100 |
---|---|---|
committer | Alexandre Belloni <alexandre.belloni@free-electrons.com> | 2017-01-11 17:23:06 +0100 |
commit | 8bc57e7f11971665b4a7886305dffcd27213d718 (patch) | |
tree | 8e76735d0af7e67ff700dcd54a7e1af67ab5b86b /drivers/rtc/rtc-ls1x.c | |
parent | Documentation: dt: rtc-imxdi: security violation interrupt (diff) | |
download | linux-8bc57e7f11971665b4a7886305dffcd27213d718.tar.xz linux-8bc57e7f11971665b4a7886305dffcd27213d718.zip |
rtc: constify rtc_class_ops structures
Declare rtc_class_ops structures as const as they are only passed
as an argument to the function devm_rtc_device_register. This argument
is of type const struct rtc_class_ops *, so rtc_class_ops structures
having this property can be declared const.
Done using Coccinelle:
@r1 disable optional_qualifier @
identifier i;
position p;
@@
static struct rtc_class_ops i@p = {...};
@ok1@
identifier r1.i;
position p;
@@
devm_rtc_device_register(...,&i@p,...)
@bad@
position p!={r1.p,ok1.p};
identifier r1.i;
@@
i@p
@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
+const
struct rtc_class_ops i;
Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Diffstat (limited to 'drivers/rtc/rtc-ls1x.c')
-rw-r--r-- | drivers/rtc/rtc-ls1x.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/rtc/rtc-ls1x.c b/drivers/rtc/rtc-ls1x.c index 22a9ec4f2b83..e04ca54f21e2 100644 --- a/drivers/rtc/rtc-ls1x.c +++ b/drivers/rtc/rtc-ls1x.c @@ -138,7 +138,7 @@ err: return ret; } -static struct rtc_class_ops ls1x_rtc_ops = { +static const struct rtc_class_ops ls1x_rtc_ops = { .read_time = ls1x_rtc_read_time, .set_time = ls1x_rtc_set_time, }; |