From: Nolen Johnson Date: Mon, 10 Jul 2023 00:44:39 +0000 (-0400) Subject: Revert "[DNM] [TMP] HACK: Disable log level from being set" X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9bd7c48d8abb0f31ab47b0056de56e69e9f7fea3;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git Revert "[DNM] [TMP] HACK: Disable log level from being set" This reverts commit 698e5846f704891f3e704989a268ed3ab3d9f463. Reason: Pushed with the merge - whoops. Change-Id: I8b786467483492e7b5a416b44d929ad21b5e1163 --- diff --git a/init/main.c b/init/main.c index 0adbbf79d961..cc8df92d7206 100644 --- a/init/main.c +++ b/init/main.c @@ -216,6 +216,25 @@ static int __init quiet_kernel(char *str) early_param("debug", debug_kernel); early_param("quiet", quiet_kernel); +static int __init loglevel(char *str) +{ + int newlevel; + + /* + * Only update loglevel value when a correct setting was passed, + * to prevent blind crashes (when loglevel being set to 0) that + * are quite hard to debug + */ + if (get_option(&str, &newlevel)) { + console_loglevel = newlevel; + return 0; + } + + return -EINVAL; +} + +early_param("loglevel", loglevel); + /* Change NUL term back to "=", to make "param" the whole string. */ static int __init repair_env_string(char *param, char *val, const char *unused, void *arg)