[PATCH] sparse: increase MAX_STRING to 4096*3
Oleg Nesterov <[email protected]> Sat, 13 Jun 2026 16:53:47 +0200
| Newsgroups | org.kernel.vger.linux-sparse |
|---|---|
| Message-ID | <[email protected]> |
Sure, 12288 is just another "random" value, but with this change the
following command
$ make C=2 CHECK="semind add --"
no longer emits the errors like
./include/trace/events/vmscan.h:122:17: error: too long token expansion
It is not clear why (before this change) MAX_STRING is odd. I guess this
comes from the initial commit 7601387b02d9 ("C99 says strings should be up
to 4095 bytes."), but I don't think this is relevant at least after another
commit fbc8230fa8c4 ("Larger buffer size for token concatenation") which
increased MAX_STRING to 4096*2-1. And struct string / __alloc_string() do
not depend on the hardcoded constants anyway.
Signed-off-by: Oleg Nesterov <[email protected]>
---
token.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/token.h b/token.h
index 9000e0cb..720ad0c3 100644
--- a/token.h
+++ b/token.h
@@ -197,7 +197,7 @@ struct token {
};
};
-#define MAX_STRING 8191
+#define MAX_STRING (4096*3)
static inline struct token *containing_token(struct token **p)
{
--
2.52.0