overflow: ignore "x = &foo[ARRAY_SIZE(foo)];"
[smatch.git] / check_bogus_irqrestore.c
blob5387dbf0669a9c9d35539e4a9374d38e809a3518
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 long long val;
19 arg_expr = get_argument_from_call_expr(expr->args, 1);
20 if (!get_implied_value(arg_expr, &val))
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);