Avoid __ffs64(0).

This commit is contained in:
riastradh 2017-02-27 18:28:39 +00:00
parent 5fa0ec317f
commit b7c3ac0d8d
1 changed files with 8 additions and 4 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: nouveau_engine_fifo_nve0.c,v 1.6 2015/10/26 07:12:08 mrg Exp $ */
/* $NetBSD: nouveau_engine_fifo_nve0.c,v 1.7 2017/02/27 18:28:39 riastradh Exp $ */
/*
* Copyright 2012 Red Hat Inc.
@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: nouveau_engine_fifo_nve0.c,v 1.6 2015/10/26 07:12:08 mrg Exp $");
__KERNEL_RCSID(0, "$NetBSD: nouveau_engine_fifo_nve0.c,v 1.7 2017/02/27 18:28:39 riastradh Exp $");
#include <core/client.h>
#include <core/handle.h>
@ -476,11 +476,15 @@ nve0_fifo_recover_work(struct work_struct *work)
priv->mask = 0ULL;
spin_unlock_irqrestore(&priv->base.lock, flags);
for (todo = mask; engn = __ffs64(todo), todo; todo &= ~(1 << engn))
for (todo = mask;
todo && (engn = __ffs64(todo), 1);
todo &= ~(1 << engn))
engm |= 1 << nve0_fifo_engidx(priv, engn);
nv_mask(priv, 0x002630, engm, engm);
for (todo = mask; engn = __ffs64(todo), todo; todo &= ~(1 << engn)) {
for (todo = mask;
todo && (engn = __ffs64(todo), 1);
todo &= ~(1 << engn)) {
if ((engine = (void *)nouveau_engine(priv, engn))) {
nv_ofuncs(engine)->fini(engine, false);
WARN_ON(nv_ofuncs(engine)->init(engine));