All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH linux-next] btrfs: Remove the unneeded result variable
@ 2022-09-02  7:48 cgel.zte
  2022-09-02 12:23 ` David Sterba
  2022-09-05  3:26 ` Anand Jain
  0 siblings, 2 replies; 4+ messages in thread
From: cgel.zte @ 2022-09-02  7:48 UTC (permalink / raw)
  To: clm; +Cc: josef, dsterba, linux-btrfs, linux-kernel, zhang songyi, Zeal Robot

From: zhang songyi <zhang.songyi@zte.com.cn>

Return the sysfs_emit() directly instead of storing it in another
redundant variable.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: zhang songyi <zhang.songyi@zte.com.cn>
---
 fs/btrfs/sysfs.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c
index 41f191682ad1..6268dade57d7 100644
--- a/fs/btrfs/sysfs.c
+++ b/fs/btrfs/sysfs.c
@@ -839,11 +839,8 @@ static ssize_t btrfs_sinfo_bg_reclaim_threshold_show(struct kobject *kobj,
 						     char *buf)
 {
 	struct btrfs_space_info *space_info = to_space_info(kobj);
-	ssize_t ret;
-
-	ret = sysfs_emit(buf, "%d\n", READ_ONCE(space_info->bg_reclaim_threshold));
 
-	return ret;
+	return sysfs_emit(buf, "%d\n", READ_ONCE(space_info->bg_reclaim_threshold));
 }
 
 static ssize_t btrfs_sinfo_bg_reclaim_threshold_store(struct kobject *kobj,
@@ -1205,11 +1202,8 @@ static ssize_t btrfs_bg_reclaim_threshold_show(struct kobject *kobj,
 					       char *buf)
 {
 	struct btrfs_fs_info *fs_info = to_fs_info(kobj);
-	ssize_t ret;
-
-	ret = sysfs_emit(buf, "%d\n", READ_ONCE(fs_info->bg_reclaim_threshold));
 
-	return ret;
+	return sysfs_emit(buf, "%d\n", READ_ONCE(fs_info->bg_reclaim_threshold));
 }
 
 static ssize_t btrfs_bg_reclaim_threshold_store(struct kobject *kobj,
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH linux-next] btrfs: Remove the unneeded result variable
  2022-09-02  7:48 [PATCH linux-next] btrfs: Remove the unneeded result variable cgel.zte
@ 2022-09-02 12:23 ` David Sterba
  2022-09-05  3:26 ` Anand Jain
  1 sibling, 0 replies; 4+ messages in thread
From: David Sterba @ 2022-09-02 12:23 UTC (permalink / raw)
  To: cgel.zte
  Cc: clm, josef, dsterba, linux-btrfs, linux-kernel, zhang songyi, Zeal Robot

On Fri, Sep 02, 2022 at 07:48:10AM +0000, cgel.zte@gmail.com wrote:
> From: zhang songyi <zhang.songyi@zte.com.cn>
> 
> Return the sysfs_emit() directly instead of storing it in another
> redundant variable.
> 
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: zhang songyi <zhang.songyi@zte.com.cn>

There's another patch doing a similar cleanup in btrfs_load_inode_props,
can you please resend so it's all done in one patch? I did not want to
apply a single fix but now that there are a few more instances of the
pattern it makes slightly more sense to apply it. Thanks.

https://lore.kernel.org/linux-btrfs/20220830083914.276926-1-ye.xingchen@zte.com.cn/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH linux-next] btrfs: Remove the unneeded result variable
  2022-09-02  7:48 [PATCH linux-next] btrfs: Remove the unneeded result variable cgel.zte
  2022-09-02 12:23 ` David Sterba
@ 2022-09-05  3:26 ` Anand Jain
  1 sibling, 0 replies; 4+ messages in thread
From: Anand Jain @ 2022-09-05  3:26 UTC (permalink / raw)
  To: cgel.zte, clm
  Cc: josef, dsterba, linux-btrfs, linux-kernel, zhang songyi, Zeal Robot

On 02/09/2022 15:48, cgel.zte@gmail.com wrote:
> From: zhang songyi <zhang.songyi@zte.com.cn>
> 
> Return the sysfs_emit() directly instead of storing it in another
> redundant variable.
> 
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: zhang songyi <zhang.songyi@zte.com.cn>

Reviewed-by: Anand Jain <anand.jain@oracle.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH linux-next] btrfs: Remove the unneeded result variable
@ 2022-08-30  8:39 cgel.zte
  0 siblings, 0 replies; 4+ messages in thread
From: cgel.zte @ 2022-08-30  8:39 UTC (permalink / raw)
  To: dsterba; +Cc: clm, josef, linux-btrfs, ye xingchen, Zeal Robot

From: ye xingchen <ye.xingchen@zte.com.cn>

Return the value iterate_object_props() directly instead of storing it in
another redundant variable.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
---
 fs/btrfs/props.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/fs/btrfs/props.c b/fs/btrfs/props.c
index a2ec8ecae8de..055a631276ce 100644
--- a/fs/btrfs/props.c
+++ b/fs/btrfs/props.c
@@ -270,11 +270,8 @@ int btrfs_load_inode_props(struct inode *inode, struct btrfs_path *path)
 {
 	struct btrfs_root *root = BTRFS_I(inode)->root;
 	u64 ino = btrfs_ino(BTRFS_I(inode));
-	int ret;
-
-	ret = iterate_object_props(root, path, ino, inode_prop_iterator, inode);
 
-	return ret;
+	return iterate_object_props(root, path, ino, inode_prop_iterator, inode);
 }
 
 static int prop_compression_validate(const struct btrfs_inode *inode,
-- 
2.25.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-09-05  3:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-02  7:48 [PATCH linux-next] btrfs: Remove the unneeded result variable cgel.zte
2022-09-02 12:23 ` David Sterba
2022-09-05  3:26 ` Anand Jain
  -- strict thread matches above, loose matches on Subject: below --
2022-08-30  8:39 cgel.zte

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.