Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Lemh6-0002pS-5i for mharc-grub-devel@gnu.org; Wed, 04 Mar 2009 03:43:12 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Lemh4-0002oN-LF for grub-devel@gnu.org; Wed, 04 Mar 2009 03:43:10 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Lemh4-0002nz-1T for grub-devel@gnu.org; Wed, 04 Mar 2009 03:43:10 -0500 Received: from [199.232.76.173] (port=44005 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lemh3-0002nn-Qs for grub-devel@gnu.org; Wed, 04 Mar 2009 03:43:09 -0500 Received: from [74.93.104.97] (port=49146 helo=sunset.davemloft.net) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Lemh3-0001Ak-0q for grub-devel@gnu.org; Wed, 04 Mar 2009 03:43:09 -0500 Received: from localhost (localhost [127.0.0.1]) by sunset.davemloft.net (Postfix) with ESMTP id C66EA35C04E for ; Wed, 4 Mar 2009 00:42:54 -0800 (PST) Date: Wed, 04 Mar 2009 00:42:54 -0800 (PST) Message-Id: <20090304.004254.206977696.davem@davemloft.net> To: grub-devel@gnu.org From: David Miller X-Mailer: Mew version 6.1 on Emacs 22.1 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: [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 08:43:11 -0000 Many of these warnings are for two reasons: 1) grub_ssize_t is != '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_ihandle_t objects there, but those are of grub_ieee1275_cell_t type, which is uint64_t on sparc64. 2009-03-04 David S. Miller * kern/ieee1275/cmain.c (grub_ieee1275_init): Third arg to grub_ieee1275_get_integer_property is a uint32_t pointer. * kern/ieee1275/init.c (grub_machine_init): Fix type of 'actual'. * kern/ieee1275/openfw.c (grub_children_iterate): Likewise. (grub_devalias_iterate): Likewise. * term/ieee1275/ofconsole.c (grub_ofconsole_init_input): Fix third arg to grub_ieee1275_get_integer_property. (grub_ofconsole_init_output): Likewise. --- kern/ieee1275/cmain.c | 6 +++++- kern/ieee1275/init.c | 2 +- kern/ieee1275/openfw.c | 4 ++-- term/ieee1275/ofconsole.c | 10 ++++++++-- 4 files changed, 16 insertions(+), 6 deletions(-) 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; + grub_ieee1275_finddevice ("/chosen", &grub_ieee1275_chosen); - if (grub_ieee1275_get_integer_property (grub_ieee1275_chosen, "mmu", &grub_ieee1275_mmu, + if (grub_ieee1275_get_integer_property (grub_ieee1275_chosen, "mmu", &val, sizeof grub_ieee1275_mmu, 0) < 0) grub_ieee1275_mmu = 0; + else + grub_ieee1275_mmu = val; grub_ieee1275_find_options (); } diff --git a/kern/ieee1275/init.c b/kern/ieee1275/init.c index d345ba2..27783cc 100644 --- a/kern/ieee1275/init.c +++ b/kern/ieee1275/init.c @@ -213,7 +213,7 @@ void grub_machine_init (void) { char args[256]; - int actual; + grub_ssize_t actual; grub_ieee1275_init (); diff --git a/kern/ieee1275/openfw.c b/kern/ieee1275/openfw.c index e88f3b3..4229c6e 100644 --- a/kern/ieee1275/openfw.c +++ b/kern/ieee1275/openfw.c @@ -53,7 +53,7 @@ grub_children_iterate (char *devpath, char childname[64]; char fullname[64]; struct grub_ieee1275_devalias alias; - int actual; + grub_ssize_t actual; if (grub_ieee1275_get_property (child, "device_type", &childtype, sizeof childtype, &actual)) @@ -86,7 +86,7 @@ grub_devalias_iterate (int (*hook) (struct grub_ieee1275_devalias *alias)) { grub_ieee1275_phandle_t aliases; char aliasname[32]; - int actual; + grub_ssize_t actual; struct grub_ieee1275_devalias alias; if (grub_ieee1275_finddevice ("/aliases", &aliases)) 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, "stdin", &stdin_ihandle, + if (grub_ieee1275_get_integer_property (grub_ieee1275_chosen, "stdin", &val, sizeof stdin_ihandle, &actual) || actual != sizeof stdin_ihandle) return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "Cannot find stdin"); + stdin_ihandle = val; + return 0; } @@ -354,6 +357,7 @@ static grub_err_t grub_ofconsole_init_output (void) { grub_ssize_t actual; + uint32_t val; int col; /* The latest PowerMacs don't actually initialize the screen for us, so we @@ -362,11 +366,13 @@ grub_ofconsole_init_output (void) if (! grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_BROKEN_OUTPUT)) grub_ieee1275_interpret ("output-device output", 0); - if (grub_ieee1275_get_integer_property (grub_ieee1275_chosen, "stdout", &stdout_ihandle, + if (grub_ieee1275_get_integer_property (grub_ieee1275_chosen, "stdout", &val, sizeof stdout_ihandle, &actual) || actual != sizeof stdout_ihandle) return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "Cannot find stdout"); + stdout_ihandle = val; + /* Initialize colors. */ if (! grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_CANNOT_SET_COLORS)) { -- 1.6.1.2.253.ga34a