]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - drivers/rtc/sysfs.c
Merge tag 'for-linus-5.4-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux.git] / drivers / rtc / sysfs.c
index a8f22ee726bb6113c16961a865509dadf5badefc..be3531e7f8684a66ac44519fede22106d73d31bd 100644 (file)
@@ -1,20 +1,16 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * RTC subsystem, sysfs interface
  *
  * Copyright (C) 2005 Tower Technologies
  * Author: Alessandro Zummo <a.zummo@towertech.it>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
-*/
+ */
 
 #include <linux/module.h>
 #include <linux/rtc.h>
 
 #include "rtc-core.h"
 
-
 /* device attributes */
 
 /*
@@ -86,7 +82,7 @@ max_user_freq_show(struct device *dev, struct device_attribute *attr, char *buf)
 
 static ssize_t
 max_user_freq_store(struct device *dev, struct device_attribute *attr,
-               const char *buf, size_t n)
+                   const char *buf, size_t n)
 {
        struct rtc_device *rtc = to_rtc_device(dev);
        unsigned long val;
@@ -116,12 +112,11 @@ hctosys_show(struct device *dev, struct device_attribute *attr, char *buf)
 {
 #ifdef CONFIG_RTC_HCTOSYS_DEVICE
        if (rtc_hctosys_ret == 0 &&
-                       strcmp(dev_name(&to_rtc_device(dev)->dev),
-                               CONFIG_RTC_HCTOSYS_DEVICE) == 0)
+           strcmp(dev_name(&to_rtc_device(dev)->dev),
+                  CONFIG_RTC_HCTOSYS_DEVICE) == 0)
                return sprintf(buf, "1\n");
-       else
 #endif
-               return sprintf(buf, "0\n");
+       return sprintf(buf, "0\n");
 }
 static DEVICE_ATTR_RO(hctosys);
 
@@ -175,15 +170,15 @@ wakealarm_store(struct device *dev, struct device_attribute *attr,
                if (*buf_ptr == '=') {
                        buf_ptr++;
                        push = 1;
-               } else
+               } else {
                        adjust = 1;
+               }
        }
        retval = kstrtos64(buf_ptr, 0, &alarm);
        if (retval)
                return retval;
-       if (adjust) {
+       if (adjust)
                alarm += now;
-       }
        if (alarm > now || push) {
                /* Avoid accidentally clobbering active alarms; we can't
                 * entirely prevent that here, without even the minimal