After rewriting powerpc atomic we decided to commit at the constraint

that for _ptr operations, when not used directly with uintptr_t, we
needed to manually cast.

Use the cast on the _ptr version, where it actually wasn't (please note
that i386 doesn't get it right, while amd64 doesn't seem to compile
cfi neither in LINT, that is why it doesn't fail).

Reported by:	sbruno
This commit is contained in:
Attilio Rao 2011-05-13 15:09:35 +00:00
parent bceb221f78
commit 3f8fdcfde3

View file

@ -145,7 +145,8 @@ cfi_devopen(struct cdev *dev, int oflags, int devtype, struct thread *td)
sc = dev->si_drv1;
/* We allow only 1 open. */
if (!atomic_cmpset_acq_ptr(&sc->sc_opened, NULL, td->td_proc))
if (!atomic_cmpset_acq_ptr((uintptr_t *)&sc->sc_opened,
(uintptr_t)NULL, (uintptr_t)td->td_proc))
return (EBUSY);
return (0);
}