From owner-svn-src-all@freebsd.org Sat Oct 31 02:27:37 2015 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 EFB4DA2173A; Sat, 31 Oct 2015 02:27:36 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-yk0-x22c.google.com (mail-yk0-x22c.google.com [IPv6:2607:f8b0:4002:c07::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A939212FE; Sat, 31 Oct 2015 02:27:36 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by ykek133 with SMTP id k133so94240341yke.2; Fri, 30 Oct 2015 19:27:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=2p4/N8MI9Vze+8PSgv/ePdVXwe9WUqpgLgVbzqeRKzg=; b=uuR2CpGjEw/xHO4QlUiiEgVZhwSKoxrHfDOMnjYuUnnEl7K+JOecUeEMicPey1M1QH OtYTdZqfimpbKL2flbfQPpCt6tmB/UTMtDpbCE+U4Ckpjml2/7/0vldGvA1Ln35ft3l2 p+f+SDaSw6zL/4hN8io5IP1NNtZpMU0G4uUcJ8um+Q4LTLxEjxFdbE6pn23B3vQRy8AU +gPcOROgICaOrco3KnhaUIj8vouC8mGnLu8182Rm1qoyi0i+i47E18MRvfg4OmIxjNt5 hHZEUx5e2PYeYpoHIp5BN/HNgN6koFava+qOEmo/CZKTPshBl2EIiuzaTyu8pmZNgUL4 pwAA== MIME-Version: 1.0 X-Received: by 10.129.88.87 with SMTP id m84mr8619142ywb.73.1446258455851; Fri, 30 Oct 2015 19:27:35 -0700 (PDT) Received: by 10.37.97.76 with HTTP; Fri, 30 Oct 2015 19:27:35 -0700 (PDT) In-Reply-To: <201510310208.t9V28dIh051810@repo.freebsd.org> References: <201510310208.t9V28dIh051810@repo.freebsd.org> Date: Fri, 30 Oct 2015 19:27:35 -0700 Message-ID: Subject: Re: svn commit: r290221 - head/sys/powerpc/powerpc From: Conrad Meyer To: Justin Hibbits Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 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: Sat, 31 Oct 2015 02:27:37 -0000 Comments inline. On Fri, Oct 30, 2015 at 7:08 PM, Justin Hibbits wrote: > Author: jhibbits > Date: Sat Oct 31 02:08:39 2015 > New Revision: 290221 > URL: https://svnweb.freebsd.org/changeset/base/290221 > > Log: > Print unsigned memory sizes, to handle >2GB RAM on 32-bit powerpc. >... > ============================================================================== > --- head/sys/powerpc/powerpc/machdep.c Sat Oct 31 02:07:30 2015 (r290220) > +++ head/sys/powerpc/powerpc/machdep.c Sat Oct 31 02:08:39 2015 (r290221) > @@ -176,12 +176,12 @@ cpu_startup(void *dummy) > #ifdef PERFMON > perfmon_init(); > #endif > - printf("real memory = %ld (%ld MB)\n", ptoa(physmem), > + printf("real memory = %lu (%lu MB)\n", ptoa(physmem), > ptoa(physmem) / 1048576); Shouldn't this be "real memory = %ju (%lu MB)\n" and (uintmax_t)ptoa(physmem), or it may overflow on >4GB RAM systems? > realmem = physmem; > > if (bootverbose) > - printf("available KVA = %zd (%zd MB)\n", > + printf("available KVA = %zu (%zu MB)\n", > virtual_end - virtual_avail, > (virtual_end - virtual_avail) / 1048576); > > @@ -199,7 +199,7 @@ cpu_startup(void *dummy) > #ifdef __powerpc64__ > printf("0x%016lx - 0x%016lx, %ld bytes (%ld pages)\n", > #else > - printf("0x%08x - 0x%08x, %d bytes (%ld pages)\n", > + printf("0x%08x - 0x%08x, %u bytes (%lu pages)\n", It seems wrong that bytes is only %u here and pages is a %lu. I think bytes should probably be %ju too? What is the type of size1? > #endif > phys_avail[indx], phys_avail[indx + 1] - 1, size1, > size1 / PAGE_SIZE); > @@ -208,7 +208,7 @@ cpu_startup(void *dummy) > > vm_ksubmap_init(&kmi); > > - printf("avail memory = %ld (%ld MB)\n", ptoa(vm_cnt.v_free_count), > + printf("avail memory = %lu (%lu MB)\n", ptoa(vm_cnt.v_free_count), > ptoa(vm_cnt.v_free_count) / 1048576); Same as with the first printf. Best, Conrad