unreachable code: don't warn about empty statements
[smatch.git] / check_wait_for_common.c
blob1e00ad651b7c9e899ea49b02e914eb1fb6051543
1 /*
2 * smatch/check_wait_for_common.c
4 * Copyright (C) 2011 Oracle.
6 * Licensed under the Open Software License version 1.1
8 */
10 #include "smatch.h"
12 static int my_id;
14 static void match_wait_for_common(const char *fn, struct expression *expr, void *unused)
16 char *name;
18 if (!expr_unsigned(expr->left))
19 return;
20 name = expr_to_str(expr->left);
21 sm_msg("error: '%s()' returns negative and '%s' is unsigned", fn, name);
22 free_string(name);
25 void check_wait_for_common(int id)
27 my_id = id;
29 if (option_project != PROJ_KERNEL)
30 return;
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);