Commit 2bfbb027 authored by ye xingchen's avatar ye xingchen Committed by Vlastimil Babka

mm/slub: Remove the unneeded result variable

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: default avatarZeal Robot <zealci@zte.com.cn>
Acked-by: default avatarHyeonggon Yoo <42.hyeyoo@gmail.com>
Signed-off-by: default avatarye xingchen <ye.xingchen@zte.com.cn>
Signed-off-by: default avatarVlastimil Babka <vbabka@suse.cz>
parent 610f9c00
...@@ -5826,7 +5826,6 @@ static ssize_t slab_attr_show(struct kobject *kobj, ...@@ -5826,7 +5826,6 @@ static ssize_t slab_attr_show(struct kobject *kobj,
{ {
struct slab_attribute *attribute; struct slab_attribute *attribute;
struct kmem_cache *s; struct kmem_cache *s;
int err;
attribute = to_slab_attr(attr); attribute = to_slab_attr(attr);
s = to_slab(kobj); s = to_slab(kobj);
...@@ -5834,9 +5833,7 @@ static ssize_t slab_attr_show(struct kobject *kobj, ...@@ -5834,9 +5833,7 @@ static ssize_t slab_attr_show(struct kobject *kobj,
if (!attribute->show) if (!attribute->show)
return -EIO; return -EIO;
err = attribute->show(s, buf); return attribute->show(s, buf);
return err;
} }
static ssize_t slab_attr_store(struct kobject *kobj, static ssize_t slab_attr_store(struct kobject *kobj,
...@@ -5845,7 +5842,6 @@ static ssize_t slab_attr_store(struct kobject *kobj, ...@@ -5845,7 +5842,6 @@ static ssize_t slab_attr_store(struct kobject *kobj,
{ {
struct slab_attribute *attribute; struct slab_attribute *attribute;
struct kmem_cache *s; struct kmem_cache *s;
int err;
attribute = to_slab_attr(attr); attribute = to_slab_attr(attr);
s = to_slab(kobj); s = to_slab(kobj);
...@@ -5853,8 +5849,7 @@ static ssize_t slab_attr_store(struct kobject *kobj, ...@@ -5853,8 +5849,7 @@ static ssize_t slab_attr_store(struct kobject *kobj,
if (!attribute->store) if (!attribute->store)
return -EIO; return -EIO;
err = attribute->store(s, buf, len); return attribute->store(s, buf, len);
return err;
} }
static void kmem_cache_release(struct kobject *k) static void kmem_cache_release(struct kobject *k)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment