Messages in this thread Patch in this message | | | From | Jiapeng Chong <> | Subject | [PATCH] btrfs: Use min() instead of doing it manually | Date | Mon, 27 Dec 2021 19:34:35 +0800 |
| |
Eliminate following coccicheck warning:
./fs/btrfs/volumes.c:7768:13-14: WARNING opportunity for min().
Reported-by: Abaci Robot <abaci@linux.alibaba.com> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.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
| |