]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
s390/boot: Use boot_printk() instead of sclp_early_printk()
authorHeiko Carstens <hca@linux.ibm.com>
Wed, 4 Sep 2024 09:39:29 +0000 (11:39 +0200)
committerHeiko Carstens <hca@linux.ibm.com>
Sat, 7 Sep 2024 15:12:43 +0000 (17:12 +0200)
Consistently use boot_printk() everywhere instead of sclp_early_printk() at
some places. For some places it was required (e.g. als.c), in order to stay
in code compiled for the same architecture level, for other places it is
not obvious why sclp_early_printk() was used instead of
decompressor_printk().

Given that the whole decompressor code is compiled for the same
architecture level, there is no requirement left to use different
printk functions.

Reviewed-by: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
arch/s390/boot/als.c
arch/s390/boot/ipl_parm.c
arch/s390/boot/kaslr.c
arch/s390/boot/physmem_info.c
arch/s390/boot/startup.c

index efb6caa89e03bacc512fc8544fb11d6f22624787..11e0c3d5dbc8c143f68363b85fd093472d5aaf87 100644 (file)
 
 static unsigned long als[] = { FACILITIES_ALS };
 
-static void u16_to_hex(char *str, u16 val)
-{
-       int i, num;
-
-       for (i = 1; i <= 4; i++) {
-               num = (val >> (16 - 4 * i)) & 0xf;
-               if (num >= 10)
-                       num += 7;
-               *str++ = '0' + num;
-       }
-       *str = '\0';
-}
-
-static void print_machine_type(void)
-{
-       static char mach_str[80] = "Detected machine-type number: ";
-       char type_str[5];
-       struct cpuid id;
-
-       get_cpu_id(&id);
-       u16_to_hex(type_str, id.machine);
-       strcat(mach_str, type_str);
-       strcat(mach_str, "\n");
-       sclp_early_printk(mach_str);
-}
-
 static void u16_to_decimal(char *str, u16 val)
 {
        int div = 1;
@@ -72,8 +46,7 @@ void print_missing_facilities(void)
                         * z/VM adds a four character prefix.
                         */
                        if (strlen(als_str) > 70) {
-                               strcat(als_str, "\n");
-                               sclp_early_printk(als_str);
+                               boot_printk("%s\n", als_str);
                                *als_str = '\0';
                        }
                        u16_to_decimal(val_str, i * BITS_PER_LONG + j);
@@ -81,16 +54,18 @@ void print_missing_facilities(void)
                        first = 0;
                }
        }
-       strcat(als_str, "\n");
-       sclp_early_printk(als_str);
+       boot_printk("%s\n", als_str);
 }
 
 static void facility_mismatch(void)
 {
-       sclp_early_printk("The Linux kernel requires more recent processor hardware\n");
-       print_machine_type();
+       struct cpuid id;
+
+       get_cpu_id(&id);
+       boot_printk("The Linux kernel requires more recent processor hardware\n");
+       boot_printk("Detected machine-type number: %4x\n", id.machine);
        print_missing_facilities();
-       sclp_early_printk("See Principles of Operations for facility bits\n");
+       boot_printk("See Principles of Operations for facility bits\n");
        disabled_wait();
 }
 
index 1773b72a6a7bc3627e76f0ee4acd51dacc9b7621..557462e62cd737625b9554e9b97a2c5f8bf028a7 100644 (file)
@@ -215,7 +215,7 @@ static void check_cleared_facilities(void)
 
        for (i = 0; i < ARRAY_SIZE(als); i++) {
                if ((stfle_fac_list[i] & als[i]) != als[i]) {
-                       sclp_early_printk("Warning: The Linux kernel requires facilities cleared via command line option\n");
+                       boot_printk("Warning: The Linux kernel requires facilities cleared via command line option\n");
                        print_missing_facilities();
                        break;
                }
index bd3bf5ef472df2503c427e86b2f650c51f5469e3..f864d2bff7754eaeb87e651077632b7afda02b45 100644 (file)
@@ -32,7 +32,7 @@ struct prng_parm {
 static int check_prng(void)
 {
        if (!cpacf_query_func(CPACF_KMC, CPACF_KMC_PRNG)) {
-               sclp_early_printk("KASLR disabled: CPU has no PRNG\n");
+               boot_printk("KASLR disabled: CPU has no PRNG\n");
                return 0;
        }
        if (cpacf_query_func(CPACF_PRNO, CPACF_PRNO_TRNG))
index d87a95ff3418712cb591a14efe035c859efb5911..1d131a81cb8be9737837adb1bb264f6a88f76cf5 100644 (file)
@@ -210,7 +210,7 @@ static void die_oom(unsigned long size, unsigned long align, unsigned long min,
                    total_mem, total_reserved_mem,
                    total_mem > total_reserved_mem ? total_mem - total_reserved_mem : 0);
        print_stacktrace(current_frame_address());
-       sclp_early_printk("\n\n -- System halted\n");
+       boot_printk("\n\n -- System halted\n");
        disabled_wait();
 }
 
index 80fad3c08378f9df9a0d961d8223b4e9d438748f..f8f9dbf88d9a8940fad7b59d36fa1bcc11bfdbfa 100644 (file)
@@ -39,10 +39,7 @@ struct machine_info machine;
 
 void error(char *x)
 {
-       sclp_early_printk("\n\n");
-       sclp_early_printk(x);
-       sclp_early_printk("\n\n -- System halted");
-
+       boot_printk("\n\n%s\n\n -- System halted", x);
        disabled_wait();
 }