Skip to content

Commit 2bfbb02

Browse files
ye xingchentehcaster
authored andcommitted
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: Zeal Robot <[email protected]> Acked-by: Hyeonggon Yoo <[email protected]> Signed-off-by: ye xingchen <[email protected]> Signed-off-by: Vlastimil Babka <[email protected]>
1 parent 610f9c0 commit 2bfbb02

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

mm/slub.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5826,17 +5826,14 @@ static ssize_t slab_attr_show(struct kobject *kobj,
58265826
{
58275827
struct slab_attribute *attribute;
58285828
struct kmem_cache *s;
5829-
int err;
58305829

58315830
attribute = to_slab_attr(attr);
58325831
s = to_slab(kobj);
58335832

58345833
if (!attribute->show)
58355834
return -EIO;
58365835

5837-
err = attribute->show(s, buf);
5838-
5839-
return err;
5836+
return attribute->show(s, buf);
58405837
}
58415838

58425839
static ssize_t slab_attr_store(struct kobject *kobj,
@@ -5845,16 +5842,14 @@ static ssize_t slab_attr_store(struct kobject *kobj,
58455842
{
58465843
struct slab_attribute *attribute;
58475844
struct kmem_cache *s;
5848-
int err;
58495845

58505846
attribute = to_slab_attr(attr);
58515847
s = to_slab(kobj);
58525848

58535849
if (!attribute->store)
58545850
return -EIO;
58555851

5856-
err = attribute->store(s, buf, len);
5857-
return err;
5852+
return attribute->store(s, buf, len);
58585853
}
58595854

58605855
static void kmem_cache_release(struct kobject *k)

0 commit comments

Comments
 (0)