Date: Fri, 13 May 2011 15:09:35 +0000 (UTC) From: Attilio Rao <attilio@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r221840 - projects/largeSMP/sys/dev/cfi Message-ID: <201105131509.p4DF9Zil074358@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: attilio Date: Fri May 13 15:09:35 2011 New Revision: 221840 URL: http://svn.freebsd.org/changeset/base/221840 Log: 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 Modified: projects/largeSMP/sys/dev/cfi/cfi_dev.c Modified: projects/largeSMP/sys/dev/cfi/cfi_dev.c ============================================================================== --- projects/largeSMP/sys/dev/cfi/cfi_dev.c Fri May 13 15:06:35 2011 (r221839) +++ projects/largeSMP/sys/dev/cfi/cfi_dev.c Fri May 13 15:09:35 2011 (r221840) @@ -145,7 +145,8 @@ cfi_devopen(struct cdev *dev, int oflags 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); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201105131509.p4DF9Zil074358>