From 90299ad0bbd08ede502c5adbbc521e6da4e06f50 Mon Sep 17 00:00:00 2001 From: Coconut <85353552+Coconutat@users.noreply.github.com> Date: Tue, 20 Jun 2023 10:35:07 +0800 Subject: [PATCH] kernel:Fix the issue of incompatible __maybe_unused in the GCC compiler kernel used in versions 4.4. x to 4.9. x. (#660) --- kernel/ksud.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/kernel/ksud.c b/kernel/ksud.c index bb4c038c..8ef4f445 100644 --- a/kernel/ksud.c +++ b/kernel/ksud.c @@ -108,7 +108,13 @@ static const char __user *get_user_arg_ptr(struct user_arg_ptr argv, int nr) /* * count() counts the number of strings in array ARGV. */ -static int count(struct user_arg_ptr argv, int max) __maybe_unused + + /* + * Make sure old GCC compiler can use __maybe_unused, + * Test passed in 4.4.x ~ 4.9.x when use GCC. + */ + +static int __maybe_unused count(struct user_arg_ptr argv, int max) { int i = 0;