[OPW,kernel,v2,4/4] arch: powerpc: Add timespec to timespec64 conversion
diff mbox

Message ID 1414758146-11906-5-git-send-email-somyaanand214@gmail.com
State New, archived
Headers show

Commit Message

Somya Anand Oct. 31, 2014, 12:22 p.m. UTC
32-bit systems using 'struct timespec' will break in the year 2038,
so we have to replace that code with more appropriate types.

Introducing a local variable of type 'struct timespec64' to update
interface of pstore_info.read in order to support
new pstore_info API.

Signed-off-by: Somya Anand <somyaanand214@gmail.com>
---
 Changes since version 1:
  * Use timespec_to_timespec64 conversion.
  * Reword commit message.

 arch/powerpc/platforms/pseries/nvram.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Comments

Arnd Bergmann Oct. 31, 2014, 4:16 p.m. UTC | #1
On Friday 31 October 2014 17:52:26 Somya Anand wrote:
> 32-bit systems using 'struct timespec' will break in the year 2038,
> so we have to replace that code with more appropriate types.
> 
> Introducing a local variable of type 'struct timespec64' to update
> interface of pstore_info.read in order to support
> new pstore_info API.
> 
> Signed-off-by: Somya Anand <somyaanand214@gmail.com>

Again, the same two bugs you had in the ram.c and efi-pstore.c
files.

	Arnd

Patch
diff mbox

diff --git a/arch/powerpc/platforms/pseries/nvram.c b/arch/powerpc/platforms/pseries/nvram.c
index 11a3b61..a9b0bc1 100644
--- a/arch/powerpc/platforms/pseries/nvram.c
+++ b/arch/powerpc/platforms/pseries/nvram.c
@@ -598,16 +598,17 @@  static int nvram_pstore_write(enum pstore_type_id type,
  * Returns 0 if we've been called before.
  */
 static ssize_t nvram_pstore_read(u64 *id, enum pstore_type_id *type,
-				int *count, struct timespec *time, char **buf,
+				int *count, struct timespec *ts, char **buf,
 				bool *compressed, struct pstore_info *psi)
 {
+	struct timespec64 ts64 = timespec_to_timespec64(ts);
+	struct timespec64 *time = &ts64;
 	struct oops_log_info *oops_hdr;
 	unsigned int err_type, id_no, size = 0;
 	struct nvram_os_partition *part = NULL;
 	char *buff = NULL;
 	int sig = 0;
 	loff_t p;
-
 	read_type++;
 
 	switch (nvram_type_ids[read_type]) {
@@ -635,7 +636,7 @@  static ssize_t nvram_pstore_read(u64 *id, enum pstore_type_id *type,
 		*type = PSTORE_TYPE_PPC_COMMON;
 		*id = PSTORE_TYPE_PPC_COMMON;
 		time->tv_sec = 0;
-		time->tv_nsec = 0;
+		times->tv_nsec = 0;
 		break;
 	default:
 		return 0;