net: smc: fix different types in min()
authorJakub Kicinski <kuba@kernel.org>
Tue, 1 Mar 2022 22:24:46 +0000 (14:24 -0800)
committerJakub Kicinski <kuba@kernel.org>
Wed, 2 Mar 2022 00:43:27 +0000 (16:43 -0800)
Fix build:

 include/linux/minmax.h:45:25: note: in expansion of macro ‘__careful_cmp’
   45 | #define min(x, y)       __careful_cmp(x, y, <)
      |                         ^~~~~~~~~~~~~
 net/smc/smc_tx.c:150:24: note: in expansion of macro ‘min’
  150 |         corking_size = min(sock_net(&smc->sk)->smc.sysctl_autocorking_size,
      |                        ^~~

Fixes: 12bbb0d163a9 ("net/smc: add sysctl for autocorking")
Link: https://lore.kernel.org/r/20220301222446.1271127-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/smc/smc_tx.c

index 257dc0d..98ca922 100644 (file)
@@ -147,8 +147,8 @@ static bool smc_should_autocork(struct smc_sock *smc)
        struct smc_connection *conn = &smc->conn;
        int corking_size;
 
-       corking_size = min(sock_net(&smc->sk)->smc.sysctl_autocorking_size,
-                          conn->sndbuf_desc->len >> 1);
+       corking_size = min_t(unsigned int, conn->sndbuf_desc->len >> 1,
+                            sock_net(&smc->sk)->smc.sysctl_autocorking_size);
 
        if (atomic_read(&conn->cdc_pend_tx_wr) == 0 ||
            smc_tx_prepared_sends(conn) > corking_size)