2 * smatch/check_wait_for_common.c
4 * Copyright (C) 2011 Oracle.
6 * Licensed under the Open Software License version 1.1
14 static void match_wait_for_common(const char *fn
, struct expression
*expr
, void *unused
)
18 if (!expr_unsigned(expr
->left
))
20 name
= expr_to_str(expr
->left
);
21 sm_msg("error: '%s()' returns negative and '%s' is unsigned", fn
, name
);
25 void check_wait_for_common(int id
)
29 if (option_project
!= PROJ_KERNEL
)
31 add_function_assign_hook("wait_for_common", &match_wait_for_common
, NULL
);
32 add_function_assign_hook("wait_for_completion_interruptible_timeout", &match_wait_for_common
, NULL
);