Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1LepjB-0003XW-JV for mharc-grub-devel@gnu.org; Wed, 04 Mar 2009 06:57:33 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LepjA-0003WS-0b for grub-devel@gnu.org; Wed, 04 Mar 2009 06:57:32 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Lepj8-0003WG-Kk for grub-devel@gnu.org; Wed, 04 Mar 2009 06:57:30 -0500 Received: from [199.232.76.173] (port=53204 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lepj8-0003WD-92 for grub-devel@gnu.org; Wed, 04 Mar 2009 06:57:30 -0500 Received: from [74.93.104.97] (port=36477 helo=sunset.davemloft.net) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Lepj7-0005yf-Qa for grub-devel@gnu.org; Wed, 04 Mar 2009 06:57:30 -0500 Received: from localhost (localhost [127.0.0.1]) by sunset.davemloft.net (Postfix) with ESMTP id DC3CC35C04E; Wed, 4 Mar 2009 03:57:15 -0800 (PST) Date: Wed, 04 Mar 2009 03:57:15 -0800 (PST) Message-Id: <20090304.035715.179000162.davem@davemloft.net> To: grub-devel@gnu.org, chaac@nic.fi From: David Miller In-Reply-To: <49AE6C58.1030709@nic.fi> References: <20090304.004254.206977696.davem@davemloft.net> <49AE6C58.1030709@nic.fi> X-Mailer: Mew version 6.1 on Emacs 22.1 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Cc: Subject: Re: [PATCH]: Fix several warnings on sparc64. X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Mar 2009 11:57:32 -0000 From: Vesa J=E4=E4skel=E4inen Date: Wed, 04 Mar 2009 13:56:08 +0200 > David Miller wrote: > > Many of these warnings are for two reasons: > > = > > 1) grub_ssize_t is !=3D 'int' on sparc64, and many pieces of code > > try to pass an int pointer in for the final arg of several > > ieee1275 "get property" functions which take a grub_ssize_t > > pointer. > > = > > 2) The third arg to grub_ieee1275_get_integer_property is > > "uint32_t *" but we try passing pointers to grub_ieee1275_ihandl= e_t > > objects there, but those are of grub_ieee1275_cell_t type, > > which is uint64_t on sparc64. > > = > > diff --git a/kern/ieee1275/cmain.c b/kern/ieee1275/cmain.c > > index b5e2ba6..847d9fd 100644 > > --- a/kern/ieee1275/cmain.c > > +++ b/kern/ieee1275/cmain.c > > @@ -157,11 +157,15 @@ grub_ieee1275_find_options (void) > > void > > grub_ieee1275_init (void) > > { > > + uint32_t val; > = > Please use grub_uint32_t instead... (I know..) > = > This same applies to other instances of that same type too... > = > > diff --git a/term/ieee1275/ofconsole.c b/term/ieee1275/ofconsole.c > > index 70fda9a..c24a4c2 100644 > > --- a/term/ieee1275/ofconsole.c > > +++ b/term/ieee1275/ofconsole.c > > @@ -341,12 +341,15 @@ static grub_err_t > > grub_ofconsole_init_input (void) > > { > > grub_ssize_t actual; > > + uint32_t val; > > = > > - if (grub_ieee1275_get_integer_property (grub_ieee1275_chosen, "s= tdin", &stdin_ihandle, > > + if (grub_ieee1275_get_integer_property (grub_ieee1275_chosen, "s= tdin", &val, > > sizeof stdin_ihandle, &actual) > > || actual !=3D sizeof stdin_ihandle) > > return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "Cannot find stdin= "); > > = > > + stdin_ihandle =3D val; > = > Why stdin_ihandle is not in proper type ? Or was there some other rea= son > for this change? A cell is the proper type, but that's 64-bit on sparc. It's actually really a 32-bit integer property, but when it's passed into the firmware via the ieee1275 interfaces it gets pass in 64-bit extended as a cell, so the type is correct.