Skip to content

Commit bf064c7

Browse files
raydwaipayancminyard
authored andcommitted
char: ipmi: use DEVICE_ATTR helper macro
Instead of open coding DEVICE_ATTR, use the helper macro DEVICE_ATTR_RO to replace DEVICE_ATTR with 0444 octal permissions. This was detected as a part of checkpatch evaluation investigating all reports of DEVICE_ATTR_RO warning type. Signed-off-by: Dwaipayan Ray <dwaipayanray1@gmail.com> Message-Id: <20210730062951.84876-1-dwaipayanray1@gmail.com> Signed-off-by: Corey Minyard <cminyard@mvista.com>
1 parent ca8c1c5 commit bf064c7

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

drivers/char/ipmi/ipmi_si_intf.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1605,7 +1605,7 @@ static ssize_t name##_show(struct device *dev, \
16051605
\
16061606
return snprintf(buf, 10, "%u\n", smi_get_stat(smi_info, name)); \
16071607
} \
1608-
static DEVICE_ATTR(name, 0444, name##_show, NULL)
1608+
static DEVICE_ATTR_RO(name)
16091609

16101610
static ssize_t type_show(struct device *dev,
16111611
struct device_attribute *attr,
@@ -1615,7 +1615,7 @@ static ssize_t type_show(struct device *dev,
16151615

16161616
return snprintf(buf, 10, "%s\n", si_to_str[smi_info->io.si_type]);
16171617
}
1618-
static DEVICE_ATTR(type, 0444, type_show, NULL);
1618+
static DEVICE_ATTR_RO(type);
16191619

16201620
static ssize_t interrupts_enabled_show(struct device *dev,
16211621
struct device_attribute *attr,
@@ -1626,8 +1626,7 @@ static ssize_t interrupts_enabled_show(struct device *dev,
16261626

16271627
return snprintf(buf, 10, "%d\n", enabled);
16281628
}
1629-
static DEVICE_ATTR(interrupts_enabled, 0444,
1630-
interrupts_enabled_show, NULL);
1629+
static DEVICE_ATTR_RO(interrupts_enabled);
16311630

16321631
IPMI_SI_ATTR(short_timeouts);
16331632
IPMI_SI_ATTR(long_timeouts);
@@ -1658,7 +1657,7 @@ static ssize_t params_show(struct device *dev,
16581657
smi_info->io.irq,
16591658
smi_info->io.slave_addr);
16601659
}
1661-
static DEVICE_ATTR(params, 0444, params_show, NULL);
1660+
static DEVICE_ATTR_RO(params);
16621661

16631662
static struct attribute *ipmi_si_dev_attrs[] = {
16641663
&dev_attr_type.attr,

0 commit comments

Comments
 (0)