Module Name: src Committed By: riastradh Date: Mon Feb 27 18:28:40 UTC 2017
Modified Files: src/sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo: nouveau_engine_fifo_nve0.c Log Message: Avoid __ffs64(0). To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 \ src/sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_nve0.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_nve0.c diff -u src/sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_nve0.c:1.6 src/sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_nve0.c:1.7 --- src/sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_nve0.c:1.6 Mon Oct 26 07:12:08 2015 +++ src/sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_nve0.c Mon Feb 27 18:28:39 2017 @@ -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_struc 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));