From a9fe0c3e7ca48afa50d6a0db99fa91e7282d73d8 Mon Sep 17 00:00:00 2001 From: Gururaja Hebbar K R Date: Thu, 7 Aug 2008 13:13:27 +0530 Subject: [PATCH] common/cmd_load.c - Minor code & Coding Style cleanup - os_data_header Variable is a carry over feature & unused. So removed all instance of this variable - Minor Code Style Update Signed-off-by: Gururaja Hebbar Acked-by: Jean-Christophe PLAGNIOL-VILLARD --- common/cmd_load.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/common/cmd_load.c b/common/cmd_load.c index 1b75a7b5ec..ab167f5ab8 100644 --- a/common/cmd_load.c +++ b/common/cmd_load.c @@ -424,7 +424,6 @@ write_record (char *buf) #define untochar(x) ((int) (((x) - SPACE) & 0xff)) extern int os_data_count; -extern int os_data_header[8]; static void set_kerm_bin_mode(unsigned long *); static int k_recv(void); @@ -631,11 +630,6 @@ void send_nack (int n) } -/* os_data_* takes an OS Open image and puts it into memory, and - puts the boot header in an array named os_data_header - - if image is binary, no header is stored in os_data_header. -*/ void (*os_data_init) (void); void (*os_data_char) (char new_char); static int os_data_state, os_data_state_saved; @@ -643,25 +637,28 @@ int os_data_count; static int os_data_count_saved; static char *os_data_addr, *os_data_addr_saved; static char *bin_start_address; -int os_data_header[8]; + static void bin_data_init (void) { os_data_state = 0; os_data_count = 0; os_data_addr = bin_start_address; } + static void os_data_save (void) { os_data_state_saved = os_data_state; os_data_count_saved = os_data_count; os_data_addr_saved = os_data_addr; } + static void os_data_restore (void) { os_data_state = os_data_state_saved; os_data_count = os_data_count_saved; os_data_addr = os_data_addr_saved; } + static void bin_data_char (char new_char) { switch (os_data_state) { @@ -671,6 +668,7 @@ static void bin_data_char (char new_char) break; } } + static void set_kerm_bin_mode (unsigned long *addr) { bin_start_address = (char *) addr; @@ -686,16 +684,19 @@ void k_data_init (void) k_data_escape = 0; os_data_init (); } + void k_data_save (void) { k_data_escape_saved = k_data_escape; os_data_save (); } + void k_data_restore (void) { k_data_escape = k_data_escape_saved; os_data_restore (); } + void k_data_char (char new_char) { if (k_data_escape) { -- 2.30.2