From nobody Tue Dec 2 02:31:06 2025 Received: from mailtransmit04.runbox.com (mailtransmit04.runbox.com [185.226.149.37]) (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 F20F73314B9 for ; Wed, 19 Nov 2025 22:42:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.226.149.37 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763592172; cv=none; b=PGH7UhaZOLlkS7T8SIn3JTgTXnvV+s2iC7QBAODvNGYMk8puXj4shR/NmTkXkk9hC8qGbwkXfWN3nGyzP+EMUTXQ+mTdJuIXIWEatFj6EHOBqcgNmvczrGXIRTIPmXD5BKGsvtRuY30AC0oGRxgnoZqJNB9mAlKzA18pbNvldRo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763592172; c=relaxed/simple; bh=BcSfZrTwXW+tG5DjjJVVlX94/P8il/6qd7mbhqcpDiU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=SInJD2AwUY4zD6kH74/zzDKhJ0MjdP5aU1qe7ufpT7bBkOqOkC7pr7sCNkcm0o7Gqw5d242uGacd0YlZWG/Xi9irK1Uke8aFuoHY4TNRyu3vFgyZ7dbMkEe7cYW553xny09nXuM3y8isYzdzYijwxg4P0gJn9wvwuFUbgWrNoiE= 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=pq2pDupl; arc=none smtp.client-ip=185.226.149.37 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="pq2pDupl" Received: from mailtransmit03.runbox ([10.9.9.163] helo=aibo.runbox.com) by mailtransmit04.runbox.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1vLqsx-006yuc-Tw for linux-kernel@vger.kernel.org; Wed, 19 Nov 2025 23:42:48 +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=+Igy4kUQLGvcfJ0gjg5dhRoXIT9GJM+aTt6LKCSi1bo=; b=pq2pDuplkexq8wn8TWwg5//+lK 7bypaF24KoUBMmsCgmL/Kl6QeeIIAxklwSAXoUxxvZ6kn3ib2OXUbjMuJjkrgT4a+0urkbTuNR2Mv IUvU2WKS3ySO/zZasLvKLqfYGj59+S6vViVkMuBcrL8b1GDCoqXkjh+tYAv7eJS6ljEgikxkwj8HV kaXa5fTs1jRSoEpYifoJISCEcGmfhKx5Vnk9jspw4E60lQnOB6w/EZjLR5t+eRBlCuQC0atx+XG6a pVTp4qrSgRR3pFjUNQrjSaL4c/8POtkHYpX5pcuLqYZ6pvZ3G/j8zK/BUpIpAKIf827n1BZzfSHFy 7SIX7xaw==; Received: from [10.9.9.74] (helo=submission03.runbox) by mailtransmit03.runbox with esmtp (Exim 4.86_2) (envelope-from ) id 1vLqsx-0000DP-Es; Wed, 19 Nov 2025 23:42:47 +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 1vLqse-00Fos6-8d; Wed, 19 Nov 2025 23:42:28 +0100 From: david.laight.linux@gmail.com To: linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org Cc: Andi Shyti , Mika Westerberg , David Laight Subject: [PATCH 20/44] drivers/i2c/busses: use min() instead of min_t() Date: Wed, 19 Nov 2025 22:41:16 +0000 Message-Id: <20251119224140.8616-21-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 min_t(u8, a, b) casts both its arguments to u8 potentially discarding signifinact bits. Use min(a, b) instead as it cannot discard significant bits. Detected by an extra check added to min_t(). Signed-off-by: David Laight --- drivers/i2c/busses/i2c-designware-master.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-designware-master.c b/drivers/i2c/busse= s/i2c-designware-master.c index 41e9b5ecad20..8fc51d472a55 100644 --- a/drivers/i2c/busses/i2c-designware-master.c +++ b/drivers/i2c/busses/i2c-designware-master.c @@ -564,7 +564,7 @@ i2c_dw_recv_len(struct dw_i2c_dev *dev, u8 len) * after receiving the first byte. */ len +=3D (flags & I2C_CLIENT_PEC) ? 2 : 1; - dev->tx_buf_len =3D len - min_t(u8, len, dev->rx_outstanding); + dev->tx_buf_len =3D len - min(len, dev->rx_outstanding); msgs[dev->msg_read_idx].len =3D len; msgs[dev->msg_read_idx].flags &=3D ~I2C_M_RECV_LEN; =20 --=20 2.39.5