Skip to content

Commit 9186695

Browse files
Jiri Slaby (SUSE)bp3tk0v
authored andcommitted
EDAC/device: Remove edac_dev_sysfs_block_attribute::store()
No one uses this store hook (both BLOCK_ATTR() pass NULL). It actually never was since its addition in fd309a9 ("drivers/edac: fix leaf sysfs attribute") so drop it. Found by https://github.com/jirislaby/clang-struct. Signed-off-by: Jiri Slaby (SUSE) <[email protected]> Signed-off-by: Borislav Petkov (AMD) <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Borislav Petkov (AMD) <[email protected]>
1 parent 3667a35 commit 9186695

File tree

3 files changed

+6
-26
lines changed

3 files changed

+6
-26
lines changed

drivers/edac/edac_device.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,6 @@ edac_device_alloc_ctl_info(unsigned pvt_sz, char *dev_name, unsigned nr_instance
160160
*/
161161
attrib->attr = attrib_spec[attr].attr;
162162
attrib->show = attrib_spec[attr].show;
163-
attrib->store = attrib_spec[attr].store;
164163

165164
edac_dbg(4, "alloc-attrib=%p attrib_name='%s' attrib-spec=%p spec-name=%s\n",
166165
attrib, attrib->attr.name,

drivers/edac/edac_device.h

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,16 +95,13 @@ struct edac_dev_sysfs_attribute {
9595
*
9696
* used in leaf 'block' nodes for adding controls/attributes
9797
*
98-
* each block in each instance of the containing control structure
99-
* can have an array of the following. The show and store functions
100-
* will be filled in with the show/store function in the
101-
* low level driver.
98+
* each block in each instance of the containing control structure can
99+
* have an array of the following. The show function will be filled in
100+
* with the show function in the low level driver.
102101
*/
103102
struct edac_dev_sysfs_block_attribute {
104103
struct attribute attr;
105104
ssize_t (*show)(struct kobject *, struct attribute *, char *);
106-
ssize_t (*store)(struct kobject *, struct attribute *,
107-
const char *, size_t);
108105
};
109106

110107
/* device block control structure */

drivers/edac/edac_device_sysfs.c

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -457,35 +457,19 @@ static ssize_t edac_dev_block_show(struct kobject *kobj,
457457
return -EIO;
458458
}
459459

460-
/* Function to 'store' fields into the edac_dev 'block' structure */
461-
static ssize_t edac_dev_block_store(struct kobject *kobj,
462-
struct attribute *attr,
463-
const char *buffer, size_t count)
464-
{
465-
struct edac_dev_sysfs_block_attribute *block_attr;
466-
467-
block_attr = to_block_attr(attr);
468-
469-
if (block_attr->store)
470-
return block_attr->store(kobj, attr, buffer, count);
471-
return -EIO;
472-
}
473-
474460
/* edac_dev file operations for a 'block' */
475461
static const struct sysfs_ops device_block_ops = {
476462
.show = edac_dev_block_show,
477-
.store = edac_dev_block_store
478463
};
479464

480-
#define BLOCK_ATTR(_name,_mode,_show,_store) \
465+
#define BLOCK_ATTR(_name,_mode,_show) \
481466
static struct edac_dev_sysfs_block_attribute attr_block_##_name = { \
482467
.attr = {.name = __stringify(_name), .mode = _mode }, \
483468
.show = _show, \
484-
.store = _store, \
485469
};
486470

487-
BLOCK_ATTR(ce_count, S_IRUGO, block_ce_count_show, NULL);
488-
BLOCK_ATTR(ue_count, S_IRUGO, block_ue_count_show, NULL);
471+
BLOCK_ATTR(ce_count, S_IRUGO, block_ce_count_show);
472+
BLOCK_ATTR(ue_count, S_IRUGO, block_ue_count_show);
489473

490474
/* list of edac_dev 'block' attributes */
491475
static struct attribute *device_block_attrs[] = {

0 commit comments

Comments
 (0)