From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756558Ab1ALWC0 (ORCPT ); Wed, 12 Jan 2011 17:02:26 -0500 Received: from ozlabs.org ([203.10.76.45]:58769 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754420Ab1ALWCY (ORCPT ); Wed, 12 Jan 2011 17:02:24 -0500 From: Rusty Russell To: Randy Dunlap Subject: Re: [PATCH] module: fix build when DEBUGP is defined Date: Thu, 13 Jan 2011 08:32:15 +1030 User-Agent: KMail/1.13.5 (Linux/2.6.35-24-generic; KDE/4.5.1; i686; ; ) Cc: lkml , akpm References: <20110111172153.e43e03b8.randy.dunlap@oracle.com> <201101121918.21079.rusty@rustcorp.com.au> <4D2DD629.1080701@oracle.com> In-Reply-To: <4D2DD629.1080701@oracle.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201101130832.16210.rusty@rustcorp.com.au> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 13 Jan 2011 02:56:17 am Randy Dunlap wrote: > On 01/12/11 00:48, Rusty Russell wrote: > > On Wed, 12 Jan 2011 11:51:53 am Randy Dunlap wrote: > >> From: Randy Dunlap > >> > >> Fix module loader build when DEBUGP is defined. > >> Fixes build error & warning: > >> > >> kernel/module.c:1910: error: 'name' undeclared (first use in this function) > >> kernel/module.c:2567: warning: format '%lx' expects type 'long unsigned int', but argument 2 has type 'Elf64_Addr' > >> > >> Signed-off-by: Randy Dunlap > >> Cc: Rusty Russell > >> --- > >> kernel/module.c | 4 ++-- > >> 1 file changed, 2 insertions(+), 2 deletions(-) > >> > >> --- linux-next-20110111.orig/kernel/module.c > >> +++ linux-next-20110111/kernel/module.c > >> @@ -1907,7 +1907,7 @@ static void layout_sections(struct modul > >> || strstarts(sname, ".init")) > >> continue; > >> s->sh_entsize = get_offset(mod, &mod->core_size, s, i); > >> - DEBUGP("\t%s\n", name); > >> + DEBUGP("\t%s\n", sname); > >> } > >> switch (m) { > >> case 0: /* executable */ > >> @@ -2563,7 +2563,7 @@ static int move_module(struct module *mo > >> memcpy(dest, (void *)shdr->sh_addr, shdr->sh_size); > >> /* Update sh_addr to point to copy in image. */ > >> shdr->sh_addr = (unsigned long)dest; > >> - DEBUGP("\t0x%lx %s\n", > >> + DEBUGP("\t0x%llx %s\n", > >> shdr->sh_addr, info->secstrings + shdr->sh_name); > > > > This will break on 32-bit. We really need a cast to long here :( > > Really? I built it on i386 and x86_64 (successfully). shdr->sh_addr is 32 bit, not a long long. You should get a warning. Rusty.