kernel:Fix the issue of incompatible __maybe_unused in the GCC compiler kernel used in versions 4.4. x to 4.9. x. (#660)

This commit is contained in:
Coconut
2023-06-20 10:35:07 +08:00
committed by GitHub
parent 22d084f89b
commit 90299ad0bb

View File

@@ -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;