Don't cast argument to ffs() to long.

Per discussion on port-alpha, noticed by Robert Elz.
This commit is contained in:
simonb 2002-03-05 09:40:38 +00:00
parent 2246ec4a66
commit 9bcc70fa1d
17 changed files with 38 additions and 38 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: disksubr.c,v 1.5 2002/02/19 17:09:41 wiz Exp $ */
/* $NetBSD: disksubr.c,v 1.6 2002/03/05 09:40:38 simonb Exp $ */
/*
* Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
@ -29,7 +29,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: disksubr.c,v 1.5 2002/02/19 17:09:41 wiz Exp $");
__KERNEL_RCSID(0, "$NetBSD: disksubr.c,v 1.6 2002/03/05 09:40:38 simonb Exp $");
#include <sys/param.h>
#include <sys/buf.h>
@ -168,7 +168,7 @@ setdisklabel(struct disklabel *olp, struct disklabel *nlp, u_long openmask,
dkcksum(nlp) != 0)
return (EINVAL);
while ((i = ffs((long)openmask)) != 0) {
while ((i = ffs(openmask)) != 0) {
i--;
openmask &= ~(1 << i);
if (nlp->d_npartitions <= i)

View File

@ -1,4 +1,4 @@
/* $NetBSD: disksubr.c,v 1.24 2002/02/19 17:09:42 wiz Exp $ */
/* $NetBSD: disksubr.c,v 1.25 2002/03/05 09:40:39 simonb Exp $ */
/*
* Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
@ -29,7 +29,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: disksubr.c,v 1.24 2002/02/19 17:09:42 wiz Exp $");
__KERNEL_RCSID(0, "$NetBSD: disksubr.c,v 1.25 2002/03/05 09:40:39 simonb Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -175,7 +175,7 @@ setdisklabel(olp, nlp, openmask, clp)
dkcksum(nlp) != 0)
return (EINVAL);
while ((i = ffs((long)openmask)) != 0) {
while ((i = ffs(openmask)) != 0) {
i--;
openmask &= ~(1 << i);
if (nlp->d_npartitions <= i)

View File

@ -1,4 +1,4 @@
/* $NetBSD: disksubr.c,v 1.40 2002/02/19 17:09:42 wiz Exp $ */
/* $NetBSD: disksubr.c,v 1.41 2002/03/05 09:40:39 simonb Exp $ */
/*
* Copyright (c) 1994 Christian E. Hopps
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: disksubr.c,v 1.40 2002/02/19 17:09:42 wiz Exp $");
__KERNEL_RCSID(0, "$NetBSD: disksubr.c,v 1.41 2002/03/05 09:40:39 simonb Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -455,7 +455,7 @@ setdisklabel(olp, nlp, openmask, clp)
if (nlp->d_magic != DISKMAGIC || nlp->d_magic2 != DISKMAGIC ||
dkcksum(nlp) != 0)
return (EINVAL);
while ((i = ffs((long)openmask)) != 0) {
while ((i = ffs(openmask)) != 0) {
i--;
openmask &= ~(1 << i);
if (nlp->d_npartitions <= i)

View File

@ -1,4 +1,4 @@
/* $NetBSD: disksubr.c,v 1.12 2002/02/19 17:09:43 wiz Exp $ */
/* $NetBSD: disksubr.c,v 1.13 2002/03/05 09:40:39 simonb Exp $ */
/*
* Copyright (c) 1982, 1986, 1988, 1993
@ -117,7 +117,7 @@ setdisklabel(olp, nlp, openmask, osdep)
if (nlp->d_magic != DISKMAGIC || nlp->d_magic2 != DISKMAGIC ||
dkcksum(nlp) != 0)
return (EINVAL);
while ((i = ffs((long)openmask)) != 0) {
while ((i = ffs(openmask)) != 0) {
i--;
openmask &= ~(1 << i);
if (nlp->d_npartitions <= i)

View File

@ -1,4 +1,4 @@
/* $NetBSD: disksubr.c,v 1.40 2002/02/19 17:09:45 wiz Exp $ */
/* $NetBSD: disksubr.c,v 1.41 2002/03/05 09:40:40 simonb Exp $ */
/*
* Copyright (c) 1982, 1986, 1988 Regents of the University of California.
@ -514,7 +514,7 @@ setdisklabel(olp, nlp, openmask, osdep)
* e.g. Macintosh or (PC) BIOS, will be overwritten.
*/
while ((i = ffs((long)openmask)) != 0) {
while ((i = ffs(openmask)) != 0) {
i--;
openmask &= ~(1 << i);
if (nlp->d_npartitions <= i)

View File

@ -1,4 +1,4 @@
/* $NetBSD: disksubr.c,v 1.9 2002/02/19 17:09:45 wiz Exp $ */
/* $NetBSD: disksubr.c,v 1.10 2002/03/05 09:40:40 simonb Exp $ */
/*
* Copyright (c) 1982, 1986, 1988 Regents of the University of California.
@ -158,7 +158,7 @@ setdisklabel(olp, nlp, openmask, clp)
if (nlp->d_magic != DISKMAGIC || nlp->d_magic2 != DISKMAGIC ||
dkcksum(nlp) != 0)
return (EINVAL);
while ((i = ffs((long)openmask)) != 0) {
while ((i = ffs(openmask)) != 0) {
i--;
openmask &= ~(1 << i);
if (nlp->d_npartitions <= i)

View File

@ -1,4 +1,4 @@
/* $NetBSD: disksubr.c,v 1.22 2002/02/19 17:09:46 wiz Exp $ */
/* $NetBSD: disksubr.c,v 1.23 2002/03/05 09:40:40 simonb Exp $ */
/*
* Copyright (c) 1995 Dale Rahn.
@ -147,7 +147,7 @@ setdisklabel(olp, nlp, openmask, clp)
dkcksum(nlp) != 0)
return (EINVAL);
while ((i = ffs((long)openmask)) != 0) {
while ((i = ffs(openmask)) != 0) {
i--;
openmask &= ~(1 << i);
if (nlp->d_npartitions <= i)

View File

@ -1,4 +1,4 @@
/* $NetBSD: disksubr.c,v 1.8 2002/02/19 17:09:46 wiz Exp $ */
/* $NetBSD: disksubr.c,v 1.9 2002/03/05 09:40:40 simonb Exp $ */
/*
* Copyright (c) 1982, 1986, 1988 Regents of the University of California.
@ -112,7 +112,7 @@ setdisklabel(olp, nlp, openmask, osdep)
if (nlp->d_magic != DISKMAGIC || nlp->d_magic2 != DISKMAGIC ||
dkcksum(nlp) != 0)
return (EINVAL);
while ((i = ffs((long)openmask)) != 0) {
while ((i = ffs(openmask)) != 0) {
i--;
openmask &= ~(1 << i);
if (nlp->d_npartitions <= i)

View File

@ -1,4 +1,4 @@
/* $NetBSD: disksubr.c,v 1.9 2002/02/19 17:09:46 wiz Exp $ */
/* $NetBSD: disksubr.c,v 1.10 2002/03/05 09:40:41 simonb Exp $ */
/*
* Copyright (c) 1982, 1986, 1988 Regents of the University of California.
@ -112,7 +112,7 @@ setdisklabel(olp, nlp, openmask, osdep)
if (nlp->d_magic != DISKMAGIC || nlp->d_magic2 != DISKMAGIC ||
dkcksum(nlp) != 0)
return (EINVAL);
while ((i = ffs((long)openmask)) != 0) {
while ((i = ffs(openmask)) != 0) {
i--;
openmask &= ~(1 << i);
if (nlp->d_npartitions <= i)

View File

@ -1,4 +1,4 @@
/* $NetBSD: disksubr.c,v 1.6 2002/02/19 17:09:46 wiz Exp $ */
/* $NetBSD: disksubr.c,v 1.7 2002/03/05 09:40:41 simonb Exp $ */
/*
* Copyright (c) 1982, 1986, 1988, 1993
@ -119,7 +119,7 @@ setdisklabel(olp, nlp, openmask, osdep)
if (nlp->d_magic != DISKMAGIC || nlp->d_magic2 != DISKMAGIC ||
dkcksum(nlp) != 0)
return (EINVAL);
while ((i = ffs((long)openmask)) != 0) {
while ((i = ffs(openmask)) != 0) {
i--;
openmask &= ~(1 << i);
if (nlp->d_npartitions <= i)

View File

@ -1,4 +1,4 @@
/* $NetBSD: disksubr.c,v 1.21 2002/02/19 17:09:47 wiz Exp $ */
/* $NetBSD: disksubr.c,v 1.22 2002/03/05 09:40:41 simonb Exp $ */
/*
* Copyright (c) 1982, 1986, 1988 Regents of the University of California.
@ -120,7 +120,7 @@ setdisklabel(olp, nlp, openmask, osdep)
if (nlp->d_magic != DISKMAGIC || nlp->d_magic2 != DISKMAGIC ||
dkcksum(nlp) != 0)
return (EINVAL);
while ((i = ffs((long)openmask)) != 0) {
while ((i = ffs(openmask)) != 0) {
i--;
openmask &= ~(1 << i);
if (nlp->d_npartitions <= i)

View File

@ -1,4 +1,4 @@
/* $NetBSD: disksubr.c,v 1.35 2002/02/19 17:09:47 wiz Exp $ */
/* $NetBSD: disksubr.c,v 1.36 2002/03/05 09:40:41 simonb Exp $ */
/*
* Copyright (c) 1982, 1986, 1988 Regents of the University of California.
@ -218,7 +218,7 @@ setdisklabel(olp, nlp, openmask, osdep)
if (nlp->d_magic != DISKMAGIC || nlp->d_magic2 != DISKMAGIC ||
dkcksum(nlp) != 0)
return (EINVAL);
while ((i = ffs((long)openmask)) != 0) {
while ((i = ffs(openmask)) != 0) {
i--;
openmask &= ~(1 << i);
if (nlp->d_npartitions <= i)

View File

@ -1,4 +1,4 @@
/* $NetBSD: disksubr.c,v 1.6 2002/02/19 17:09:48 wiz Exp $ */
/* $NetBSD: disksubr.c,v 1.7 2002/03/05 09:40:41 simonb Exp $ */
/*
* Copyright (c) 2001 Christopher Sekiya
@ -132,7 +132,7 @@ setdisklabel(struct disklabel *olp, struct disklabel *nlp, unsigned long openmas
if (nlp->d_magic != DISKMAGIC || nlp->d_magic2 != DISKMAGIC ||
dkcksum(nlp) != 0)
return (EINVAL);
while ((i = ffs((long)openmask)) != 0) {
while ((i = ffs(openmask)) != 0) {
i--;
openmask &= ~(1 << i);
if (nlp->d_npartitions <= i)

View File

@ -1,4 +1,4 @@
/* $NetBSD: disksubr.c,v 1.32 2002/02/19 17:09:49 wiz Exp $ */
/* $NetBSD: disksubr.c,v 1.33 2002/03/05 09:40:42 simonb Exp $ */
/*
* Copyright (c) 1994, 1995 Gordon W. Ross
@ -162,7 +162,7 @@ setdisklabel(olp, nlp, openmask, clp)
dkcksum(nlp) != 0)
return (EINVAL);
while ((i = ffs((long)openmask)) != 0) {
while ((i = ffs(openmask)) != 0) {
i--;
openmask &= ~(1 << i);
if (nlp->d_npartitions <= i)

View File

@ -1,4 +1,4 @@
/* $NetBSD: disksubr.c,v 1.14 2002/02/19 17:09:49 wiz Exp $ */
/* $NetBSD: disksubr.c,v 1.15 2002/03/05 09:40:42 simonb Exp $ */
/*
* Copyright (c) 1994, 1995 Gordon W. Ross
@ -161,7 +161,7 @@ setdisklabel(olp, nlp, openmask, clp)
dkcksum(nlp) != 0)
return (EINVAL);
while ((i = ffs((long)openmask)) != 0) {
while ((i = ffs(openmask)) != 0) {
i--;
openmask &= ~(1 << i);
if (nlp->d_npartitions <= i)

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_uba.c,v 1.15 1999/01/01 21:43:18 ragge Exp $ */
/* $NetBSD: if_uba.c,v 1.16 2002/03/05 09:40:42 simonb Exp $ */
/*
* Copyright (c) 1982, 1986, 1988 Regents of the University of California.
@ -292,7 +292,7 @@ rcv_xmtbuf(ifw)
register int i;
char *cp;
while ((i = ffs((long)ifw->ifw_xswapd)) != 0) {
while ((i = ffs(ifw->ifw_xswapd)) != 0) {
cp = ifw->ifw_base + i * MCLBYTES;
i--;
ifw->ifw_xswapd &= ~(1<<i);
@ -379,7 +379,7 @@ if_ubaput(ifu, ifw, m)
cc = cp - ifw->ifw_addr;
x = ((cc - ifu->iff_hlen) + MCLBYTES - 1) >> MCLSHIFT;
ifw->ifw_xswapd &= ~xswapd;
while ((i = ffs((long)ifw->ifw_xswapd)) != 0) {
while ((i = ffs(ifw->ifw_xswapd)) != 0) {
i--;
if (i >= x)
break;

View File

@ -1,4 +1,4 @@
/* $NetBSD: disksubr.c,v 1.29 2002/02/19 17:09:44 wiz Exp $ */
/* $NetBSD: disksubr.c,v 1.30 2002/03/05 09:40:42 simonb Exp $ */
/*
* Copyright (c) 1982, 1986, 1988 Regents of the University of California.
@ -158,7 +158,7 @@ setdisklabel(struct disklabel *olp, struct disklabel *nlp,
if (nlp->d_magic != DISKMAGIC || nlp->d_magic2 != DISKMAGIC ||
dkcksum(nlp) != 0)
return (EINVAL);
while ((i = ffs((long)openmask)) != 0) {
while ((i = ffs(openmask)) != 0) {
i--;
openmask &= ~(1 << i);
if (nlp->d_npartitions <= i)