Module Name: src Committed By: riastradh Date: Mon Feb 27 20:29:00 UTC 2017
Modified Files: src/sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo: nouveau_engine_fifo_nvc0.c Log Message: Avoid __ffs64(0). >From maya@. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 \ src/sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_nvc0.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_nvc0.c diff -u src/sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_nvc0.c:1.5 src/sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_nvc0.c:1.6 --- src/sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_nvc0.c:1.5 Sun Oct 25 21:44:16 2015 +++ src/sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_nvc0.c Mon Feb 27 20:29:00 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: nouveau_engine_fifo_nvc0.c,v 1.5 2015/10/25 21:44:16 mrg Exp $ */ +/* $NetBSD: nouveau_engine_fifo_nvc0.c,v 1.6 2017/02/27 20:29:00 riastradh Exp $ */ /* * Copyright 2012 Red Hat Inc. @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: nouveau_engine_fifo_nvc0.c,v 1.5 2015/10/25 21:44:16 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: nouveau_engine_fifo_nvc0.c,v 1.6 2017/02/27 20:29:00 riastradh Exp $"); #include <core/client.h> #include <core/handle.h> @@ -448,11 +448,15 @@ nvc0_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 << nvc0_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));