Skip to content

Commit 59047d9

Browse files
huaidan2016Ingo Molnar
authored andcommitted
x86/microcode: Use the DEVICE_ATTR_RO() macro
Use DEVICE_ATTR_RO() helper instead of open-coded DEVICE_ATTR(), which makes the code a bit shorter and easier to read. No change in functionality. Signed-off-by: Guangju Wang[baidu] <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Acked-by: Borislav Petkov (AMD) <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent ba73e36 commit 59047d9

File tree

1 file changed

+3
-3
lines changed
  • arch/x86/kernel/cpu/microcode

1 file changed

+3
-3
lines changed

arch/x86/kernel/cpu/microcode/core.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -507,16 +507,16 @@ static ssize_t version_show(struct device *dev,
507507
return sprintf(buf, "0x%x\n", uci->cpu_sig.rev);
508508
}
509509

510-
static ssize_t pf_show(struct device *dev,
510+
static ssize_t processor_flags_show(struct device *dev,
511511
struct device_attribute *attr, char *buf)
512512
{
513513
struct ucode_cpu_info *uci = ucode_cpu_info + dev->id;
514514

515515
return sprintf(buf, "0x%x\n", uci->cpu_sig.pf);
516516
}
517517

518-
static DEVICE_ATTR(version, 0444, version_show, NULL);
519-
static DEVICE_ATTR(processor_flags, 0444, pf_show, NULL);
518+
static DEVICE_ATTR_RO(version);
519+
static DEVICE_ATTR_RO(processor_flags);
520520

521521
static struct attribute *mc_default_attrs[] = {
522522
&dev_attr_version.attr,

0 commit comments

Comments
 (0)