[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211227113435.88262-1-jiapeng.chong@linux.alibaba.com>
Date: Mon, 27 Dec 2021 19:34:35 +0800
From: Jiapeng Chong <jiapeng.chong@...ux.alibaba.com>
To: clm@...com
Cc: josef@...icpanda.com, dsterba@...e.com,
linux-btrfs@...r.kernel.org, linux-kernel@...r.kernel.org,
Jiapeng Chong <jiapeng.chong@...ux.alibaba.com>,
Abaci Robot <abaci@...ux.alibaba.com>
Subject: [PATCH] btrfs: Use min() instead of doing it manually
Eliminate following coccicheck warning:
./fs/btrfs/volumes.c:7768:13-14: WARNING opportunity for min().
Reported-by: Abaci Robot <abaci@...ux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@...ux.alibaba.com>
---
fs/btrfs/volumes.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 730355b55b42..dca3f0cedff9 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -7765,7 +7765,7 @@ static int btrfs_device_init_dev_stats(struct btrfs_device *device,
btrfs_dev_stat_set(device, i, 0);
device->dev_stats_valid = 1;
btrfs_release_path(path);
- return ret < 0 ? ret : 0;
+ return min(ret, 0);
}
slot = path->slots[0];
eb = path->nodes[0];
--
2.20.1.7.g153144c
Powered by blists - more mailing lists