From nobody Tue Dec 2 02:31:05 2025 Received: from mailtransmit05.runbox.com (mailtransmit05.runbox.com [185.226.149.38]) (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 4DCFF3358D8 for ; Wed, 19 Nov 2025 22:42:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.226.149.38 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763592177; cv=none; b=kWhFuwtbXiISRdWvOMlubWBRl2T5cC3xO8PS3kwmwLiwCiW5WjUeRUNjGpHaOin2lFA0xglJMq6Rij8dKL3pArYceT2A05MEKjK2nnEN6yivr5Cw8fAwhivxlSMhgTf0/W1h4uSYjXOSQVVUQge/9T+FOdmKdohX4rWY4HgQjmQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763592177; c=relaxed/simple; bh=G7/CT7tkV3C/dWWNww5Y0SXeIUmI+zVc73c8Vrd2Ubk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=pY/GvPdgjynp79bMybfPwCp+4pZDtO6ILfndg03sbnMGIznRVmz/HqoboanNXrJVXwG/uMVviGMDtizPCRk4P+jNnlB3KSStTzmmy9uceOhDNYa2OaO5bkp8q/5funLpDiUS+fMdUtlglpNZU4g9A/iMIj0Tqh0aMPPpuTdpCi4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=runbox.com; dkim=pass (2048-bit key) header.d=runbox.com header.i=@runbox.com header.b=UUw9VVkv; arc=none smtp.client-ip=185.226.149.38 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=runbox.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=runbox.com header.i=@runbox.com header.b="UUw9VVkv" Received: from mailtransmit02.runbox ([10.9.9.162] helo=aibo.runbox.com) by mailtransmit05.runbox.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1vLqt1-006kxk-Mh; Wed, 19 Nov 2025 23:42:51 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=runbox.com; s=selector1; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To :Message-Id:Date:Subject:Cc:To:From; bh=Z/NFLW53+pK0aIm6OeWkkopG1z/DUW+LdmtKXo+mrj0=; b=UUw9VVkvZP2SPMfkI04CX7NXsC RZYHI5N5x4qsMN/kXwOBxjrqxbzGzyPLOwN7zcOeynCaObNwjbsBMFmBVS74JLDDc8HBY2Mi+E6e1 dNXaFSRmIINXEYzgtf0GOz1DZTNB9Z/sOksVzOfjg4ZhXC3c1HGviwCNn2He9wrMvRni/gSo+N57/ bK/JksO3AICmyz9sYfb3clm8nu/mWaBRjh4PDa1hnlTxledtZihUKH2jJmh2e9IfZ2UZ3Fs5wM55o 6vbnVvHzv18FWx94TVUvs+b32v84V8VtSOs8yt/pPYW1eO2y8nwLHwd4GxF633ZgSfaEgrrTn+ZgR 0HQhFHHQ==; Received: from [10.9.9.74] (helo=submission03.runbox) by mailtransmit02.runbox with esmtp (Exim 4.86_2) (envelope-from ) id 1vLqt1-00086Y-ED; Wed, 19 Nov 2025 23:42:51 +0100 Received: by submission03.runbox with esmtpsa [Authenticated ID (1493616)] (TLS1.2:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.93) id 1vLqsm-00Fos6-Ej; Wed, 19 Nov 2025 23:42:36 +0100 From: david.laight.linux@gmail.com To: linux-kernel@vger.kernel.org Cc: Andrew Morton , David Laight Subject: [PATCH 38/44] lib/dynamic_queue_limits: use max() instead of max_t() Date: Wed, 19 Nov 2025 22:41:34 +0000 Message-Id: <20251119224140.8616-39-david.laight.linux@gmail.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20251119224140.8616-1-david.laight.linux@gmail.com> References: <20251119224140.8616-1-david.laight.linux@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: David Laight max_t(unsigned int, a, b) casts an 'unsigned long' to 'unsigned int'. Use max(a, b) instead as it promotes any 'unsigned int' to 'unsigned long' and so cannot discard significant bits. In this case the 'unsigned long' value is small enough that the result is ok. Detected by an extra check added to max_t(). Signed-off-by: David Laight --- lib/dynamic_queue_limits.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/dynamic_queue_limits.c b/lib/dynamic_queue_limits.c index f97a752e900a..8b9730b1d751 100644 --- a/lib/dynamic_queue_limits.c +++ b/lib/dynamic_queue_limits.c @@ -69,7 +69,7 @@ static void dql_check_stall(struct dql *dql, unsigned sho= rt stall_thrs) goto dqs_again; =20 dql->stall_cnt++; - dql->stall_max =3D max_t(unsigned short, dql->stall_max, now - t); + dql->stall_max =3D max(dql->stall_max, now - t); =20 trace_dql_stall_detected(dql->stall_thrs, now - t, dql->last_reap, dql->history_head, --=20 2.39.5