aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/pseries
diff options
context:
space:
mode:
authorHari Bathini <hbathini@linux.vnet.ibm.com>2015-02-05 14:37:17 -0500
committerMichael Ellerman <mpe@ellerman.id.au>2015-03-22 23:06:11 -0400
commite4a9616c548f67537a8d020a45a327f6a4d583ee (patch)
tree18b7bc5f55294fb9145acb220a1c878392bad81c /arch/powerpc/platforms/pseries
parentf7618299b4ab425956099508cba7b3a39a056d87 (diff)
powerpc/rtas: Make timestamp related code y2038-safe
While we are here, let us make timestamp related code y2038-safe. Suggested-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Hari Bathini <hbathini@linux.vnet.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/platforms/pseries')
-rw-r--r--arch/powerpc/platforms/pseries/nvram.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/arch/powerpc/platforms/pseries/nvram.c b/arch/powerpc/platforms/pseries/nvram.c
index 533807efed61..9f8184175c86 100644
--- a/arch/powerpc/platforms/pseries/nvram.c
+++ b/arch/powerpc/platforms/pseries/nvram.c
@@ -36,10 +36,10 @@ static DEFINE_SPINLOCK(nvram_lock);
36 36
37/* See clobbering_unread_rtas_event() */ 37/* See clobbering_unread_rtas_event() */
38#define NVRAM_RTAS_READ_TIMEOUT 5 /* seconds */ 38#define NVRAM_RTAS_READ_TIMEOUT 5 /* seconds */
39static unsigned long last_unread_rtas_event; /* timestamp */ 39static time64_t last_unread_rtas_event; /* timestamp */
40 40
41#ifdef CONFIG_PSTORE 41#ifdef CONFIG_PSTORE
42unsigned long last_rtas_event; 42time64_t last_rtas_event;
43#endif 43#endif
44 44
45static ssize_t pSeries_nvram_read(char *buf, size_t count, loff_t *index) 45static ssize_t pSeries_nvram_read(char *buf, size_t count, loff_t *index)
@@ -144,9 +144,9 @@ int nvram_write_error_log(char * buff, int length,
144 int rc = nvram_write_os_partition(&rtas_log_partition, buff, length, 144 int rc = nvram_write_os_partition(&rtas_log_partition, buff, length,
145 err_type, error_log_cnt); 145 err_type, error_log_cnt);
146 if (!rc) { 146 if (!rc) {
147 last_unread_rtas_event = get_seconds(); 147 last_unread_rtas_event = ktime_get_real_seconds();
148#ifdef CONFIG_PSTORE 148#ifdef CONFIG_PSTORE
149 last_rtas_event = get_seconds(); 149 last_rtas_event = ktime_get_real_seconds();
150#endif 150#endif
151 } 151 }
152 152
@@ -200,7 +200,7 @@ int clobbering_unread_rtas_event(void)
200{ 200{
201 return (oops_log_partition.index == rtas_log_partition.index 201 return (oops_log_partition.index == rtas_log_partition.index
202 && last_unread_rtas_event 202 && last_unread_rtas_event
203 && get_seconds() - last_unread_rtas_event <= 203 && ktime_get_real_seconds() - last_unread_rtas_event <=
204 NVRAM_RTAS_READ_TIMEOUT); 204 NVRAM_RTAS_READ_TIMEOUT);
205} 205}
206 206