Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp3005450rdh; Mon, 27 Nov 2023 04:37:43 -0800 (PST) X-Google-Smtp-Source: AGHT+IF4w+xS8lG2kcbdsu0OB4QizSp/5GXPcaQ+iovfQveV85MvNHN1TFuF1XnGACBnTVKF/aQ7 X-Received: by 2002:a17:90b:38d2:b0:285:b99a:a92d with SMTP id nn18-20020a17090b38d200b00285b99aa92dmr4057816pjb.32.1701088663545; Mon, 27 Nov 2023 04:37:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701088663; cv=none; d=google.com; s=arc-20160816; b=1CyaXc3j0f/kPZ7sVQU0xOxV2XwgSUEfa7ri8pCtVm08uOVEpknd3l2xxYAt8IjWn9 FDKmjYKZ0sfjpkgCu2YrxrkIjfGOEzfmUhvV2w3qUqvgvYPT2MhmK8TUmdG/GRx/FuEN LXibYxoFctYw1zf046FWJxRY7bU19ihGKJ8/N92oEk2mulMW68y83kgo+WKBlaDqXOCV ywWCYKpHy4MoAejbIuUyZScGGO21t/jgyJk5/oOu92WU9okKhl2s3ZDb1LvO7JDGC8T2 53RJ1Wk9AuGh9WzU1eYc7miAopYHg5CMhykxDpbYuo/GPNUJJqBaD1ir9vzz7XL5y39/ hS7w== 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 :dkim-signature; bh=YllHLmrTAo9qgcgpCvz3I5eUZIHIp0ptlXIFr6b+7+E=; fh=Omeij3RQJitYcv5r7VTxN+idsQHibM7jPsz6z3jqTjA=; b=yKRH5/MUxQb0qMADXl4N83D/Kw3f0WUYxmKRkldN0nSqDmIVhvQhmpCTuaCsYNxJSs BHZ0wwRr6g13A23fOdFwTBtQ8TyPjdFTvQIBbz00Th9afkdOCKOQfed3YnP8KmNZs1zm l/dN9gHlLr+auq1MRZtCVNjivzzPtECNfcfp0uHqrVttO73zZIKH2icuEf2VYk8upbto e8EBZyB6HihnVtBxeJbKyuSvygBuzraTsySCz/JqHrzKOgZDEo9Wu+gmWMYh5+N3vsJ7 h823/+xP9F2Qs2p1JOC8Xgx0Kh9jgiMLnNj5KnwrKiOSopEey6fdQGsTcZZOF46g53lA nbCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DfiiKcF7; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id j10-20020a17090a31ca00b00285940c5d8dsi6893310pjf.81.2023.11.27.04.37.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Nov 2023 04:37:43 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DfiiKcF7; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 741C3805ECE8; Mon, 27 Nov 2023 04:37:41 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233183AbjK0Mha (ORCPT + 99 others); Mon, 27 Nov 2023 07:37:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233358AbjK0MhZ (ORCPT ); Mon, 27 Nov 2023 07:37:25 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 810951AE for ; Mon, 27 Nov 2023 04:37:25 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 66801C433CA; Mon, 27 Nov 2023 12:37:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701088645; bh=YEcN7xVfBtrK+FblMlBykMvweHvzn9kzb4wK1dvK3OA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DfiiKcF7wg6jSD089smxUC6qcRrqWjYR9e97Uxy/bWCbylV6UdyFen/ls5Q0t33OB VEXTl9ShFBx2CFvV8VoRjmlN3TNC/O/5r1fufng6Bx07DQbqeuGR5u0K+CFWfsgeZD o6jQwXWxWB9bUcpxKGVQyAQ/TdkOJ7PKEQniLAlBZQC1EGDPAQwiALmdcNelwwhM9g c2oRKnN6jFwX7ctFqnqnT45gLXnyoTifbPJaV0gxafnlJnLXXmxMREZFhLQi9H/zAa r03By8tvaykNobPbwXuGiDzHN7rYY4EtVSUtx8tMIlKcv4plPWLbg/FuGLQzOsFLUp 5nFj0HnYGqqSg== From: "Jiri Slaby (SUSE)" To: gregkh@linuxfoundation.org Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, "Jiri Slaby (SUSE)" , Richard Henderson , Ivan Kokshaysky , Matt Turner , linux-alpha@vger.kernel.org Subject: [PATCH 5/5] tty: srmcons: remove 'str_cr' and use string directly Date: Mon, 27 Nov 2023 13:37:13 +0100 Message-ID: <20231127123713.14504-5-jirislaby@kernel.org> X-Mailer: git-send-email 2.42.1 In-Reply-To: <20231127123713.14504-1-jirislaby@kernel.org> References: <20231127123713.14504-1-jirislaby@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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]); Mon, 27 Nov 2023 04:37:41 -0800 (PST) 'str_cr' contains a single character: \r. There is no need to declare it as array. Instead, pass the character (as a string) to callback_puts() directly. This ensures the string is in proper .rodata (const) section and makes the code more obvious. Signed-off-by: Jiri Slaby (SUSE) Cc: Richard Henderson Cc: Ivan Kokshaysky Cc: Matt Turner Cc: linux-alpha@vger.kernel.org --- Notes: [v2] pass "\r" directly to callback_puts() as Richard suggests spell correct \r in the commit log as Ilpo noticed arch/alpha/kernel/srmcons.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/alpha/kernel/srmcons.c b/arch/alpha/kernel/srmcons.c index c6b821afbfd3..42deea53beab 100644 --- a/arch/alpha/kernel/srmcons.c +++ b/arch/alpha/kernel/srmcons.c @@ -91,7 +91,6 @@ srmcons_receive_chars(struct timer_list *t) static void srmcons_do_write(struct tty_port *port, const char *buf, int count) { - static char str_cr[1] = "\r"; size_t c; srmcons_result result; @@ -119,7 +118,7 @@ srmcons_do_write(struct tty_port *port, const char *buf, int count) } while (need_cr) { - result.as_long = callback_puts(0, str_cr, 1); + result.as_long = callback_puts(0, "\r", 1); if (result.bits.c > 0) need_cr = false; } -- 2.42.1