Skip to content

Commit dc71555

Browse files
committed
s390/boot: Use boot_printk() instead of sclp_early_printk()
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>
1 parent bfda610 commit dc71555

File tree

5 files changed

+12
-40
lines changed

5 files changed

+12
-40
lines changed

arch/s390/boot/als.c

Lines changed: 8 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -11,32 +11,6 @@
1111

1212
static unsigned long als[] = { FACILITIES_ALS };
1313

14-
static void u16_to_hex(char *str, u16 val)
15-
{
16-
int i, num;
17-
18-
for (i = 1; i <= 4; i++) {
19-
num = (val >> (16 - 4 * i)) & 0xf;
20-
if (num >= 10)
21-
num += 7;
22-
*str++ = '0' + num;
23-
}
24-
*str = '\0';
25-
}
26-
27-
static void print_machine_type(void)
28-
{
29-
static char mach_str[80] = "Detected machine-type number: ";
30-
char type_str[5];
31-
struct cpuid id;
32-
33-
get_cpu_id(&id);
34-
u16_to_hex(type_str, id.machine);
35-
strcat(mach_str, type_str);
36-
strcat(mach_str, "\n");
37-
sclp_early_printk(mach_str);
38-
}
39-
4014
static void u16_to_decimal(char *str, u16 val)
4115
{
4216
int div = 1;
@@ -72,25 +46,26 @@ void print_missing_facilities(void)
7246
* z/VM adds a four character prefix.
7347
*/
7448
if (strlen(als_str) > 70) {
75-
strcat(als_str, "\n");
76-
sclp_early_printk(als_str);
49+
boot_printk("%s\n", als_str);
7750
*als_str = '\0';
7851
}
7952
u16_to_decimal(val_str, i * BITS_PER_LONG + j);
8053
strcat(als_str, val_str);
8154
first = 0;
8255
}
8356
}
84-
strcat(als_str, "\n");
85-
sclp_early_printk(als_str);
57+
boot_printk("%s\n", als_str);
8658
}
8759

8860
static void facility_mismatch(void)
8961
{
90-
sclp_early_printk("The Linux kernel requires more recent processor hardware\n");
91-
print_machine_type();
62+
struct cpuid id;
63+
64+
get_cpu_id(&id);
65+
boot_printk("The Linux kernel requires more recent processor hardware\n");
66+
boot_printk("Detected machine-type number: %4x\n", id.machine);
9267
print_missing_facilities();
93-
sclp_early_printk("See Principles of Operations for facility bits\n");
68+
boot_printk("See Principles of Operations for facility bits\n");
9469
disabled_wait();
9570
}
9671

arch/s390/boot/ipl_parm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ static void check_cleared_facilities(void)
215215

216216
for (i = 0; i < ARRAY_SIZE(als); i++) {
217217
if ((stfle_fac_list[i] & als[i]) != als[i]) {
218-
sclp_early_printk("Warning: The Linux kernel requires facilities cleared via command line option\n");
218+
boot_printk("Warning: The Linux kernel requires facilities cleared via command line option\n");
219219
print_missing_facilities();
220220
break;
221221
}

arch/s390/boot/kaslr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ struct prng_parm {
3232
static int check_prng(void)
3333
{
3434
if (!cpacf_query_func(CPACF_KMC, CPACF_KMC_PRNG)) {
35-
sclp_early_printk("KASLR disabled: CPU has no PRNG\n");
35+
boot_printk("KASLR disabled: CPU has no PRNG\n");
3636
return 0;
3737
}
3838
if (cpacf_query_func(CPACF_PRNO, CPACF_PRNO_TRNG))

arch/s390/boot/physmem_info.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ static void die_oom(unsigned long size, unsigned long align, unsigned long min,
210210
total_mem, total_reserved_mem,
211211
total_mem > total_reserved_mem ? total_mem - total_reserved_mem : 0);
212212
print_stacktrace(current_frame_address());
213-
sclp_early_printk("\n\n -- System halted\n");
213+
boot_printk("\n\n -- System halted\n");
214214
disabled_wait();
215215
}
216216

arch/s390/boot/startup.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,7 @@ struct machine_info machine;
3939

4040
void error(char *x)
4141
{
42-
sclp_early_printk("\n\n");
43-
sclp_early_printk(x);
44-
sclp_early_printk("\n\n -- System halted");
45-
42+
boot_printk("\n\n%s\n\n -- System halted", x);
4643
disabled_wait();
4744
}
4845

0 commit comments

Comments
 (0)