mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] btrfs: Use min() instead of doing it manually
@ 2021-12-27 11:34 Jiapeng Chong
  2021-12-27 11:49 ` Qu Wenruo
  0 siblings, 1 reply; 3+ messages in thread
From: Jiapeng Chong @ 2021-12-27 11:34 UTC (permalink / raw)
  To: clm; +Cc: josef, dsterba, linux-btrfs, linux-kernel, Jiapeng Chong, Abaci Robot

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


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

end of thread, other threads:[~2022-01-03 18:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-27 11:34 [PATCH] btrfs: Use min() instead of doing it manually Jiapeng Chong
2021-12-27 11:49 ` Qu Wenruo
2022-01-03 18:12   ` David Sterba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®