Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp113285rdg; Wed, 11 Oct 2023 23:43:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGKohcF3Q2WtR5Yb+XfZrWtKmk4HorE3kY4mktPPzm80IkLGZod//YaYq1UwcNDMOIBWUu2 X-Received: by 2002:a17:902:f541:b0:1c4:13cd:b85f with SMTP id h1-20020a170902f54100b001c413cdb85fmr24806759plf.5.1697092997411; Wed, 11 Oct 2023 23:43:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697092997; cv=none; d=google.com; s=arc-20160816; b=cf19fGiJWQtgXFRy1xHQLn2fnDFL1U6wCMm/EcjsbfHCUy2Txq6wtxX7Uac5gTRsJ3 k5qdgvw3pR7Kyb2A5wfOCPVzWGjafb6fOHdm3SRbrSOyWQPTIQRwJW+Xad6J/J1HyhHt H29GR3mdCYVtTMznlr/YAp3PNObEBGsXCFhYWhrNpRx0aTh5m2r76Fyv+2BfESVpybB8 iCCHTOqFfNbpAj1Q4mUlh85YdJsU75rx7++EGsD7Xr5GYyWme7EW3pc2ZlHhTTimpARO DgLhBM0w7QTAZX1ZaeRQc4nUVbJIkkOXk3hHkjBqyOjW8LYKERvYLWQZlIDIMf2mm3AV q6dg== 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:from; bh=+Sx1x42UmLXQyg7VCwWcrYHa8lBglXzKaKcHQBJ7thU=; fh=o8Wp60O6t9aGNhRKrDSNhfZE8Iko7nroMui1s7mpLf8=; b=XtQ5GPkWAOwckIasttZWYWW6oFckJCaPaiZS69+IH/PXjmFZfsos5Nly6faE0gr07p t2XW6WU/4MBfnwkOj7s5Ko62Rm8C+42ohol6wtQ0qb7nTlbXrDH6xTEvwUz63ercM3KC b8ncukDVLV+pj+N7cDOALwuEoJlPsmbvSgxqjrQu6PPYlLYif1p06u4quTzq6pMlWwm+ tVojNlKua5gbxnX5EZg8MnSxtDmZyspuyUtzbgtqm9XuJ9dPlhlcvRxVlMP3dP91VEap awkWTqjXPpFv7kLk4/3j9tjgSwa7PIUwMnek75MiDb9U7dnltaiFFQrtE+8ABnwGURkB 0q4g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id a10-20020a170902ecca00b001ae40e07fb0si1633339plh.216.2023.10.11.23.43.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 23:43:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id A42BA8213F1B; Wed, 11 Oct 2023 23:43:16 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347083AbjJLGnO (ORCPT + 99 others); Thu, 12 Oct 2023 02:43:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55936 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347082AbjJLGnL (ORCPT ); Thu, 12 Oct 2023 02:43:11 -0400 Received: from muru.com (muru.com [72.249.23.125]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D36CFBE for ; Wed, 11 Oct 2023 23:43:09 -0700 (PDT) Received: from hillo.muru.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTP id 44A428107; Thu, 12 Oct 2023 06:43:08 +0000 (UTC) From: Tony Lindgren To: Greg Kroah-Hartman , Petr Mladek , Steven Rostedt , John Ogness , Sergey Senozhatsky Cc: Jiri Slaby , linux-kernel@vger.kernel.org Subject: [PATCH 2/2] printk: Constify name for add_preferred_console() Date: Thu, 12 Oct 2023 09:42:57 +0300 Message-ID: <20231012064300.50221-2-tony@atomide.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231012064300.50221-1-tony@atomide.com> References: <20231012064300.50221-1-tony@atomide.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 11 Oct 2023 23:43:16 -0700 (PDT) While adding a preferred console handling for serial_core for serial port hardware based device addressing, Jiri suggested we constify name for add_preferred_console(). The name gets copied anyways. This allows serial core to add a preferred console using serial drv->dev_name without copying it. Note that constifying options causes changes all over the place because of struct console for match(). Suggested-by: Jiri Slaby Reviewed-by: Petr Mladek Signed-off-by: Tony Lindgren --- Changes since v2: - Rebase after fixing patch 1/2 the const char *name mismerge Changes since v1: - Updated to apply on the const short idx change - Separated out of the serial core related patches, the serial core changes still need some more changes for preferred console usage - Added Reviewed-by from Petr from the serial core thread --- include/linux/console.h | 2 +- kernel/printk/printk.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/linux/console.h b/include/linux/console.h --- a/include/linux/console.h +++ b/include/linux/console.h @@ -340,7 +340,7 @@ enum con_flush_mode { CONSOLE_REPLAY_ALL, }; -extern int add_preferred_console(char *name, const short idx, char *options); +extern int add_preferred_console(const char *name, const short idx, char *options); extern void console_force_preferred_locked(struct console *con); extern void register_console(struct console *); extern int unregister_console(struct console *); diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c @@ -2404,7 +2404,7 @@ static void set_user_specified(struct console_cmdline *c, bool user_specified) console_set_on_cmdline = 1; } -static int __add_preferred_console(char *name, const short idx, char *options, +static int __add_preferred_console(const char *name, const short idx, char *options, char *brl_options, bool user_specified) { struct console_cmdline *c; @@ -2521,7 +2521,7 @@ __setup("console=", console_setup); * commonly to provide a default console (ie from PROM variables) when * the user has not supplied one. */ -int add_preferred_console(char *name, const short idx, char *options) +int add_preferred_console(const char *name, const short idx, char *options) { return __add_preferred_console(name, idx, options, NULL, false); } -- 2.42.0