Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp3840469rdh; Tue, 28 Nov 2023 05:27:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IG3rEw4ri7ePcYd5tKX2p764cA/0qjDWIma1BiVHtLbJccN+2LglfoM/rjqjmolC/YNxWsG X-Received: by 2002:a05:6a20:938b:b0:18b:ec94:deed with SMTP id x11-20020a056a20938b00b0018bec94deedmr14633440pzh.45.1701178031810; Tue, 28 Nov 2023 05:27:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701178031; cv=none; d=google.com; s=arc-20160816; b=bh5rggOyTdv7O7coVt0Kwsq+YFEj9DkL5xp1SLNjZJ5SMudNGNp/EtLXR9KbXgLfHV JEIYLhpWgJVKeY1jM7CHsGkXFOpx477/dWvVNJ0ellk9T3yLQ1Qysh2ubquoJqjGkKZF WsBZr6cVzL8V/1yvvve6auYLqMaoLwBcyqmqnzF+pOttUEbLvSmnbif5XWSq1lG+AruR Be6arcUIWhKev2vrM25H8t58N6605UOoZoy3SET+jp3Wty1cPvSDl01MAKxZZys+fTGf u4RnGBLZEruNDrW7IdQEdgPH6v+rDpaM35e26CrVJiKgr9U3JwZuEMnmmvvB9F7rvTmt ww9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:message-id:in-reply-to :subject:cc:to:from:date:dkim-signature; bh=ecqmnvFZs+OVeC4gT3JhqX89xFD0+Bw2yDNA8kKQj8o=; fh=B7Ra8udzJy7+ibtVz6HSQZnUKNiPgoZ517VjZEqUKhM=; b=YztEBtZXkcrl1bQ4htttW95PlAced8ClVTTYtMhSOd+Z2Nm/boo/qhit9BM7qTNzw0 a8kKRSorznJlwgbuuY7ll7VlRwrDCxB6QFq6oSCyKLafVVi1NTccamytBKDmDLcScZ1z vLWl4EN41e1IVTtDd3qgYNVwUTpDJ6fQKKZ4SEwX1yiJoVTNf87VJHO00G3ZgCKGEjrS iVKQofUHpvVfDtb0QodhIYkoUk4WHjMfhkBGxFCZkfdMY3ICqA/T8gaed3EH04FEUEp9 3IfLtcbyokvQSpeUVWteYPDHe9o9371ELRDW+X2U3unHu9UxbsHfLJ1Ik8HH4jBHSDLc 49Ig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=CYfPrrrU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id t3-20020a635343000000b005bdb6daee0dsi12187309pgl.303.2023.11.28.05.27.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 05:27:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=CYfPrrrU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id AF42080D0CF6; Tue, 28 Nov 2023 05:27:09 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345987AbjK1N0z (ORCPT + 99 others); Tue, 28 Nov 2023 08:26:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59274 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345442AbjK1N0p (ORCPT ); Tue, 28 Nov 2023 08:26:45 -0500 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 95D4DDA; Tue, 28 Nov 2023 05:26:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1701178009; x=1732714009; h=date:from:to:cc:subject:in-reply-to:message-id: references:mime-version; bh=tLbRwq2xR2Tx+fbyLv9fv7ObAEEUF1xBEik8fPi4U0E=; b=CYfPrrrUCOu1dfvpzGMnee3jTZEluWMTvSaMkTHWhuIqqgqX8wXt53ou psKh/RY2Yy0DnLGzKxyUw5730hKWqOxuN0bVQ0EM4WQLtlI+fILTLqaDb 3k1AvWAr29Nr4/ZnEMhF4Vk7LBmTcUnMuqN1rUFpfEBdt0s2A8RkhW0G+ RNQ9x2dJvPF6M8FmdU2OlpQ6JACRSe+arqHgaXsKTnYtpxZWpQqEDNJqq W+PiBTWRVMXgnSlo42tFk2RU/S58BtVwzXE2EmQ5aHTV83dcU6i6la5Zg 1NGEek0U7NEDz5Th+Lp+cZQeGYTA3A2x5/3CvVcjHxEua2PjTOXxCbxTV w==; X-IronPort-AV: E=McAfee;i="6600,9927,10907"; a="372296191" X-IronPort-AV: E=Sophos;i="6.04,233,1695711600"; d="scan'208";a="372296191" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Nov 2023 05:26:24 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10907"; a="912430966" X-IronPort-AV: E=Sophos;i="6.04,233,1695711600"; d="scan'208";a="912430966" Received: from haslam-mobl1.ger.corp.intel.com ([10.252.43.79]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Nov 2023 05:26:22 -0800 Date: Tue, 28 Nov 2023 15:26:20 +0200 (EET) From: =?ISO-8859-15?Q?Ilpo_J=E4rvinen?= To: "Jiri Slaby (SUSE)" cc: gregkh@linuxfoundation.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Richard Henderson , Ivan Kokshaysky , Matt Turner , linux-alpha@vger.kernel.org Subject: Re: [PATCH 5/5] tty: srmcons: remove 'str_cr' and use string directly In-Reply-To: <20231127123713.14504-5-jirislaby@kernel.org> Message-ID: References: <20231127123713.14504-1-jirislaby@kernel.org> <20231127123713.14504-5-jirislaby@kernel.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="8323329-240685859-1701177984=:1797" X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email 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 (morse.vger.email [0.0.0.0]); Tue, 28 Nov 2023 05:27:09 -0800 (PST) This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-240685859-1701177984=:1797 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 8BIT On Mon, 27 Nov 2023, Jiri Slaby (SUSE) wrote: > '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; > } > Reviewed-by: Ilpo J?rvinen -- i. --8323329-240685859-1701177984=:1797--