From owner-svn-src-projects@FreeBSD.ORG Fri May 13 15:09:35 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D5C451065677; Fri, 13 May 2011 15:09:35 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C6A038FC0C; Fri, 13 May 2011 15:09:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4DF9ZWW074360; Fri, 13 May 2011 15:09:35 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4DF9Zil074358; Fri, 13 May 2011 15:09:35 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201105131509.p4DF9Zil074358@svn.freebsd.org> From: Attilio Rao Date: Fri, 13 May 2011 15:09:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221840 - projects/largeSMP/sys/dev/cfi X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 May 2011 15:09:35 -0000 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); }