Skip to content

Commit d19faf0

Browse files
raydwaipayanaegl
authored andcommitted
EDAC/amd64: Use DEVICE_ATTR helper macros
Instead of "open coding" DEVICE_ATTR, use the corresponding helper macros DEVICE_ATTR_{RW,RO,WO} in amd64_edac.c Some function names needed to be changed to match the device conventions <foo>_show and <foo>_store, but the functionality itself is unchanged. The devices using EDAC_DCT_ATTR_SHOW() are left unchanged. Reviewed-by: Yazen Ghannam <yazen.ghannam@amd.com> Signed-off-by: Dwaipayan Ray <dwaipayanray1@gmail.com> Signed-off-by: Tony Luck <tony.luck@intel.com> Link: https://lore.kernel.org/r/20210713065130.2151-1-dwaipayanray1@gmail.com
1 parent e73f0f0 commit d19faf0

File tree

1 file changed

+8
-13
lines changed

1 file changed

+8
-13
lines changed

drivers/edac/amd64_edac.c

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -571,8 +571,8 @@ EDAC_DCT_ATTR_SHOW(dbam0);
571571
EDAC_DCT_ATTR_SHOW(top_mem);
572572
EDAC_DCT_ATTR_SHOW(top_mem2);
573573

574-
static ssize_t hole_show(struct device *dev, struct device_attribute *mattr,
575-
char *data)
574+
static ssize_t dram_hole_show(struct device *dev, struct device_attribute *mattr,
575+
char *data)
576576
{
577577
struct mem_ctl_info *mci = to_mci(dev);
578578

@@ -593,7 +593,7 @@ static DEVICE_ATTR(dhar, S_IRUGO, dhar_show, NULL);
593593
static DEVICE_ATTR(dbam, S_IRUGO, dbam0_show, NULL);
594594
static DEVICE_ATTR(topmem, S_IRUGO, top_mem_show, NULL);
595595
static DEVICE_ATTR(topmem2, S_IRUGO, top_mem2_show, NULL);
596-
static DEVICE_ATTR(dram_hole, S_IRUGO, hole_show, NULL);
596+
static DEVICE_ATTR_RO(dram_hole);
597597

598598
static struct attribute *dbg_attrs[] = {
599599
&dev_attr_dhar.attr,
@@ -802,16 +802,11 @@ static ssize_t inject_write_store(struct device *dev,
802802
* update NUM_INJ_ATTRS in case you add new members
803803
*/
804804

805-
static DEVICE_ATTR(inject_section, S_IRUGO | S_IWUSR,
806-
inject_section_show, inject_section_store);
807-
static DEVICE_ATTR(inject_word, S_IRUGO | S_IWUSR,
808-
inject_word_show, inject_word_store);
809-
static DEVICE_ATTR(inject_ecc_vector, S_IRUGO | S_IWUSR,
810-
inject_ecc_vector_show, inject_ecc_vector_store);
811-
static DEVICE_ATTR(inject_write, S_IWUSR,
812-
NULL, inject_write_store);
813-
static DEVICE_ATTR(inject_read, S_IWUSR,
814-
NULL, inject_read_store);
805+
static DEVICE_ATTR_RW(inject_section);
806+
static DEVICE_ATTR_RW(inject_word);
807+
static DEVICE_ATTR_RW(inject_ecc_vector);
808+
static DEVICE_ATTR_WO(inject_write);
809+
static DEVICE_ATTR_WO(inject_read);
815810

816811
static struct attribute *inj_attrs[] = {
817812
&dev_attr_inject_section.attr,

0 commit comments

Comments
 (0)