db: improve database debugging
[smatch.git] / check_mod_timer.c
blob16082d804d8d000e66f2297290d1f21e065c3b3c
1 /*
2 * smatch/check_mod_timer.c
4 * Copyright (C) 2010 Dan Carpenter.
6 * Licensed under the Open Software License version 1.1
8 */
10 #include "smatch.h"
11 #include "smatch_slist.h"
13 static int my_id;
15 static void match_mod_timer(const char *fn, struct expression *expr, void *param)
17 struct expression *arg;
18 sval_t sval;
20 arg = get_argument_from_call_expr(expr->args, 1);
21 if (!get_value(arg, &sval) || sval.value == 0)
22 return;
23 sm_msg("warn: mod_timer() takes an absolute time not an offset.");
26 void check_mod_timer(int id)
28 if (option_project != PROJ_KERNEL)
29 return;
31 my_id = id;
32 add_function_hook("mod_timer", &match_mod_timer, NULL);