From: Vlastimil Babka <vbabka@suse.cz>
To: cgel.zte@gmail.com, 42.hyeyoo@gmail.com
Cc: cl@linux.com, penberg@kernel.org, rientjes@google.com,
iamjoonsoo.kim@lge.com, akpm@linux-foundation.org,
roman.gushchin@linux.dev, linux-mm@kvack.org,
linux-kernel@vger.kernel.org,
ye xingchen <ye.xingchen@zte.com.cn>,
Zeal Robot <zealci@zte.com.cn>
Subject: Re: [PATCH linux-next v2] mm/slub: Remove the unneeded result variable
Date: Tue, 23 Aug 2022 16:08:57 +0200 [thread overview]
Message-ID: <42323fe6-3ac1-4dff-cf49-6e97525df837@suse.cz> (raw)
In-Reply-To: <20220822013830.199836-1-ye.xingchen@zte.com.cn>
On 8/22/22 03:38, cgel.zte@gmail.com wrote:
> From: ye xingchen <ye.xingchen@zte.com.cn>
>
> 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>
Thanks, added to slab.git for-6.1/trivial
> ---
> v1 -> v2
> Add the whitespace between subsystem and summary in subject line.
> mm/slub.c | 9 ++-------
> 1 file changed, 2 insertions(+), 7 deletions(-)
>
> diff --git a/mm/slub.c b/mm/slub.c
> index 6953c3367bc2..7bea010a20ff 100644
> --- a/mm/slub.c
> +++ b/mm/slub.c
> @@ -5852,7 +5852,6 @@ static ssize_t slab_attr_show(struct kobject *kobj,
> {
> struct slab_attribute *attribute;
> struct kmem_cache *s;
> - int err;
>
> attribute = to_slab_attr(attr);
> s = to_slab(kobj);
> @@ -5860,9 +5859,7 @@ static ssize_t slab_attr_show(struct kobject *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,
> @@ -5871,7 +5868,6 @@ 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);
> @@ -5879,8 +5875,7 @@ static ssize_t slab_attr_store(struct kobject *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)
prev parent reply other threads:[~2022-08-23 17:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-22 1:38 [PATCH linux-next v2] mm/slub: Remove the unneeded result variable cgel.zte
2022-08-23 14:08 ` Vlastimil Babka [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=42323fe6-3ac1-4dff-cf49-6e97525df837@suse.cz \
--to=vbabka@suse.cz \
--cc=42.hyeyoo@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=cgel.zte@gmail.com \
--cc=cl@linux.com \
--cc=iamjoonsoo.kim@lge.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=penberg@kernel.org \
--cc=rientjes@google.com \
--cc=roman.gushchin@linux.dev \
--cc=ye.xingchen@zte.com.cn \
--cc=zealci@zte.com.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).