From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark Rutland Subject: Re: [PATCH 10/12] kexec: arrange for paddr_vmcoreinfo_note() to return phys_addr_t Date: Fri, 29 Apr 2016 16:16:39 +0100 Message-ID: <20160429151639.GC23726@leverpostej> References: <20160428092644.GX19428@n2100.arm.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-doc-owner@vger.kernel.org To: Pratyush Anand Cc: Russell King , linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, Tony Luck , linux-ia64@vger.kernel.org, linux-doc@vger.kernel.org, Pawel Moll , Jonathan Corbet , Ian Campbell , kexec@lists.infradead.org, Fenghua Yu , Haren Myneni , Rob Herring , Eric Biederman , Santosh Shilimkar , Kumar Gala , Vivek Goyal List-Id: devicetree@vger.kernel.org On Fri, Apr 29, 2016 at 08:36:43PM +0530, Pratyush Anand wrote: > > + phys_addr_t vmcore_base = paddr_vmcoreinfo_note(); > > + return sprintf(buf, "%pa %x\n", &vmcore_base, > > Why do we pass &vmcore_base? Shouldn't it be vmcore_base? The %pa* printk format specifiers take the value by reference (as phys_addr_t and friends are not necessarily the same width as a pointer). Per Documentation/printk-formats.txt: Physical addresses types phys_addr_t: %pa[p] 0x01234567 or 0x0123456789abcdef For printing a phys_addr_t type (and its derivatives, such as resource_size_t) which can vary based on build options, regardless of the width of the CPU data path. Passed by reference. So the above prints the value of vmcore_base as expected. Mark.