From patchwork Sat Jan 17 00:56:54 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1558 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=1768611508; bh=/pXSfjHsm+LY/YbsxxojJYVWO48+wlwZknojriv98/I=; 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=R6GLnYgFvi+QRovcSrD1cTZpcY9lUw88VTK7hkiNarnw/jMgTeJ72/ueu/cLJHS/3 YalZxK0SGHesrrQMJR91QY87giJSwPdkCKyC8FOB83Qry+NZUy6k3iwg4zyLJdkBO8 Mqn4k3s8jlQ9MN5bWwib7wBJ7zP6Z5nKOoZ2UK7a337XNLgOl+atMUME1KfIoRXFvI mNhgFZitm5Zzdj6woO2di3/1MUnnPS+oLy5gvnspPj/vaxGBg7HvsigApBJ86emCnC LIcP0xV2kY8izhsJEamQANftBVP+aHkwqCT/uEEuCZNBsCE8+UrqprILJBIrcT9tKW hTp11JJYyBw9w== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 28587693E9 for ; Fri, 16 Jan 2026 17:58:28 -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 REeP2q5_8sH4 for ; Fri, 16 Jan 2026 17:58:28 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768611508; bh=/pXSfjHsm+LY/YbsxxojJYVWO48+wlwZknojriv98/I=; 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=R6GLnYgFvi+QRovcSrD1cTZpcY9lUw88VTK7hkiNarnw/jMgTeJ72/ueu/cLJHS/3 YalZxK0SGHesrrQMJR91QY87giJSwPdkCKyC8FOB83Qry+NZUy6k3iwg4zyLJdkBO8 Mqn4k3s8jlQ9MN5bWwib7wBJ7zP6Z5nKOoZ2UK7a337XNLgOl+atMUME1KfIoRXFvI mNhgFZitm5Zzdj6woO2di3/1MUnnPS+oLy5gvnspPj/vaxGBg7HvsigApBJ86emCnC LIcP0xV2kY8izhsJEamQANftBVP+aHkwqCT/uEEuCZNBsCE8+UrqprILJBIrcT9tKW hTp11JJYyBw9w== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 17E41693E0 for ; Fri, 16 Jan 2026 17:58:28 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768611506; bh=qWSEgXBRGekQ+eLKchauh4dSyEfmI5c4KOjC9w6bnjY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SBd4t5x1XTxeS6VKZlTWipJRbBAIhJbKPwUQFVDjy0uceycEeImVk8lWUXX1h527j rYEQBT9XeAmsiGxJmPqSEAcHdSmmc7yhq4x5OPumeeU/Zm6VpjpWLaAIgJqzJD/MFl +Z2QndMwelRMTU8IuXFWzgZfK4eDhACFfquZ7B4tT9amkw3e16k5uxDvYQ/xMDnCVS u5NxKDUYTOQZiglwdgWkX6cmy/yUGPQIz2hEG9xWTfvPGeBX++jVs2kS7qAJDwCXz0 adYcP9oTm/54+k9pCw986oNVatsw7ipBDDuZ9k13uBmmgqpHiaayO2g+M9d1F9ypVT qyFgpnEYcARpg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 1FA49693D7; Fri, 16 Jan 2026 17:58:26 -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 1HE0Rt86ThkQ; Fri, 16 Jan 2026 17:58:26 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768611502; bh=KJmFl1uQyFYKofcvcgyOHvmWOb8+4tA3dyqlcFhoZqg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=L/PtOBcYZSVrwoy/LYLDCNBEXtbCiDtspSSOmpFFm6mdZy923T1HrjHebH6RanlUg DMhyAkazvpeQ1dZkZCY6mAbvVQ0YgqiHm6Ltozi4SdbJ8d1cqzF4fTIDhWRrgCC/x2 m+Gk0ef0xXtyBD/BdyqlGUo2TrZiFwtTiXP0ubDOq6B1vK6/oMPwfceNtJIkZrM7fg fqN3ePQ7fiqoP6Xoo/Na5KLeyBLAI3/DZ5FwZC0HHjRP3a5NAVvzzKS4xIluKKRnEE fPxeOQuCdf5OSSyUHVXLlkpGTi/ffhKsRtwHCWDjJj89acKAdl2XpPfJ3+LnEHmEFR kvOeCO0v3bKXg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id C6907693B1; Fri, 16 Jan 2026 17:58:21 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Fri, 16 Jan 2026 17:56:54 -0700 Message-ID: <20260117005702.1684841-17-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: RTOTB4YW6STU2Q6X3P3SKJNOSSCFDZDQ X-Message-ID-Hash: RTOTB4YW6STU2Q6X3P3SKJNOSSCFDZDQ 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 16/18] video: truetype: Remove console_tt_store struct 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 Now that console_tt_store only contains console_tt_ctx, remove the wrapper struct and save/restore console_tt_ctx directly. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- drivers/video/console_truetype.c | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/drivers/video/console_truetype.c b/drivers/video/console_truetype.c index 7b1540b6c40..f73fb3e6595 100644 --- a/drivers/video/console_truetype.c +++ b/drivers/video/console_truetype.c @@ -249,15 +249,6 @@ struct console_tt_priv { char *scratch_buf; }; -/** - * struct console_tt_store - Format used for save/restore of entry information - * - * @ctx: Per-client context - */ -struct console_tt_store { - struct console_tt_ctx ctx; -}; - static int console_truetype_set_row(struct udevice *dev, uint row, int clr) { struct video_priv *vid_priv = dev_get_uclass_priv(dev->parent); @@ -1170,8 +1161,7 @@ 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 console_tt_store store; - const uint size = sizeof(store); + const uint size = sizeof(*ctx); if (xpl_phase() <= PHASE_SPL) return -ENOSYS; @@ -1179,8 +1169,7 @@ static int truetype_entry_save(struct udevice *dev, struct abuf *buf) if (!abuf_realloc(buf, size)) return log_msg_ret("sav", -ENOMEM); - store.ctx = *ctx; - memcpy(abuf_data(buf), &store, size); + memcpy(abuf_data(buf), ctx, size); return 0; } @@ -1188,13 +1177,11 @@ 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 console_tt_store store; if (xpl_phase() <= PHASE_SPL) return -ENOSYS; - memcpy(&store, abuf_data(buf), sizeof(store)); - *ctx = store.ctx; + memcpy(ctx, abuf_data(buf), sizeof(*ctx)); return 0; }