Re: [PATCH] serial: jsm: Use min_t instead of min

From: Jiri Slaby
Date: Mon Feb 20 2023 - 06:52:36 EST


On 19. 02. 23, 21:53, Mohammad Mahfooz wrote:
Use min_t instead of min to cut down n further if needed.

Signed-off-by: Mohammad Mahfooz <mohammadmahfoozpersonal@xxxxxxxxx>
---
drivers/tty/serial/jsm/jsm_neo.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/serial/jsm/jsm_neo.c b/drivers/tty/serial/jsm/jsm_neo.c
index 0c78f66276cd..4cce1e423b06 100644
--- a/drivers/tty/serial/jsm/jsm_neo.c
+++ b/drivers/tty/serial/jsm/jsm_neo.c
@@ -350,7 +350,7 @@ static void neo_copy_data_from_uart_to_queue(struct jsm_channel *ch)
* IBM pSeries platform.
* 15 bytes max appears to be the magic number.
*/
- n = min((u32) n, (u32) 12);
+ n = min_t(u32, n, 12);

Nah, why is "n" signed in the first place? Could you fix that and all all those casts in min()s around instead?

--
js
suse labs