smatch: rename expr_to_str() to expr_to_var()
[smatch.git] / check_bogus_irqrestore.c
blob3b64a90c26c6d362346c5c99c3d4294dc6645ff4
1 /*
2 * sparse/check_bogus_irqrestore.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_irqrestore(const char *fn, struct expression *expr, void *data)
16 struct expression *arg_expr;
17 sval_t tmp;
19 arg_expr = get_argument_from_call_expr(expr->args, 1);
20 if (!get_implied_value(arg_expr, &tmp))
21 return;
22 sm_msg("error: calling '%s()' with bogus flags", fn);
25 void check_bogus_irqrestore(int id)
27 if (option_project != PROJ_KERNEL)
28 return;
30 my_id = id;
31 add_function_hook("spin_unlock_irqrestore", &match_irqrestore, NULL);