ksmbd: Replace the ternary conditional operator with min()
It would be better to replace the traditional ternary conditional operator with min() in compare_sids. Signed-off-by: Lu Hongfei <luhongfei@vivo.com> Acked-by: Namjae Jeon <linkinjeon@kernel.org> Signed-off-by: Steve French <stfrench@microsoft.com>
This commit is contained in:
parent
81a94b2784
commit
f65fadb042
@ -97,7 +97,7 @@ int compare_sids(const struct smb_sid *ctsid, const struct smb_sid *cwsid)
|
|||||||
/* compare all of the subauth values if any */
|
/* compare all of the subauth values if any */
|
||||||
num_sat = ctsid->num_subauth;
|
num_sat = ctsid->num_subauth;
|
||||||
num_saw = cwsid->num_subauth;
|
num_saw = cwsid->num_subauth;
|
||||||
num_subauth = num_sat < num_saw ? num_sat : num_saw;
|
num_subauth = min(num_sat, num_saw);
|
||||||
if (num_subauth) {
|
if (num_subauth) {
|
||||||
for (i = 0; i < num_subauth; ++i) {
|
for (i = 0; i < num_subauth; ++i) {
|
||||||
if (ctsid->sub_auth[i] != cwsid->sub_auth[i]) {
|
if (ctsid->sub_auth[i] != cwsid->sub_auth[i]) {
|
||||||
|
Loading…
Reference in New Issue
Block a user