| 1 |
Origin: https://github.com/chunkeey/carl9170fw/pull/8 |
| 2 |
From: Bastian Germann <[email protected]> |
| 3 |
Date: Thu, 30 Jul 2026 19:10:44 +0200 |
| 4 |
Subject: [PATCH 1/7] Use min_t over MIN |
| 5 |
|
| 6 |
This allows us to drop the sys/param.h include. |
| 7 |
|
| 8 |
Signed-off-by: Bastian Germann <[email protected]> |
| 9 |
--- |
| 10 |
carlfw/src/hostif.c | 2 +- |
| 11 |
include/linux/types.h | 1 - |
| 12 |
2 files changed, 1 insertion(+), 2 deletions(-) |
| 13 |
|
| 14 |
diff --git a/carlfw/src/hostif.c b/carlfw/src/hostif.c |
| 15 |
index 06726db..95e8e70 100644 |
| 16 |
--- a/carlfw/src/hostif.c |
| 17 |
+++ b/carlfw/src/hostif.c |
| 18 |
@@ -240,7 +240,7 @@ void handle_cmd(struct carl9170_rsp *resp) |
| 19 |
|
| 20 |
case CARL9170_CMD_WREGB: |
| 21 |
resp->hdr.len = 0; |
| 22 |
- for (i = 0; i < MIN(cmd->wregb.count, cmd->hdr.len - 8); i++) |
| 23 |
+ for (i = 0; i < min_t(__u32, cmd->wregb.count, cmd->hdr.len - 8); i++) |
| 24 |
setb(cmd->wregb.addr + i, cmd->wregb.val[i]); |
| 25 |
break; |
| 26 |
|
| 27 |
diff --git a/include/linux/types.h b/include/linux/types.h |
| 28 |
index 82bf905..528d207 100644 |
| 29 |
--- a/include/linux/types.h |
| 30 |
+++ b/include/linux/types.h |
| 31 |
@@ -20,7 +20,6 @@ |
| 32 |
#include <stdint.h> |
| 33 |
#include <stdbool.h> |
| 34 |
#include <stdlib.h> |
| 35 |
-#include <sys/param.h> |
| 36 |
#include <sys/cdefs.h> |
| 37 |
|
| 38 |
#if BYTE_ORDER == BIG_ENDIAN |