OSDN Git Service

soc: fsl: qe: fix static checker warning
authorMaxim Kochetkov <fido_max@inbox.ru>
Wed, 11 Aug 2021 07:10:36 +0000 (10:10 +0300)
committerLi Yang <leoyang.li@nxp.com>
Fri, 13 Aug 2021 21:56:10 +0000 (16:56 -0500)
commitc1e64c0aec8cb0499e61af7ea086b59abba97945
treec3d7cd9be078d6abb683b7580bbf167ffe799083
parentbe7ecbd240b2f9ec544d3ce6fccf4cec3cd15dca
soc: fsl: qe: fix static checker warning

The patch be7ecbd240b2: "soc: fsl: qe: convert QE interrupt
controller to platform_device" from Aug 3, 2021, leads to the
following static checker warning:

drivers/soc/fsl/qe/qe_ic.c:438 qe_ic_init()
warn: unsigned 'qe_ic->virq_low' is never less than zero.

In old variant irq_of_parse_and_map() returns zero if failed so
unsigned int for virq_high/virq_low was ok.
In new variant platform_get_irq() returns negative error codes
if failed so we need to use int for virq_high/virq_low.

Also simplify high_handler checking and remove the curly braces
to make checkpatch happy.

Fixes: be7ecbd240b2 ("soc: fsl: qe: convert QE interrupt controller to platform_device")
Signed-off-by: Maxim Kochetkov <fido_max@inbox.ru>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Li Yang <leoyang.li@nxp.com>
drivers/soc/fsl/qe/qe_ic.c