]> pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[POWERPC] pseries: Eliminate global error_log_cnt variable
authorLinas Vepstas <linas@austin.ibm.com>
Thu, 9 Aug 2007 20:56:41 +0000 (06:56 +1000)
committerPaul Mackerras <paulus@samba.org>
Fri, 17 Aug 2007 01:01:52 +0000 (11:01 +1000)
Eliminate the use of error_log_cnt as a global var shared across
different directories.  Pass it as a parameter instead.

Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
----

Respin of earlier patch, with the CONFIG_PSERIES junk removed from the
header file.

 arch/powerpc/kernel/nvram_64.c         |   10 +++++-----
 arch/powerpc/platforms/pseries/rtasd.c |    7 ++++---
 include/asm-powerpc/nvram.h            |    6 ++++--
 3 files changed, 13 insertions(+), 10 deletions(-)
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/powerpc/kernel/nvram_64.c
arch/powerpc/platforms/pseries/rtasd.c
include/asm-powerpc/nvram.h

index 4a4d785a08d31e34fb75bede67a794500e6603ec..0ed31f2204826e2fa68315bd5bfe7be3cf3b10ba 100644 (file)
@@ -38,8 +38,6 @@ static struct nvram_partition * nvram_part;
 static long nvram_error_log_index = -1;
 static long nvram_error_log_size = 0;
 
-extern volatile int error_log_cnt;
-
 struct err_log_info {
        int error_type;
        unsigned int seq_num;
@@ -627,7 +625,8 @@ void __exit nvram_cleanup(void)
  * sequence #: The unique sequence # for each event. (until it wraps)
  * error log: The error log from event_scan
  */
-int nvram_write_error_log(char * buff, int length, unsigned int err_type)
+int nvram_write_error_log(char * buff, int length,
+                          unsigned int err_type, unsigned int error_log_cnt)
 {
        int rc;
        loff_t tmp_index;
@@ -665,7 +664,8 @@ int nvram_write_error_log(char * buff, int length, unsigned int err_type)
  *
  * Reads nvram for error log for at most 'length'
  */
-int nvram_read_error_log(char * buff, int length, unsigned int * err_type)
+int nvram_read_error_log(char * buff, int length,
+                         unsigned int * err_type, unsigned int * error_log_cnt)
 {
        int rc;
        loff_t tmp_index;
@@ -691,7 +691,7 @@ int nvram_read_error_log(char * buff, int length, unsigned int * err_type)
                return rc;
        }
 
-       error_log_cnt = info.seq_num;
+       *error_log_cnt = info.seq_num;
        *err_type = info.error_type;
 
        return 0;
index b802a272bd29f843051c93e8132ccf4fb055a5cd..30925d29bcead9e896c3109177fce633c8c7d883 100644 (file)
@@ -56,7 +56,7 @@ static int full_rtas_msgs = 0;
 /* Stop logging to nvram after first fatal error */
 static int no_more_logging;
 
-volatile int error_log_cnt = 0;
+static int error_log_cnt;
 
 /*
  * Since we use 32 bit RTAS, the physical address of this must be below
@@ -218,7 +218,7 @@ void pSeries_log_error(char *buf, unsigned int err_type, int fatal)
 
        /* Write error to NVRAM */
        if (!no_more_logging && !(err_type & ERR_FLAG_BOOT))
-               nvram_write_error_log(buf, len, err_type);
+               nvram_write_error_log(buf, len, err_type, error_log_cnt);
 
        /*
         * rtas errors can occur during boot, and we do want to capture
@@ -412,7 +412,8 @@ static int rtasd(void *unused)
 
        /* See if we have any error stored in NVRAM */
        memset(logdata, 0, rtas_error_log_max);
-       rc = nvram_read_error_log(logdata, rtas_error_log_max, &err_type);
+       rc = nvram_read_error_log(logdata, rtas_error_log_max,
+                                 &err_type, &error_log_cnt);
 
        if (!rc) {
                if (err_type != ERR_FLAG_ALREADY_LOGGED) {
index f3563e11e260b7162d19b758f24d47dd1de0e956..9877982508bf65753ec6a8c419b350067dd72069 100644 (file)
@@ -63,8 +63,10 @@ struct nvram_partition {
 };
 
 
-extern int nvram_write_error_log(char * buff, int length, unsigned int err_type);
-extern int nvram_read_error_log(char * buff, int length, unsigned int * err_type);
+extern int nvram_write_error_log(char * buff, int length,
+                                        unsigned int err_type, unsigned int err_seq);
+extern int nvram_read_error_log(char * buff, int length,
+                                        unsigned int * err_type, unsigned int *err_seq);
 extern int nvram_clear_error_log(void);
 extern struct nvram_partition *nvram_find_partition(int sig, const char *name);