diff options
author | LABBE Corentin <clabbe.montjoie@gmail.com> | 2016-08-12 08:46:14 -0400 |
---|---|---|
committer | Alexandre Belloni <alexandre.belloni@free-electrons.com> | 2016-08-31 12:21:35 -0400 |
commit | 84281c2d72a70456a3ba8d1e49548dd469f2e9d8 (patch) | |
tree | 84ef4b8dec82c7dad67e2fbc089b5851c7788650 /drivers/rtc/rtc-sysfs.c | |
parent | bbeb9787d9a258bc55dfd40bb37e2a87962bbe8b (diff) |
rtc: sysfs: fix a cast removing the const attribute
The char pointer buf_ptr is assigned an address from a const char
pointer buf (parameter of wakealarm_store).
The data pointer by buf_ptr is never modified.
So casting it to a (char *) is useless.
This patch remove this cast, and transform buf_ptr to a const char pointer.
Signed-off-by: LABBE Corentin <clabbe.montjoie@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Diffstat (limited to 'drivers/rtc/rtc-sysfs.c')
-rw-r--r-- | drivers/rtc/rtc-sysfs.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/rtc/rtc-sysfs.c b/drivers/rtc/rtc-sysfs.c index 63b9fb1318c2..1218d5d4224d 100644 --- a/drivers/rtc/rtc-sysfs.c +++ b/drivers/rtc/rtc-sysfs.c | |||
@@ -160,7 +160,7 @@ wakealarm_store(struct device *dev, struct device_attribute *attr, | |||
160 | unsigned long push = 0; | 160 | unsigned long push = 0; |
161 | struct rtc_wkalrm alm; | 161 | struct rtc_wkalrm alm; |
162 | struct rtc_device *rtc = to_rtc_device(dev); | 162 | struct rtc_device *rtc = to_rtc_device(dev); |
163 | char *buf_ptr; | 163 | const char *buf_ptr; |
164 | int adjust = 0; | 164 | int adjust = 0; |
165 | 165 | ||
166 | /* Only request alarms that trigger in the future. Disable them | 166 | /* Only request alarms that trigger in the future. Disable them |
@@ -171,7 +171,7 @@ wakealarm_store(struct device *dev, struct device_attribute *attr, | |||
171 | return retval; | 171 | return retval; |
172 | rtc_tm_to_time(&alm.time, &now); | 172 | rtc_tm_to_time(&alm.time, &now); |
173 | 173 | ||
174 | buf_ptr = (char *)buf; | 174 | buf_ptr = buf; |
175 | if (*buf_ptr == '+') { | 175 | if (*buf_ptr == '+') { |
176 | buf_ptr++; | 176 | buf_ptr++; |
177 | if (*buf_ptr == '=') { | 177 | if (*buf_ptr == '=') { |