From d576c60fd2f8392ecbb5566b3703fa5dac85d9e9 Mon Sep 17 00:00:00 2001 From: attilio Date: Fri, 13 May 2011 15:09:35 +0000 Subject: [PATCH] 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 --- sys/dev/cfi/cfi_dev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/cfi/cfi_dev.c b/sys/dev/cfi/cfi_dev.c index d6357531ab8..9b232bd064e 100644 --- a/sys/dev/cfi/cfi_dev.c +++ b/sys/dev/cfi/cfi_dev.c @@ -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); } -- 2.45.2