From 33bf70a759aa57406c48aced579e21391e36caf8 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 19 Jan 2008 22:31:04 +0000 Subject: [PATCH] 2008-01-19 Robert Millan Get rid of confusing function (superceeded by `grub_ieee1275_get_integer_property') * include/grub/ieee1275/ieee1275.h (grub_ieee1275_decode_int_4): Remove prototype. * kern/ieee1275/ieee1275.c (grub_ieee1275_decode_int_4): Remove function. * term/ieee1275/ofconsole.c (grub_ofconsole_init): Avoid use of grub_ieee1275_decode_int_4(), by obtaining integer properties directly in native endianess from grub_ieee1275_get_integer_property(). --- ChangeLog | 12 ++++++++++++ include/grub/ieee1275/ieee1275.h | 1 - kern/ieee1275/ieee1275.c | 10 ---------- term/ieee1275/ofconsole.c | 17 ++++++----------- 4 files changed, 18 insertions(+), 22 deletions(-) diff --git a/ChangeLog b/ChangeLog index dfec837ce..4c9bc34bc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2008-01-19 Robert Millan + + Get rid of confusing function (superceeded by + `grub_ieee1275_get_integer_property') + * include/grub/ieee1275/ieee1275.h (grub_ieee1275_decode_int_4): Remove + prototype. + * kern/ieee1275/ieee1275.c (grub_ieee1275_decode_int_4): Remove + function. + * term/ieee1275/ofconsole.c (grub_ofconsole_init): Avoid use of + grub_ieee1275_decode_int_4(), by obtaining integer properties directly + in native endianess from grub_ieee1275_get_integer_property(). + 2008-01-19 Robert Millan * kern/powerpc/ieee1275/openfw.c (grub_halt): Issue "power-off" diff --git a/include/grub/ieee1275/ieee1275.h b/include/grub/ieee1275/ieee1275.h index 57285d801..94e8151f8 100644 --- a/include/grub/ieee1275/ieee1275.h +++ b/include/grub/ieee1275/ieee1275.h @@ -90,7 +90,6 @@ extern void EXPORT_FUNC(grub_ieee1275_set_flag) (enum grub_ieee1275_flag flag); -grub_uint32_t EXPORT_FUNC(grub_ieee1275_decode_int_4) (unsigned char *p); int EXPORT_FUNC(grub_ieee1275_finddevice) (char *name, grub_ieee1275_phandle_t *phandlep); int EXPORT_FUNC(grub_ieee1275_get_property) (grub_ieee1275_phandle_t phandle, diff --git a/kern/ieee1275/ieee1275.c b/kern/ieee1275/ieee1275.c index 69233ccd4..1769c0ab0 100644 --- a/kern/ieee1275/ieee1275.c +++ b/kern/ieee1275/ieee1275.c @@ -26,16 +26,6 @@ -/* FIXME is this function needed? */ -grub_uint32_t -grub_ieee1275_decode_int_4 (unsigned char *p) -{ - grub_uint32_t val = (*p++ << 8); - val = (val + *p++) << 8; - val = (val + *p++) << 8; - return (val + *p); -} - int grub_ieee1275_finddevice (char *name, grub_ieee1275_phandle_t *phandlep) { diff --git a/term/ieee1275/ofconsole.c b/term/ieee1275/ofconsole.c index 845f198fd..f11d476e3 100644 --- a/term/ieee1275/ofconsole.c +++ b/term/ieee1275/ofconsole.c @@ -313,7 +313,6 @@ grub_ofconsole_refresh (void) static grub_err_t grub_ofconsole_init (void) { - unsigned char data[4]; grub_ssize_t actual; int col; @@ -323,20 +322,16 @@ grub_ofconsole_init (void) if (! grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_BROKEN_OUTPUT)) grub_ieee1275_interpret ("output-device output", 0); - if (grub_ieee1275_get_property (grub_ieee1275_chosen, "stdout", data, - sizeof data, &actual) - || actual != sizeof data) + if (grub_ieee1275_get_integer_property (grub_ieee1275_chosen, "stdout", &stdout_ihandle, + sizeof stdout_ihandle, &actual) + || actual != sizeof stdout_ihandle) return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "Cannot find stdout"); - stdout_ihandle = grub_ieee1275_decode_int_4 (data); - - if (grub_ieee1275_get_property (grub_ieee1275_chosen, "stdin", data, - sizeof data, &actual) - || actual != sizeof data) + if (grub_ieee1275_get_integer_property (grub_ieee1275_chosen, "stdin", &stdin_ihandle, + sizeof stdin_ihandle, &actual) + || actual != sizeof stdin_ihandle) return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "Cannot find stdin"); - stdin_ihandle = grub_ieee1275_decode_int_4 (data); - /* Initialize colors. */ for (col = 0; col < 7; col++) grub_ieee1275_set_color (stdout_ihandle, col, colors[col].red,