MIPS: lantiq: falcon: sysctrl: fix request memory check logic
authorShiji Yang <yangshiji66@outlook.com>
Wed, 18 Jun 2025 14:53:23 +0000 (22:53 +0800)
committerThomas Bogendoerfer <tsbogend@alpha.franken.de>
Thu, 3 Jul 2025 10:35:11 +0000 (12:35 +0200)
commit9c9a7ff9882fc6ba7d2f4050697e8bb80383e8dc
tree13ce59c929b36565431e2b79a03e1cf85c20a11b
parent8a6156bd26240177e710fd8623bc2eb0ef0092cf
MIPS: lantiq: falcon: sysctrl: fix request memory check logic

request_mem_region() will return NULL instead of error code
when the memory request fails. Therefore, we should check if
the return value is non-zero instead of less than zero. In
this way, this patch also fixes the build warnings:

arch/mips/lantiq/falcon/sysctrl.c:214:50: error: ordered comparison of pointer with integer zero [-Werror=extra]
  214 |                                 res_status.name) < 0) ||
      |                                                  ^
arch/mips/lantiq/falcon/sysctrl.c:216:47: error: ordered comparison of pointer with integer zero [-Werror=extra]
  216 |                                 res_ebu.name) < 0) ||
      |                                               ^
arch/mips/lantiq/falcon/sysctrl.c:219:50: error: ordered comparison of pointer with integer zero [-Werror=extra]
  219 |                                 res_sys[0].name) < 0) ||
      |                                                  ^
arch/mips/lantiq/falcon/sysctrl.c:222:50: error: ordered comparison of pointer with integer zero [-Werror=extra]
  222 |                                 res_sys[1].name) < 0) ||
      |                                                  ^
arch/mips/lantiq/falcon/sysctrl.c:225:50: error: ordered comparison of pointer with integer zero [-Werror=extra]
  225 |                                 res_sys[2].name) < 0))
      |

Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
arch/mips/lantiq/falcon/sysctrl.c