From owner-svn-src-all@freebsd.org Wed Jan 13 01:17:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8DDC3A6E391 for ; Wed, 13 Jan 2016 01:17:01 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from erouter6.ore.mailhop.org (erouter6.ore.mailhop.org [54.187.213.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6F5731959 for ; Wed, 13 Jan 2016 01:17:01 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from ilsoft.org (unknown [73.34.117.227]) by outbound3.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Wed, 13 Jan 2016 01:15:40 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.14.9) with ESMTP id u0D1Gw7J006134; Tue, 12 Jan 2016 18:16:58 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1452647818.46848.46.camel@freebsd.org> Subject: Re: svn commit: r293775 - head/sys/boot/uboot/lib From: Ian Lepore To: Brooks Davis , Steven Hartland Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Tue, 12 Jan 2016 18:16:58 -0700 In-Reply-To: <20160113010348.GF79262@spindle.one-eyed-alien.net> References: <201601121631.u0CGV7v6074494@repo.freebsd.org> <569582F6.4060108@multiplay.co.uk> <1452644710.46848.31.camel@freebsd.org> <56959D45.7070204@multiplay.co.uk> <20160113010348.GF79262@spindle.one-eyed-alien.net> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2016 01:17:01 -0000 On Wed, 2016-01-13 at 01:03 +0000, Brooks Davis wrote: > On Wed, Jan 13, 2016 at 12:41:41AM +0000, Steven Hartland wrote: > > Was this meant to be a full revert as you now have: > > > > subldr = rounddown2((uintptr_t)_start, KERN_ALIGN); > > > > vs the original: > > > > subldr = rounddown2((uint64_t)(uintptr_t)_start, KERN_ALIGN); > > > > i.e. missing the final conversion to uint64_t? > > The cast through uint64_t isn't allowed by the standard if you want > the > result to be a function pointer. The implementation of rounddown2() > should work fine on an uintptr_t even for fairly radical > implementations. > > -- Brooks _start is a function pointer, but subldr is uint64_t. The cast isn't needed inside the macro invocation because the round-down calculation can't create a larger result than the size of the types involved. -- Ian