Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp8085365rwb; Wed, 23 Nov 2022 15:22:46 -0800 (PST) X-Google-Smtp-Source: AA0mqf7Mszf5Mzb6ZO+2PbkAzCkiKywdz9pBcZi4NeC9e90B6waNIVDkCS/k8g9IkljaI3boNwZ4 X-Received: by 2002:a63:2c8:0:b0:457:4863:2e85 with SMTP id 191-20020a6302c8000000b0045748632e85mr11353704pgc.6.1669245765900; Wed, 23 Nov 2022 15:22:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669245765; cv=none; d=google.com; s=arc-20160816; b=TWBGnK86hN9aCiyHyjld0FmtcfCwPnxRp/69kRlUOuqlLI6NioY6WKN/C4tDOwJI+F CRTBjJnH+naOuDA/ezAXADbWtHHIuMGD0LlUDOZIOPh/KlRs16fMFrWf0s5cacNMPK7/ z49dX4kjpAUwNXWglWiPLoH+Sll/A3BYjeK4bUbOKfz+dR8xJy3lTm/4YDHVK5RawrYp s/+8+aLN3/XUGtFI7cCdS26RMOwAerR36IRqXyWlDAL3hIr3As0aUwpp4aHZ1xKIuhLx DYthFnWOebfcwToRk6uQOvkyGXXzLO1m4rHqnKjkPc93MOVLIIXkQHx2Ok0rP9Snki6x /c2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:dkim-signature :dkim-signature:from; bh=/iaK6Q3VBEVIk95GUMPiu3drrm6jETQodWaJtL9sezc=; b=tN2A7lDC8RkUaMyYVV7S0Agj1w+1iFX2bdWOPLN+g4ubhOnO72Ew6TOdppaPVK2n7g r2QL3pDr78qWeCyW0mXWRLuW/bfsEYtF/p/c+t0KL5/BwURce/an0sWH65PGQNzWAixo /MkeE83KqkJYkl6le/+pe3RVQSHDRj4U16lJbbcYH1k0dYZxLX0Tyr2Ho7Qfajj2HbK/ 8hiVla5mAllJzbIvWQrapqJiH91TAAkc4HGCf02Y3dqx/AkxDTTkiiSY+cosjTAuJSR5 +eogIn2kn3fob2RLIHaYeFvTSYZdhxx1u6WFXFa5jld/Ju+sMrt6IqVgXYhKVpJWho4r kDAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=RPvCHbze; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cn15-20020a056a00340f00b005726c05d326si15816511pfb.162.2022.11.23.15.22.34; Wed, 23 Nov 2022 15:22:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=RPvCHbze; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229720AbiKWXOQ (ORCPT + 90 others); Wed, 23 Nov 2022 18:14:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229456AbiKWXON (ORCPT ); Wed, 23 Nov 2022 18:14:13 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 48BB49B3B0 for ; Wed, 23 Nov 2022 15:14:12 -0800 (PST) From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1669245250; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/iaK6Q3VBEVIk95GUMPiu3drrm6jETQodWaJtL9sezc=; b=RPvCHbzeTnVF+1dfTWNpp1u2Ja4oUusnLtx0+NH6sMCxYoOR02JlqMlu3LV9oTETqz4j9n t9Wc/t26f4+a2isGNtBY6ZtXYv9rwvZifPRr+uPZTZ/t7tdUF6eIBaLN6S51VLoT14la88 0LplEnL7XKetw/yLNGMg2E5S/M+D2wzXpJucFLxf2w5ma2O2O2DcP1j+NpSWc7I4+q8TXJ NXs2eeNoeJnOYk23Gj56igQeMgwz4zJlv9LW5qk33hmFyG18sYzE0NYjS+/w1X13Z3SWZ4 76uWOnvJA2OcNSdqvW1ig1eiOkLmFlIHsEm2ym5SwmtL1R9J+L5cMliwc7i19A== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1669245250; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/iaK6Q3VBEVIk95GUMPiu3drrm6jETQodWaJtL9sezc=; b=69B7EmoOEwgiqYg29s+3eHdc8AjiAjVWVTXwWTObH4kfEJ8gT1qdFR7VycoxkUJPky/uGu ADMt+2TjjCRTz7DQ== To: Petr Mladek Cc: Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org, Greg Kroah-Hartman Subject: [PATCH printk v2 1/7] printk: Move buffer size defines Date: Thu, 24 Nov 2022 00:19:54 +0106 Message-Id: <20221123231400.614679-2-john.ogness@linutronix.de> In-Reply-To: <20221123231400.614679-1-john.ogness@linutronix.de> References: <20221123231400.614679-1-john.ogness@linutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,INVALID_DATE_TZ_ABSURD, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Thomas Gleixner Move the buffer size defines to console.h in preparation of adding a buffer structure. The new buffer structure will be embedded within struct console. Therefore console.h was chosen as the new home for these defines. Signed-off-by: Thomas Gleixner Signed-off-by: John Ogness --- include/linux/console.h | 14 ++++++++++++++ include/linux/printk.h | 2 -- kernel/printk/printk.c | 4 ---- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/include/linux/console.h b/include/linux/console.h index 9cea254b34b8..799fc3216aad 100644 --- a/include/linux/console.h +++ b/include/linux/console.h @@ -122,6 +122,20 @@ static inline int con_debug_leave(void) #define CM_ERASE (2) #define CM_MOVE (3) +#ifdef CONFIG_PRINTK + +/* The maximum size of a formatted record (i.e. with prefix added per line) */ +#define CONSOLE_LOG_MAX 1024 + +#else + +#define CONSOLE_LOG_MAX 0 + +#endif + +/* The maximum size of a formatted extended record */ +#define CONSOLE_EXT_LOG_MAX 8192 + /* * The interface for a console, or any other device that wants to capture * console messages (printer driver?) diff --git a/include/linux/printk.h b/include/linux/printk.h index 8c81806c2e99..8ef499ab3c1e 100644 --- a/include/linux/printk.h +++ b/include/linux/printk.h @@ -44,8 +44,6 @@ static inline const char *printk_skip_headers(const char *buffer) return buffer; } -#define CONSOLE_EXT_LOG_MAX 8192 - /* printk's without a loglevel use this.. */ #define MESSAGE_LOGLEVEL_DEFAULT CONFIG_MESSAGE_LOGLEVEL_DEFAULT diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c index 9ec101766471..a4854a60e6d8 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c @@ -471,9 +471,6 @@ static struct latched_seq clear_seq = { #define PREFIX_MAX 32 #endif -/* the maximum size of a formatted record (i.e. with prefix added per line) */ -#define CONSOLE_LOG_MAX 1024 - /* the maximum size for a dropped text message */ #define DROPPED_TEXT_MAX 64 @@ -2387,7 +2384,6 @@ static bool __pr_flush(struct console *con, int timeout_ms, bool reset_on_progre #else /* CONFIG_PRINTK */ -#define CONSOLE_LOG_MAX 0 #define DROPPED_TEXT_MAX 0 #define printk_time false -- 2.30.2