soc: fsl: qe: avoid IS_ERR_VALUE in ucc_fast.c
authorRasmus Villemoes <linux@rasmusvillemoes.dk>
Thu, 28 Nov 2019 14:55:48 +0000 (15:55 +0100)
committerLi Yang <leoyang.li@nxp.com>
Mon, 9 Dec 2019 19:54:37 +0000 (13:54 -0600)
commitc93c159aefb089e79def966b99079b585c9108e2
treeebcad993fd96ce944f4ed34907813b381e7cc63c
parent71352b8c4016fbf24e5244877c2ebf93eb9d4c73
soc: fsl: qe: avoid IS_ERR_VALUE in ucc_fast.c

When building this on a 64-bit platform gcc rightly warns that the
error checking is broken (-ENOMEM stored in an u32 does not compare
greater than (unsigned long)-MAX_ERRNO). Instead, change the
ucc_fast_[tr]x_virtual_fifo_base_offset members to s32 and use an
ordinary check-for-negative. Also, this avoids treating 0 as "this
cannot have been returned from qe_muram_alloc() so don't free it".

Reviewed-by: Timur Tabi <timur@kernel.org>
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Li Yang <leoyang.li@nxp.com>
drivers/soc/fsl/qe/ucc_fast.c
include/soc/fsl/qe/ucc_fast.h