Return the value from attribute->store(s, buf, len) and
attribute->show(s, buf) directly instead of storing it in
another redundant variable.
Reported-by: Zeal Robot <zealci@zte.com.cn>
Acked-by: Hyeonggon Yoo <42.hyeyoo@gmail.com>
Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
 {
        struct slab_attribute *attribute;
        struct kmem_cache *s;
-       int err;
 
        attribute = to_slab_attr(attr);
        s = to_slab(kobj);
        if (!attribute->show)
                return -EIO;
 
-       err = attribute->show(s, buf);
-
-       return err;
+       return attribute->show(s, buf);
 }
 
 static ssize_t slab_attr_store(struct kobject *kobj,
 {
        struct slab_attribute *attribute;
        struct kmem_cache *s;
-       int err;
 
        attribute = to_slab_attr(attr);
        s = to_slab(kobj);
        if (!attribute->store)
                return -EIO;
 
-       err = attribute->store(s, buf, len);
-       return err;
+       return attribute->store(s, buf, len);
 }
 
 static void kmem_cache_release(struct kobject *k)