Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp1848198rwo; Thu, 3 Aug 2023 00:07:00 -0700 (PDT) X-Google-Smtp-Source: APBJJlH/g49LKRlMTnCVj+dyUF8d6Anyh4/BlsHKrGb7Y4Fa1FR2l/g/FMsFyIySzNbsCXRnJBx0 X-Received: by 2002:a17:906:49:b0:993:d5bd:a757 with SMTP id 9-20020a170906004900b00993d5bda757mr7638114ejg.19.1691046419977; Thu, 03 Aug 2023 00:06:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691046419; cv=none; d=google.com; s=arc-20160816; b=XbWaqzsYR+fhnSv8f/LdOXvcgbA8kIOqBzZTSZ3ni8t6n4bAZAYrs/SbmC8C3IPSWV vQ7rH7bdHVS5chuEfYlU6+NSQMPwqU8zG2mbYR+gDnuL9iLwCB31d37MFXgTgUlYdyUb wIQ37TBys6kuhDAYNsclB6iou/+vG0orA2gDM0SSH6a6WFZEdCuuV6+95cJU1hppIlcw z2A+YzbSGzsnIyt5Ea8TCmj97frRLG0+cwbLdHNbPcnB6jcW3AtiQBCWSvMP6GjXZN/v y55miWsayzS8rJpCZA4qebnOv0fLOkq++ZHnrdfNtc9gz5Ll9dhDBJFH/OXTCrMqABob hClQ== 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 :message-id:date:subject:cc:to:from; bh=ECNeO3eE6aB4SG79FSn9VKTC50fmmPg0cVcxByj/7PY=; fh=OI347T4SsLCknln/dVbYihv1rsiP+0HFZcfkwZ8tKAo=; b=UIhdQA5IVmNQMKLbOBjF43YLB62bxgjMRSLy0GsLSI6FlvvlDUaXz4WlLuhIxPY5C0 0yzBu9EhxXQUM1FIbgvf9VhRwRAz4OCtHaZcH8ox5Yr7407kuZSkl4hjlXOTuEKey/px pn6j8mf0SibQ1WyH3oVZ+ifgLmOEr00YJWTHLWBNp5trBf0oCeEGmslinBTFwnrqcuqk LKANZ8f0zSsb8qNJACDcIkzMVQoAUwiPI/Fgg1Xt1QCLOybfySNhTkScbgA/RKhyWjtf MhOqZV5g9KyJ5kKVSVeYGWGd4YEC0YDSjT09nxH+nfKHII0JOUwz6PHqafleedSUuf9t 1DGw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s23-20020a1709066c9700b0099317a3240esi11638149ejr.396.2023.08.03.00.06.32; Thu, 03 Aug 2023 00:06:59 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233475AbjHCGyb (ORCPT + 99 others); Thu, 3 Aug 2023 02:54:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232321AbjHCGy2 (ORCPT ); Thu, 3 Aug 2023 02:54:28 -0400 Received: from mailgw.kylinos.cn (mailgw.kylinos.cn [124.126.103.232]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2CB3F1B2; Wed, 2 Aug 2023 23:54:24 -0700 (PDT) X-UUID: 2769ce3df91a4798816c751763bf786a-20230803 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.28,REQID:9f3df742-4fdc-4895-9502-8cb6f04badb1,IP:5,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:-15,FILE:0,BULK:0,RULE:Release_Ham,ACTIO N:release,TS:-10 X-CID-INFO: VERSION:1.1.28,REQID:9f3df742-4fdc-4895-9502-8cb6f04badb1,IP:5,URL :0,TC:0,Content:0,EDM:0,RT:0,SF:-15,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:-10 X-CID-META: VersionHash:176cd25,CLOUDID:eb21a3d2-cd77-4e67-bbfd-aa4eaace762f,B ulkID:230803145414YEBCW1HE,BulkQuantity:0,Recheck:0,SF:19|44|24|17|102,TC: nil,Content:0,EDM:-3,IP:-2,URL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OS I:0,OSA:0,AV:0,LES:1,SPR:NO,DKR:0,DKP:0 X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR,TF_CID_SPAM_FAS,TF_CID_SPAM_FSD,TF_CID_SPAM_FSI X-UUID: 2769ce3df91a4798816c751763bf786a-20230803 X-User: oushixiong@kylinos.cn Received: from localhost.localdomain [(111.48.58.12)] by mailgw (envelope-from ) (Generic MTA) with ESMTP id 829056476; Thu, 03 Aug 2023 14:54:12 +0800 From: oushixiong To: Greg Kroah-Hartman Cc: Jiri Slaby , =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= , Samuel Thibault , Daniel Vetter , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, oushixiong Subject: [PATCH v4] tty: vt: Remove some repetitive initialization Date: Thu, 3 Aug 2023 14:54:09 +0800 Message-Id: <20230803065409.461031-1-oushixiong@kylinos.cn> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY 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 Members vc_col, vc_rows and vc_size_row of the struct vc_data have been initialized in visual_init(), so it is no longer needed to initialize them in vc_init() again. Signed-off-by: oushixiong Reviewed-by: Jiri Slaby --- v1->v2: - Fix the comment. v2->v3: - Fix the comment again. v3->v4: - Fix the comment one more time. drivers/tty/vt/vt.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c index 1e8e57b45688..cf77011a8f4e 100644 --- a/drivers/tty/vt/vt.c +++ b/drivers/tty/vt/vt.c @@ -140,8 +140,7 @@ EXPORT_SYMBOL(vc_cons); static const struct consw *con_driver_map[MAX_NR_CONSOLES]; static int con_open(struct tty_struct *, struct file *); -static void vc_init(struct vc_data *vc, unsigned int rows, - unsigned int cols, int do_clear); +static void vc_init(struct vc_data *vc, int do_clear); static void gotoxy(struct vc_data *vc, int new_x, int new_y); static void save_cur(struct vc_data *vc); static void reset_terminal(struct vc_data *vc, int do_clear); @@ -1103,7 +1102,7 @@ int vc_allocate(unsigned int currcons) /* return 0 on success */ if (global_cursor_default == -1) global_cursor_default = 1; - vc_init(vc, vc->vc_rows, vc->vc_cols, 1); + vc_init(vc, 1); vcs_make_sysfs(currcons); atomic_notifier_call_chain(&vt_notifier_list, VT_ALLOCATE, ¶m); @@ -3398,16 +3397,10 @@ module_param_named(color, default_color, int, S_IRUGO | S_IWUSR); module_param_named(italic, default_italic_color, int, S_IRUGO | S_IWUSR); module_param_named(underline, default_underline_color, int, S_IRUGO | S_IWUSR); -static void vc_init(struct vc_data *vc, unsigned int rows, - unsigned int cols, int do_clear) +static void vc_init(struct vc_data *vc, int do_clear) { int j, k ; - vc->vc_cols = cols; - vc->vc_rows = rows; - vc->vc_size_row = cols << 1; - vc->vc_screenbuf_size = vc->vc_rows * vc->vc_size_row; - set_origin(vc); vc->vc_pos = vc->vc_origin; reset_vc(vc); @@ -3475,8 +3468,7 @@ static int __init con_init(void) visual_init(vc, currcons, 1); /* Assuming vc->vc_{cols,rows,screenbuf_size} are sane here. */ vc->vc_screenbuf = kzalloc(vc->vc_screenbuf_size, GFP_NOWAIT); - vc_init(vc, vc->vc_rows, vc->vc_cols, - currcons || !vc->vc_sw->con_save_screen); + vc_init(vc, currcons || !vc->vc_sw->con_save_screen); } currcons = fg_console = 0; master_display_fg = vc = vc_cons[currcons].d; -- 2.25.1 No virus found Checked by Hillstone Network AntiVirus