]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - arch/powerpc/kernel/fadump.c
powerpc: Correct DSCR during TM context switch
[karo-tx-linux.git] / arch / powerpc / kernel / fadump.c
index 02667744fbb55c4ddbbd9eb22a208136fd2c1c29..742694c1d85238fe380e4ceecd7443506bb8d0b7 100644 (file)
@@ -55,9 +55,9 @@ int crash_mem_ranges;
 int __init early_init_dt_scan_fw_dump(unsigned long node,
                        const char *uname, int depth, void *data)
 {
-       __be32 *sections;
+       const __be32 *sections;
        int i, num_sections;
-       unsigned long size;
+       int size;
        const int *token;
 
        if (depth != 1 || strcmp(uname, "rtas") != 0)
@@ -646,7 +646,7 @@ static int __init fadump_build_cpu_notes(const struct fadump_mem_struct *fdm)
                }
                /* Lower 4 bytes of reg_value contains logical cpu id */
                cpu = reg_entry->reg_value & FADUMP_CPU_ID_MASK;
-               if (!cpumask_test_cpu(cpu, &fdh->cpu_online_mask)) {
+               if (fdh && !cpumask_test_cpu(cpu, &fdh->cpu_online_mask)) {
                        SKIP_TO_NEXT_CPU(reg_entry);
                        continue;
                }
@@ -663,9 +663,11 @@ static int __init fadump_build_cpu_notes(const struct fadump_mem_struct *fdm)
        }
        fadump_final_note(note_buf);
 
-       pr_debug("Updating elfcore header (%llx) with cpu notes\n",
+       if (fdh) {
+               pr_debug("Updating elfcore header (%llx) with cpu notes\n",
                                                        fdh->elfcorehdr_addr);
-       fadump_update_elfcore_header((char *)__va(fdh->elfcorehdr_addr));
+               fadump_update_elfcore_header((char *)__va(fdh->elfcorehdr_addr));
+       }
        return 0;
 
 error_out: