[PATCH 5.17 0640/1126] powerpc/sysdev: fix incorrect use to determine if list is empty