Received: by 2002:a05:7412:40d:b0:e2:908c:2ebd with SMTP id 13csp252410rdf; Tue, 21 Nov 2023 01:24:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IGWMnZZhI0dn84zvJLDkAogqd50c736bEU55c/dll6j4ZrVT2mqUkZEMl2MGRWpj/YqzI2P X-Received: by 2002:a17:902:d48c:b0:1cf:6453:b24c with SMTP id c12-20020a170902d48c00b001cf6453b24cmr4019794plg.42.1700558684815; Tue, 21 Nov 2023 01:24:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700558684; cv=none; d=google.com; s=arc-20160816; b=i/RknlpyNKMmbxmfqwvnynsaDeUpmoGPzA/Ll6x7XegyzE4TYXAgc72KqOMCd82Yu6 iai3BY7w9KGvbm5ivmNm9okTrZdvNAQMRLH+k9tLTTLYLhLSj7GE+dDuzvcm0wxwwrwm FFuFseZeb8NAz9QNFZuQtEbgtCTouS48Af/gtDR2NVDIqMU5L86ZJSIZ0vOoD4tmndqe sXspLfCbSd4rFk11QPhBAGEbJgwPoEzrM8HtmofdUk/lyuReKjofDrpw/KjoSp/pHPx1 OQPt3hM34rR01la6UbVNr7WX6xzjmbOa8mhXtTVE8cKNBh99CaKha68xRjYcdo0j2ODR mlOA== 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=wvLp515WlkKSxgz4EcojMHP2LHEp3Hof8pNOk2uKYj4=; fh=Omeij3RQJitYcv5r7VTxN+idsQHibM7jPsz6z3jqTjA=; b=g98eT8Mgh18PMw5FzoDCKCxBiO3Glk7e64r2gyhBRW7+azinIkpizKOVMSlLnkNFpo Jang95RtWaC2LTw4x08SSy64sRs7+MVIlCHZXw7zuXds9nFh+U3HCWB1ftcDVYC0fz4F aFo9YEs/44Tqu3Dpq05JkA593+UzbpyX1OA6Up3/fpA9MFz6bmM3d6tWXJuGp/zjlLpw +qru7vJxeLhMWD734fpLYUM1nR1dsxjKiCEi3LVHFpahRShyA3K6F8IJeOj0FgSfZa7V e63hZqqpLjgiB0wE1HBJIreH5S3Dg0QLAZLlbkmHu0ajOYsijQQRuoq0ESgndTvKH6TH Jtwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GUk3Q4Mv; 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 b3-20020a170902d50300b001cc54cc2fe3si9941677plg.398.2023.11.21.01.24.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 01:24:44 -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=GUk3Q4Mv; 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 7575A80E879A; Tue, 21 Nov 2023 01:24: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 S233517AbjKUJYc (ORCPT + 99 others); Tue, 21 Nov 2023 04:24:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58508 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233647AbjKUJYK (ORCPT ); Tue, 21 Nov 2023 04:24:10 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B2944198C for ; Tue, 21 Nov 2023 01:23:37 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 84493C43391; Tue, 21 Nov 2023 09:23:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700558616; bh=1JqdGOcikIPraOhThJZ+ThwFEn9EMyadPHMefXFawKA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GUk3Q4MvpshxkULe4lihbL6fp+6TMQE2/jtMr44SuJZ4LsOSpjitlpSNDxWxryXBy S4leJUUt9h8blyDWxlpADZz2Wa0wuUJ9jQgyrSGrVywVDWmEVOnkpshjg6JGNkjJHm mpS9NIvi0zMTNdFEKoE3pwQDZB0ALDHfKHvkCn+GfJMRcZL5KJCchRW4i/yQxfNU06 Y2E2OixT655d+J+FJ2V6EPCdHDqgbA0kE+Uz375JLkTXB1C8nlvuvqpsWdYfrV+NWM fGnS0Mar/blbmEdtbwmgaSi5clQ4DxA6E4GEV/V4WvTOKnfbYsgw4N+U9nY89rJ6Wc euopvwHEcIOJg== 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 17/17] tty: srmcons: make 'str_cr' const and non-array Date: Tue, 21 Nov 2023 10:22:58 +0100 Message-ID: <20231121092258.9334-18-jirislaby@kernel.org> X-Mailer: git-send-email 2.42.1 In-Reply-To: <20231121092258.9334-1-jirislaby@kernel.org> References: <20231121092258.9334-1-jirislaby@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,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]); Tue, 21 Nov 2023 01:24:42 -0800 (PST) 'str_cr' contains a single character: \n. There is no need to declare it as array. Declare it as a variable, make it const and pass a pointer to it to callback_puts(). Signed-off-by: Jiri Slaby (SUSE) Cc: Richard Henderson Cc: Ivan Kokshaysky Cc: Matt Turner Cc: linux-alpha@vger.kernel.org --- arch/alpha/kernel/srmcons.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/alpha/kernel/srmcons.c b/arch/alpha/kernel/srmcons.c index c6b821afbfd3..a6cff61706b5 100644 --- a/arch/alpha/kernel/srmcons.c +++ b/arch/alpha/kernel/srmcons.c @@ -91,7 +91,7 @@ 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"; + static const char str_cr = '\r'; size_t c; srmcons_result result; @@ -119,7 +119,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, &str_cr, 1); if (result.bits.c > 0) need_cr = false; } -- 2.42.1