From patchwork Fri Aug 19 15:39:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 598503 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:4388:0:0:0:0 with SMTP id w8csp1499767mae; Fri, 19 Aug 2022 08:44:03 -0700 (PDT) X-Google-Smtp-Source: AA6agR6hJP1aNQYMrFVCXNtTZtQ2R9cdO2wENL4Mpw42sMSGHRvwyBH4yAya6FH9RKAClWmYbKg4 X-Received: by 2002:a05:6214:20cb:b0:496:ae67:2121 with SMTP id 11-20020a05621420cb00b00496ae672121mr6834408qve.95.1660923843171; Fri, 19 Aug 2022 08:44:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660923843; cv=none; d=google.com; s=arc-20160816; b=ar/fnajKTJa5ggL0Wn6Ai9sAKxPp+VQr2LKe6g5FnUmyL/geDJigkSp4qNWUS/N1VV VPNH1O4J6wA9LX4UsMkrf7Wzw1CKHORgnTl0bBpIzQcuWK7zSy1BwvS74aZsGmcjW+i/ A13lVIbXXnUgo2yn/t5KwKvjQinTukrbWICWS7X5t/pee/1uGDkDdN1zQd27sOQ59Agz tT20WAxOWBTOuULMLZtXvyJaQLSzWjAyA2fIS1H4fvXl0Ifl6OaWBJZzL2NI365EPncS dC0SK3RSCuOcp4KLpKwiadI1VMzZuaNZAeuhs8diM0qsb4bOWzLtFiqMCLr7PT0SyGG3 SPYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Xeh2vqFOTw5s3hqoNhblRj1bcX1xyzRqQ8DX799pYws=; b=dRL7aUye/azBke57AmrFYLNzcU5gTtb7JQ5+98ZtjccfTapRTxOl6SltUmRDzVtk9k L+I4xP51KfHfoEFzyVqzHGOAi/tmwsUh7q8Z7LvCgRiYxb7tCzt1HmgTGt2oVJtCYx5g JONWRxSafesTou0ejMjxAII02N/01ckzMS0yjp/Z60dfcBbgS/o9C5lxF6SyN6EqN3GV pmKoT2pEO10KmnCRdAQrjCZcwOi9ngg2QRGjz8MhGJrkuz3ZLjTeTH3nrNZsZX9JM/WH mNsVVy6NoYyjVW12zcVD+vU9KR3FJk+UunEBqt9cJS/HDtc8iRYY31Ime5KfV7P6wtYv pdRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lTiOZM14; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id cb10-20020a05622a1f8a00b003449d633eafsi932797qtb.100.2022.08.19.08.44.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 19 Aug 2022 08:44:03 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lTiOZM14; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:46760 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oP4AE-0003bE-OM for patch@linaro.org; Fri, 19 Aug 2022 11:44:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53658) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oP468-0005dh-1I for qemu-devel@nongnu.org; Fri, 19 Aug 2022 11:39:48 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:35353) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oP45y-00063h-3e for qemu-devel@nongnu.org; Fri, 19 Aug 2022 11:39:47 -0400 Received: by mail-wr1-x432.google.com with SMTP id bs25so5624730wrb.2 for ; Fri, 19 Aug 2022 08:39:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=Xeh2vqFOTw5s3hqoNhblRj1bcX1xyzRqQ8DX799pYws=; b=lTiOZM14C4pzD56g9hfva+qxBUzAabBWDLJN5hR2r8kR9DGDCGl9eBb37fdOHRGpUR w8y2AR8hA3b4fZi27JxSkFjT2oprxw9C6nGqd4yjE4Eafp0//ZITFsbdfi9qyTffPTkj DbD0bFwOW28DlJGhQAVHKoBV5V8pUhAziQSFVvpctj6+hao4KHGfcWKIypYlGKrPqndn bYysnjn3QaOpgzMngCOga8dF1+atqw/eQ/PmhxwhxJ+sCw1O+oT7CLSSPpfYsUJMNM3n 5tPj4S48j7KTHY3MyJNH5kN0wlBokmlwOnr6WUgzzLa2k3OwxmEQb1WVGTklXQHczk5s 3khA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=Xeh2vqFOTw5s3hqoNhblRj1bcX1xyzRqQ8DX799pYws=; b=Lb+qlxHzR14NBmm8z7gxhJWjzFFd8bqYnjn4dhC4y9tv0UkyDm/kiYvHOPE67SiimA rckkbo5jxKvM0hzTkupvgoKYcERvq2/41xoCWfcV1s9kQAaohyAQ8USUqXklKuwhaJ5h ykOcFn21d4iJRJGWCsaw/SjjjAMrdXhjW+5bQvAXpyIgQpB8sY2gO3kfBdf4NJ40KiHl dDp+O5VzSlME7Z2RAm+09N5K6ON465uutlKmGUm2A8R11knWQiTpN5Mh7N2kWfIsfLhk NvrSuWzxFb5PGeLypcD9GlwNJawpi0rs2MSyddjagymDwSBogmtGLbzomDUUCoUOQgxt +08Q== X-Gm-Message-State: ACgBeo0mvtYZCR9nnvv2v8C1iMOyb2vd4s/OsTtbVuglJtw0c1AZnG7p 5rAbLuJTuKxBx4UEkoV+1pMnDYN9fcOXAw== X-Received: by 2002:a05:6000:1541:b0:222:cf65:18d7 with SMTP id 1-20020a056000154100b00222cf6518d7mr4464252wry.659.1660923575950; Fri, 19 Aug 2022 08:39:35 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id bi13-20020a05600c3d8d00b003a54109a6a0sm5558396wmb.3.2022.08.19.08.39.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Aug 2022 08:39:35 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Samuel Thibault , =?utf-8?q?Marc-Andr=C3=A9_L?= =?utf-8?q?ureau?= , "Michael S. Tsirkin" , Marcel Apfelbaum , Richard Henderson , Eduardo Habkost , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Daniel Henrique Barboza , David Gibson , Greg Kurz , Dmitry Fleytman , =?utf-8?q?Daniel_P=2E_Berrang?= =?utf-8?q?=C3=A9?= , qemu-ppc@nongnu.org Subject: [PATCH v2 01/11] chardev/baum: Replace magic values by X_MAX / Y_MAX definitions Date: Fri, 19 Aug 2022 16:39:21 +0100 Message-Id: <20220819153931.3147384-2-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220819153931.3147384-1-peter.maydell@linaro.org> References: <20220819153931.3147384-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x432.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé Replace '84' magic value by the X_MAX definition, and '1' by Y_MAX. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Marc-André Lureau Reviewed-by: Samuel Thibault Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- chardev/baum.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/chardev/baum.c b/chardev/baum.c index 79d618e3504..6d538808a0f 100644 --- a/chardev/baum.c +++ b/chardev/baum.c @@ -87,6 +87,9 @@ #define BUF_SIZE 256 +#define X_MAX 84 +#define Y_MAX 1 + struct BaumChardev { Chardev parent; @@ -244,11 +247,11 @@ static int baum_deferred_init(BaumChardev *baum) brlapi_perror("baum: brlapi__getDisplaySize"); return 0; } - if (baum->y > 1) { - baum->y = 1; + if (baum->y > Y_MAX) { + baum->y = Y_MAX; } - if (baum->x > 84) { - baum->x = 84; + if (baum->x > X_MAX) { + baum->x = X_MAX; } con = qemu_console_lookup_by_index(0);