EDAC/device: Remove edac_dev_sysfs_block_attribute::store()
authorJiri Slaby (SUSE) <jirislaby@kernel.org>
Tue, 13 Feb 2024 11:20:47 +0000 (12:20 +0100)
committerBorislav Petkov (AMD) <bp@alien8.de>
Wed, 27 Mar 2024 17:26:57 +0000 (18:26 +0100)
No one uses this store hook (both BLOCK_ATTR() pass NULL). It actually
never was since its addition in

  fd309a9d8e63 ("drivers/edac: fix leaf sysfs attribute")

so drop it.

Found by https://github.com/jirislaby/clang-struct.

Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/r/20240213112051.27715-4-jirislaby@kernel.org
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
drivers/edac/edac_device.c
drivers/edac/edac_device.h
drivers/edac/edac_device_sysfs.c

index 0e18729111d440fe583c3e9d9dae1f790ce9d2bf..8c2aa5bcf1b73e5d9ad0f3c8edacee8ea5be363e 100644 (file)
@@ -160,7 +160,6 @@ edac_device_alloc_ctl_info(unsigned pvt_sz, char *dev_name, unsigned nr_instance
                                 */
                                attrib->attr = attrib_spec[attr].attr;
                                attrib->show = attrib_spec[attr].show;
-                               attrib->store = attrib_spec[attr].store;
 
                                edac_dbg(4, "alloc-attrib=%p attrib_name='%s' attrib-spec=%p spec-name=%s\n",
                                         attrib, attrib->attr.name,
index c4704b5b1e9f98874e74af69d02fccb54d80c3e3..a39752432c90f6eed418155c7bc524b530f8019d 100644 (file)
@@ -95,16 +95,13 @@ struct edac_dev_sysfs_attribute {
  *
  *     used in leaf 'block' nodes for adding controls/attributes
  *
- *     each block in each instance of the containing control structure
- *     can have an array of the following. The show and store functions
- *     will be filled in with the show/store function in the
- *     low level driver.
+ *     each block in each instance of the containing control structure can
+ *     have an array of the following. The show function will be filled in
+ *     with the show function in the low level driver.
  */
 struct edac_dev_sysfs_block_attribute {
        struct attribute attr;
        ssize_t (*show)(struct kobject *, struct attribute *, char *);
-       ssize_t (*store)(struct kobject *, struct attribute *,
-                       const char *, size_t);
 };
 
 /* device block control structure */
index 237a542e045a3f2af6402e674aba0e603a0f5773..fcebc4ffea26d8c0e514579f308ad4615caa7b36 100644 (file)
@@ -457,35 +457,19 @@ static ssize_t edac_dev_block_show(struct kobject *kobj,
        return -EIO;
 }
 
-/* Function to 'store' fields into the edac_dev 'block' structure */
-static ssize_t edac_dev_block_store(struct kobject *kobj,
-                               struct attribute *attr,
-                               const char *buffer, size_t count)
-{
-       struct edac_dev_sysfs_block_attribute *block_attr;
-
-       block_attr = to_block_attr(attr);
-
-       if (block_attr->store)
-               return block_attr->store(kobj, attr, buffer, count);
-       return -EIO;
-}
-
 /* edac_dev file operations for a 'block' */
 static const struct sysfs_ops device_block_ops = {
        .show = edac_dev_block_show,
-       .store = edac_dev_block_store
 };
 
-#define BLOCK_ATTR(_name,_mode,_show,_store)        \
+#define BLOCK_ATTR(_name,_mode,_show)        \
 static struct edac_dev_sysfs_block_attribute attr_block_##_name = {    \
        .attr = {.name = __stringify(_name), .mode = _mode },   \
        .show   = _show,                                        \
-       .store  = _store,                                       \
 };
 
-BLOCK_ATTR(ce_count, S_IRUGO, block_ce_count_show, NULL);
-BLOCK_ATTR(ue_count, S_IRUGO, block_ue_count_show, NULL);
+BLOCK_ATTR(ce_count, S_IRUGO, block_ce_count_show);
+BLOCK_ATTR(ue_count, S_IRUGO, block_ue_count_show);
 
 /* list of edac_dev 'block' attributes */
 static struct attribute *device_block_attrs[] = {