irq: Fix irq_lock api usage

irq_lock returns an unsigned int, though, several places was using
signed int. This commit fix this behaviour.

In order to avoid this error happens again, a coccinelle script was
added and can be used to check violations.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This commit is contained in:
Flavio Ceolin 2018-08-14 17:57:08 -07:00 committed by Anas Nashif
commit 0866d18d03
45 changed files with 124 additions and 73 deletions

View file

@ -55,7 +55,7 @@ static int uart_imx_init(struct device *dev)
{
UART_Type *uart = UART_STRUCT(dev);
const struct imx_uart_config *config = dev->config->config_info;
int old_level;
unsigned int old_level;
/* disable interrupts */
old_level = irq_lock();