Merge branch 'cpus4096-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[GitHub/LineageOS/android_kernel_samsung_universal7580.git] / arch / x86 / kernel / cpu / mcheck / mce_64.c
index 2fe06ab5c547ddfe9a07ec77c519688dfd13345d..65a339678ece817b3b27fa56afb5ee97aae8d027 100644 (file)
@@ -762,10 +762,14 @@ DEFINE_PER_CPU(struct sys_device, device_mce);
 
 /* Why are there no generic functions for this? */
 #define ACCESSOR(name, var, start) \
-       static ssize_t show_ ## name(struct sys_device *s, char *buf) { \
+       static ssize_t show_ ## name(struct sys_device *s,              \
+                                    struct sysdev_attribute *attr,     \
+                                    char *buf) {                       \
                return sprintf(buf, "%lx\n", (unsigned long)var);       \
        }                                                               \
-       static ssize_t set_ ## name(struct sys_device *s,const char *buf,size_t siz) { \
+       static ssize_t set_ ## name(struct sys_device *s,               \
+                                   struct sysdev_attribute *attr,      \
+                                   const char *buf, size_t siz) {      \
                char *end;                                              \
                unsigned long new = simple_strtoul(buf, &end, 0);       \
                if (end == buf) return -EINVAL;                         \
@@ -786,14 +790,16 @@ ACCESSOR(bank3ctl,bank[3],mce_restart())
 ACCESSOR(bank4ctl,bank[4],mce_restart())
 ACCESSOR(bank5ctl,bank[5],mce_restart())
 
-static ssize_t show_trigger(struct sys_device *s, char *buf)
+static ssize_t show_trigger(struct sys_device *s, struct sysdev_attribute *attr,
+                               char *buf)
 {
        strcpy(buf, trigger);
        strcat(buf, "\n");
        return strlen(trigger) + 1;
 }
 
-static ssize_t set_trigger(struct sys_device *s,const char *buf,size_t siz)
+static ssize_t set_trigger(struct sys_device *s, struct sysdev_attribute *attr,
+                               const char *buf,size_t siz)
 {
        char *p;
        int len;
@@ -806,12 +812,12 @@ static ssize_t set_trigger(struct sys_device *s,const char *buf,size_t siz)
 }
 
 static SYSDEV_ATTR(trigger, 0644, show_trigger, set_trigger);
-ACCESSOR(tolerant,tolerant,)
+static SYSDEV_INT_ATTR(tolerant, 0644, tolerant);
 ACCESSOR(check_interval,check_interval,mce_restart())
 static struct sysdev_attribute *mce_attributes[] = {
        &attr_bank0ctl, &attr_bank1ctl, &attr_bank2ctl,
        &attr_bank3ctl, &attr_bank4ctl, &attr_bank5ctl,
-       &attr_tolerant, &attr_check_interval, &attr_trigger,
+       &attr_tolerant.attr, &attr_check_interval, &attr_trigger,
        NULL
 };