From patchwork Sat Jan 17 00:56:53 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1557 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768611504; bh=iWJQyVAxDEBF3op59HdeupOoeF4Ip2iU0hAEiIo0JZU=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=ZEjSqvzpXkTctK7JhrEjvWRZLQbnswinJX1HjIRuKkx4oOHrOfjV88lGvvUEQ1Yob foUC+iDyT+gtN1E+pUOLwIfiKT88XtLESgOPXXt91LxSQriPxzuUpBK2dt27xEzKDq qyx7mlZsMY/rvraMjJBjyRyduITLWaciMHGM/FnFwxbC+0hjsg7wDpgqFKzPc0F+tZ nn3Jq871DlRMDZkg6uiFgn1ksKPIxwWTJyyVz5Cag9ycVf2sinTHOLtwTiqsZbT6u3 W8ah8Emvewkm7nvr/I5+A6V71VCQjV/Do2j9LferJrxxpuWJJ/OvInZC3CnFDbwGA+ 2CF2hfT0IshxA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id BB140693E9 for ; Fri, 16 Jan 2026 17:58:24 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id XC7OX_P3n-T6 for ; Fri, 16 Jan 2026 17:58:24 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768611504; bh=iWJQyVAxDEBF3op59HdeupOoeF4Ip2iU0hAEiIo0JZU=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=ZEjSqvzpXkTctK7JhrEjvWRZLQbnswinJX1HjIRuKkx4oOHrOfjV88lGvvUEQ1Yob foUC+iDyT+gtN1E+pUOLwIfiKT88XtLESgOPXXt91LxSQriPxzuUpBK2dt27xEzKDq qyx7mlZsMY/rvraMjJBjyRyduITLWaciMHGM/FnFwxbC+0hjsg7wDpgqFKzPc0F+tZ nn3Jq871DlRMDZkg6uiFgn1ksKPIxwWTJyyVz5Cag9ycVf2sinTHOLtwTiqsZbT6u3 W8ah8Emvewkm7nvr/I5+A6V71VCQjV/Do2j9LferJrxxpuWJJ/OvInZC3CnFDbwGA+ 2CF2hfT0IshxA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A9A5E693E0 for ; Fri, 16 Jan 2026 17:58:24 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768611503; bh=YbhVgcOJ/hgxEkuxD6tI9NVuFvxoR67zf+ZwK/Crkww=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ryW0yrHSnacq08H64zb6fo2WyCGSJCb/ehHHmcwXHrbdW/DiwsCC9gsxGe3Kjp+WD cQtc+2vHWAjW8PhwpFA6Amzn3yW9SqFNxaumfY/5AXtdcPpdiMQZ0Me1pP7HKPcKM9 gcSFmuB7Mtw0ziiTE1OLM2M+ivk0j7qZJxizT0jnrsYGLTubEsC/9yZfneAwr6hmkm v0zV6k8DF02+rF0rXhotnN5iYURLeMKBASSLUlIp7NYoG1SCnHaWIA/epjWJDyVUP+ mnD+Jms5kT9GYmnjcQxLaTnEu91DuL8ioav858BgRa/s180wkg85YgRkJV2DYSs8fr JvRFTCzN6w/1g== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 1DB1C693E0; Fri, 16 Jan 2026 17:58:23 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id ee7g6l1Sclza; Fri, 16 Jan 2026 17:58:23 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768611497; bh=raKb6aa7iVz5BCotmvIDOiC2kzcDk2r1nC95wygwZaY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=D2zi8SjW2y8PvjJrpe/M0ea4LWLOxp+0tlxC1OrjrFdiz9JxvFpTEQtsNxnN7avRa 3rTNe60N5i4+4YIVAD5W7IjObpbihJbklTZn3NkXolkBKHPvskJ/IXP5Ka0zDO8FG2 6gBNlbOEzUHxs4pQ5dryM4ggk7Lf7HjShd93oysnoCB9HSYYRAYuNuAdCJZLVSmJc5 NRRPWuXtUyDCkiGGxqAorl2Ryu0rqQd3iPdEs2O9sPGh8b7GiPQiwNS42ccmwD+tPi eXWGmxkBcfrApcGuR0+TYutkcgtMBtUPccwcAxwXwKAbY4UFkCx9bRsuuaeEkT/AIu ZMgGTUmHyQhhw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 36635693D7; Fri, 16 Jan 2026 17:58:17 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Fri, 16 Jan 2026 17:56:53 -0700 Message-ID: <20260117005702.1684841-16-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260117005702.1684841-1-sjg@u-boot.org> References: <20260117005702.1684841-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: GNU5KMFA2QYIHGKWXX3BPRJ7EAXNTBGY X-Message-ID-Hash: GNU5KMFA2QYIHGKWXX3BPRJ7EAXNTBGY X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 15/18] video: truetype: Remove redundant store.cur field List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass The store.cur field is used to separately save xcur_frac and ycur, but these are already saved as part of store.ctx since console_tt_ctx contains vidconsole_ctx which has these fields. Additionally, the restore code is buggy - it sets com->xcur_frac and com->ycur, then immediately overwrites them with *ctx = store.ctx. Remove the redundant field and simplify the save/restore functions. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- drivers/video/console_truetype.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/drivers/video/console_truetype.c b/drivers/video/console_truetype.c index 2ab4f7dcb25..7b1540b6c40 100644 --- a/drivers/video/console_truetype.c +++ b/drivers/video/console_truetype.c @@ -253,11 +253,9 @@ struct console_tt_priv { * struct console_tt_store - Format used for save/restore of entry information * * @ctx: Per-client context - * @cur: Current cursor position */ struct console_tt_store { struct console_tt_ctx ctx; - struct pos_info cur; }; static int console_truetype_set_row(struct udevice *dev, uint row, int clr) @@ -1172,7 +1170,6 @@ static int truetype_ctx_dispose(struct udevice *dev, void *ctx) static int truetype_entry_save(struct udevice *dev, struct abuf *buf) { struct console_tt_ctx *ctx = vidconsole_ctx(dev); - struct vidconsole_ctx *com = &ctx->com; struct console_tt_store store; const uint size = sizeof(store); @@ -1183,8 +1180,6 @@ static int truetype_entry_save(struct udevice *dev, struct abuf *buf) return log_msg_ret("sav", -ENOMEM); store.ctx = *ctx; - store.cur.xpos_frac = com->xcur_frac; - store.cur.ypos = com->ycur; memcpy(abuf_data(buf), &store, size); return 0; @@ -1193,16 +1188,12 @@ static int truetype_entry_save(struct udevice *dev, struct abuf *buf) static int truetype_entry_restore(struct udevice *dev, struct abuf *buf) { struct console_tt_ctx *ctx = vidconsole_ctx(dev); - struct vidconsole_ctx *com = &ctx->com; struct console_tt_store store; if (xpl_phase() <= PHASE_SPL) return -ENOSYS; memcpy(&store, abuf_data(buf), sizeof(store)); - - com->xcur_frac = store.cur.xpos_frac; - com->ycur = store.cur.ypos; *ctx = store.ctx; return 0;