Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1690824rwb; Fri, 23 Sep 2022 17:20:04 -0700 (PDT) X-Google-Smtp-Source: AMsMyM57Fc/AMZRP84nldggbX3cejgxYL8t3MlyaO1FMyPNiLJfhzc6ebt3o5xQrJmw39rtz3hTt X-Received: by 2002:a17:907:a43:b0:77b:ba98:d2f with SMTP id be3-20020a1709070a4300b0077bba980d2fmr9563570ejc.270.1663978804081; Fri, 23 Sep 2022 17:20:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663978804; cv=none; d=google.com; s=arc-20160816; b=B4OT/LAa9Aq0LUdR5EpPb5HQTCanw7rXafaAX6UK0O/kmjae8Xmf1ZsB3bmOxE+wEJ 3ivDAo/yBO0E5mxn/6007TlXbpyZ3e2Kis37QhxWKnA2/cciLF8DY1CCHgj+CeX3SWpI qY+xGcmRvtUDw+ohcty4MK2Oz0w1a6rlGJWfOKBDuiGlYsFwEuEFYnKFk/ndWQdOPbJm dIig7PB77By7g1Ow0TbN+/c9zyax4McFqyrY8kLgN4RZbtId4RPUYoTXGvkHZ67sKDVi 49YTnhlX5LK6SXHKrkt7GOk4hgNsDdsM4n+SHx7WZn4SLOSWahTMfcAoeFqWpEWvy6IR W8jg== 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=wFxBj/7Cwv+l8jbrElsJozenhe25KvbQeObQTTb9s44=; b=ltWT/5151YuTnNQ8xVepMEjEJyybJH6BbKAhnyGJnNMZWVOGpA10SWBLpxTKYOsDWQ U2DdqU9tR+3If98b12Gl6qDQ1QudntxcKT6EkPgpMAc4PXWExPKYDfIDRKfskbFzKjnw 2QjLM3F2lyzvhZFDoT58YSDgJdFHbQ6c1Pg6+FHMvlUTpA6bXkCHQYBvpA99PSsvYx53 XphF8cCdM4PNdDGankJyGNf18jZBu49uOfiJoOQf3F5qUZRGhKzFys2I9dsAfgxYWAaH sZNNnCsUT4aVamkG1SNk0iFttkNWTiznAG0A7kL76VIrHPaZ4k3QmbnJnTrDuWng5v0J lkwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=PtZbcifW; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=jgRrlrJt; 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 o11-20020a170906974b00b00779017c0aeasi12056730ejy.595.2022.09.23.17.19.37; Fri, 23 Sep 2022 17:20:04 -0700 (PDT) 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=PtZbcifW; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=jgRrlrJt; 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 S233068AbiIXAFf (ORCPT + 99 others); Fri, 23 Sep 2022 20:05:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54734 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232977AbiIXAFL (ORCPT ); Fri, 23 Sep 2022 20:05:11 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50704A00FF for ; Fri, 23 Sep 2022 17:05:06 -0700 (PDT) From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1663977903; 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=wFxBj/7Cwv+l8jbrElsJozenhe25KvbQeObQTTb9s44=; b=PtZbcifWrYlUJnCh/nYiLHegyU3pOQE2MzDRtKEPyugn+iUtdN+2p7gUFn3KBAXMnqUEcw DNgrwSVspJQ6PQZaIGIobyjWFoQZ/2D67xRIVYll6LrryVbWhD/L7FLz21J2NA3T2iN80F ADWD1shpEyJchkZX2zKKPa47vbJFVlGO4ntUvscBZc8y4QSrysIEMqwguJW72yyEkbQG9x ZyB6Bwtx6qmSBhFet5QMz+Wp43C2H9OW7qCsPDqnSylYuUH9AwQydTX/WJ7/JPommRXGdZ kjNpQ9mjgM/52KOf2hQkTF281W0uT5QcmTYHuQWyTYBpZWFlVuI0u1DFUoqX3Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1663977903; 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=wFxBj/7Cwv+l8jbrElsJozenhe25KvbQeObQTTb9s44=; b=jgRrlrJtt6YEu8bhuqsaWVwwoyDhFmY7chaNEhatxeXIUF8tw2Jxk30J0Z69TzMiDx09jO PC65BfeYfKkZMfCw== To: Petr Mladek Cc: Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org, Greg Kroah-Hartman Subject: [PATCH printk 13/18] printk: Move buffer size defines Date: Sat, 24 Sep 2022 02:10:49 +0206 Message-Id: <20220924000454.3319186-14-john.ogness@linutronix.de> In-Reply-To: <20220924000454.3319186-1-john.ogness@linutronix.de> References: <20220924000454.3319186-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. Signed-off-by: Thomas Gleixner Signed-off-by: John Ogness --- include/linux/console.h | 14 ++++++++++++++ include/linux/printk.h | 2 -- kernel/printk/printk.c | 8 -------- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/include/linux/console.h b/include/linux/console.h index dc0df9d9e7d9..3bb5bc62e154 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 + +/* The maximum size for a dropped text message */ +#define DROPPED_TEXT_MAX 64 +#else +#define CONSOLE_LOG_MAX 0 +#define DROPPED_TEXT_MAX 0 +#endif + +/* The maximum size of an 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 7e6d1cd34452..65e9903d066f 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c @@ -433,12 +433,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 - /* the maximum size allowed to be reserved for a record */ #define LOG_LINE_MAX (CONSOLE_LOG_MAX - PREFIX_MAX) @@ -2343,8 +2337,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 #define prb_read_valid(rb, seq, r) false -- 2.30.2