From patchwork Mon Oct 6 16:54:36 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 506 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=1759769720; bh=jTsulk64A9xQpRIw3tCqCSOkoIFAoLaH10/8y+FaTYo=; 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=LLmBdl/xfCYaZ2tWkq3N8olcgiKBsxCxSi51rXieSvMjLsfVId8byvKCbejoJo5sr XA6mvcjZ5K+F4zixD/Cj0uPUc0htgDMUlGqRpTVyYxiEQEGa5xwcwGGbk2I+ibqOws GmEki2AhDiAUyglpdl3t+PzSoLkEIPB6laQBItjBQxQkMYC4XOf8o/VZowMlzuo6oH K0AXH2DjQVw8O5htbBIwNe+Fo0sxe3X53zb/jyLMSN5GJL/h3hffs8IOuwmaQHyrqs EgXGm3Bvf06GuPKJ3+XLnNCV30tqfStXNtOH1YrLqlFJeI6J+p/NBMo17QVnW9exke b3d2U/CiHVSWQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id B396B67ECE for ; Mon, 6 Oct 2025 10:55:20 -0600 (MDT) 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 IxYFqGpSnu9p for ; Mon, 6 Oct 2025 10:55:20 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759769720; bh=jTsulk64A9xQpRIw3tCqCSOkoIFAoLaH10/8y+FaTYo=; 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=LLmBdl/xfCYaZ2tWkq3N8olcgiKBsxCxSi51rXieSvMjLsfVId8byvKCbejoJo5sr XA6mvcjZ5K+F4zixD/Cj0uPUc0htgDMUlGqRpTVyYxiEQEGa5xwcwGGbk2I+ibqOws GmEki2AhDiAUyglpdl3t+PzSoLkEIPB6laQBItjBQxQkMYC4XOf8o/VZowMlzuo6oH K0AXH2DjQVw8O5htbBIwNe+Fo0sxe3X53zb/jyLMSN5GJL/h3hffs8IOuwmaQHyrqs EgXGm3Bvf06GuPKJ3+XLnNCV30tqfStXNtOH1YrLqlFJeI6J+p/NBMo17QVnW9exke b3d2U/CiHVSWQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A403767F8B for ; Mon, 6 Oct 2025 10:55:20 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759769718; bh=rawu3eY0N+rE6Xuo4nBzMHfANxw/PLNu8WvClRBymnI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=esa5gryBrbAyo2zMEOg87K2fcwEWmHYB1iTmKuGdQu8jrP6/CDX5ho2Yc5O/BLUOU AjG3f32Jq8MYhMOmwNt6gW7MNxJ/vJKN7Ce/SKFc8/QPDILS8icUELpxUFC6FS4eyz lhDEdviX+En1yGfdZhgGa79e8vKiqGehYjhDP1ESSzNhSvnMtdYB0ezI0DPq4KLL06 SbCpA70/wtXJYH58fvmzyRziXUN5YvUqLwwkzj/s5WInIovgAS4SBXofHB17Zr0qYl qXYu59+LiiABAjVh+DU1Ku1/W7SjWykWYWayXT3d7AnLrKkhzAUoHgeznNVR8Smc4X K1WIN23rw6ybA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id B353A67F3F; Mon, 6 Oct 2025 10:55:18 -0600 (MDT) 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 A1rl59QpFVjM; Mon, 6 Oct 2025 10:55:18 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759769716; bh=hvQTEnRUkxTeuUV7XjrqZfyUe6ulxy0a3ffNplVLHJU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ej1yJsJpgkXZtBcTt5n3hfwAod2vl058CH6+fA6BnBxgDaU7R8QEZI07lGdVCcZ8s T5D33sYG6oPEmcRjmH/TKpiL5+tRGfqVMbxO+wnLieflfignFIS4KvNf41aflpShGg zMiRe6UMJDFf9sIETv7B1ivRZZQuQmhl4HAk3Lt10++N2xjArE7rvY0OGBgdMzRkvy I48JA4w8Fdl7duE3Imnx/AWl+4N/4YSifXhKnnRWFQHWUBBHcbUCXk2IQzfnmvpiaS WjwsWuVezLUGcWylTWYHMPhXU/QBQ3529DK5r/2VYPoCt9xr6QI49d3k0+hpj2KBuC 4li6e/tABMqzw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id C812467FBD; Mon, 6 Oct 2025 10:55:15 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Mon, 6 Oct 2025 10:54:36 -0600 Message-ID: <20251006165452.1675349-5-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251006165452.1675349-1-sjg@u-boot.org> References: <20251006165452.1675349-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: E2UBKNOQW7ZIU7PEQXXVRIBPRQSXC5H3 X-Message-ID-Hash: E2UBKNOQW7ZIU7PEQXXVRIBPRQSXC5H3 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: Heinrich Schuchardt , Simon Glass , Claude X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 04/14] expo: Update poll_mouse() to use struct vid_pos 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 Simplify the function to use struct vid_pos instead of separate x/y pointers. Co-developed-by: Claude Signed-off-by: Simon Glass --- boot/expo.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/boot/expo.c b/boot/expo.c index 1051133e200..b5c54291220 100644 --- a/boot/expo.c +++ b/boot/expo.c @@ -411,22 +411,18 @@ static int poll_keys(struct expo *exp) return key ? key : -EAGAIN; } -static int poll_mouse(struct expo *exp, int *xp, int *yp) +static int poll_mouse(struct expo *exp, struct vid_pos *pos) { - struct vid_pos pos; int ret; if (!exp->mouse_enabled) return -EAGAIN; /* First check if we have a click available */ - ret = mouse_get_click(exp->mouse, &pos); + ret = mouse_get_click(exp->mouse, pos); if (ret) return log_msg_ret("epm", ret); - *xp = pos.x; - *yp = pos.y; - return 0; /* Click available */ } @@ -438,11 +434,11 @@ int expo_poll(struct expo *exp, struct expo_action *act) if (key != -EAGAIN) { ret = expo_send_key(exp, key); } else if (IS_ENABLED(CONFIG_MOUSE)) { - int x, y; + struct vid_pos pos; - ret = poll_mouse(exp, &x, &y); + ret = poll_mouse(exp, &pos); if (!ret) - ret = expo_send_click(exp, x, y); + ret = expo_send_click(exp, pos.x, pos.y); } if (ret) return log_msg_ret("epk", ret);