mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-02 20:29:20 +00:00
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>
This commit is contained in:
parent
a734cc9ba3
commit
8bc57e7f11
7 changed files with 7 additions and 7 deletions
|
@ -116,7 +116,7 @@ static int dm355evm_rtc_set_time(struct device *dev, struct rtc_time *tm)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static struct rtc_class_ops dm355evm_rtc_ops = {
|
||||
static const struct rtc_class_ops dm355evm_rtc_ops = {
|
||||
.read_time = dm355evm_rtc_read_time,
|
||||
.set_time = dm355evm_rtc_set_time,
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue