From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A148F41841; Wed, 20 Dec 2023 16:15:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="yzzh2Eey" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 27C95C433C7; Wed, 20 Dec 2023 16:15:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1703088925; bh=Av97CA+gTBHEQhxsQ/rjyeYEWSRhdVSrgWixrsT9+y4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yzzh2Eeyed9CRR+wL2mEyPPzDFEFqEGF8V+0hT8YP8e9O+2dFBea+pqr6kHk8Hba5 2H3XRoSqtGqygrVAYgIuGFyK+U9wwujLzybUhpWGKW5p2KsVYxxxo9g1BTIwKtnqG8 6s6Nfxex0QcWuMVkB8OBqJ3B9gRrQKOpyRwuoOZc= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Lu Hongfei , Namjae Jeon , Steve French Subject: [PATCH 5.15 109/159] ksmbd: Replace the ternary conditional operator with min() Date: Wed, 20 Dec 2023 17:09:34 +0100 Message-ID: <20231220160936.426806194@linuxfoundation.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231220160931.251686445@linuxfoundation.org> References: <20231220160931.251686445@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Lu Hongfei [ Upstream commit f65fadb0422537d73f9a6472861852dc2f7a6a5b ] It would be better to replace the traditional ternary conditional operator with min() in compare_sids. Signed-off-by: Lu Hongfei Acked-by: Namjae Jeon Signed-off-by: Steve French Signed-off-by: Greg Kroah-Hartman --- fs/ksmbd/smbacl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/fs/ksmbd/smbacl.c +++ b/fs/ksmbd/smbacl.c @@ -97,7 +97,7 @@ int compare_sids(const struct smb_sid *c /* compare all of the subauth values if any */ num_sat = ctsid->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) { for (i = 0; i < num_subauth; ++i) { if (ctsid->sub_auth[i] != cwsid->sub_auth[i]) {