Skip to content

Commit ede0b1d

Browse files
Li Zetaoidryomov
authored andcommitted
libceph: use min() to simplify code in ceph_dns_resolve_name()
When resolving name in ceph_dns_resolve_name(), the end address of name is determined by the minimum value of delim_p and colon_p. So using min() here is more in line with the context. Signed-off-by: Li Zetao <[email protected]> Reviewed-by: Simon Horman <[email protected]> Signed-off-by: Ilya Dryomov <[email protected]>
1 parent 2015716 commit ede0b1d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/ceph/messenger.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1254,7 +1254,7 @@ static int ceph_dns_resolve_name(const char *name, size_t namelen,
12541254
colon_p = memchr(name, ':', namelen);
12551255

12561256
if (delim_p && colon_p)
1257-
end = delim_p < colon_p ? delim_p : colon_p;
1257+
end = min(delim_p, colon_p);
12581258
else if (!delim_p && colon_p)
12591259
end = colon_p;
12601260
else {

0 commit comments

Comments
 (0)