From patchwork Thu Sep 22 16:35:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 608249 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp502119pvb; Thu, 22 Sep 2022 11:26:01 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6+LmBGmYt2gF63W/OWWFb3JLDFNsNO9QcAowMnqCMpEW3vdpgHbPozcUVghQWCwh52jNa5 X-Received: by 2002:a05:620a:1b89:b0:6ce:8b2b:7f0e with SMTP id dv9-20020a05620a1b8900b006ce8b2b7f0emr3163055qkb.15.1663871161426; Thu, 22 Sep 2022 11:26:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663871161; cv=none; d=google.com; s=arc-20160816; b=fp1hW94LtsNEw+AQN81NWwTszQAZQZ6EPVr5INJ/JU/xPIdbNNgI+nvQ2/NEeO2OZT krjnUa0SGvqTvabPJ9eI09FehL+tWqAtYJAbfAHmbYJpFeVKb3QapO2ikVNVM0TRjqcy DJspKcAQMZAli7LWGgcSljTdKpXcRziJpvck1PzUrO5lWLI1H8tbgXGGa6fYMeObCh1I SOJFM0NoWi3vKBs+C02+DBzNnhMaYOHsMH1Z1OjsY349+qKKy+/2qpfQqINOQpqZB3wJ nTn/TfapLf3SLoSiMmexlrimnRyGRTiwD5k/sGSICWPBHSc9J7exyXBF5vHDNywcJK3d pgxw== 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:to:from :dkim-signature; bh=ceS53dBC44zXtToPxcVfNPKGDYvq9xpEKY2mO0aTDyM=; b=u2mxCM45FM+99G8V1eJy0ckHDcUbBtwtts6jC1mZ+SKlKA1pm5OEJ299XYh12mENdK yeTvrp+LzzxSnMrQNDGsSAASaf9lLmqVB2olWK3T8T7j4/MDE1jc7NEWQW4wNXTxCvyj N0Tkq53TmzPfa+/S2+mptqsCHnEt8FMhs7uYmOIs/jCMIw14IwQ98/aZXLrsKUEgrrmG 6X2aj2TvUkr8+bbZfLk1BokgPK0e+qZHZbnmPNPx8HkMJlZp4Ny5SM69IRXhGzi2Dn/C 49cLaDpQ/b0tUcIRlgdrkCFbsodZ1TVPEFR9sLc32zqeC9YIrSwlgnQhnJeuAoKFZ37+ y/jg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sZ54Rn3R; 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 k12-20020ac8474c000000b00344e64eb9d0si3157342qtp.749.2022.09.22.11.26.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 22 Sep 2022 11:26:01 -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=sZ54Rn3R; 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]:53132 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obQtc-0001uM-Vr for patch@linaro.org; Thu, 22 Sep 2022 14:26:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41186) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obPBG-0002Dc-J0 for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:36:10 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]:41878) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1obPB8-0005RV-Nr for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:36:02 -0400 Received: by mail-wr1-x42f.google.com with SMTP id t14so16402957wrx.8 for ; Thu, 22 Sep 2022 09:35:54 -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:to:from:from:to:cc:subject:date; bh=ceS53dBC44zXtToPxcVfNPKGDYvq9xpEKY2mO0aTDyM=; b=sZ54Rn3RUNXs1jYBeLTnqj6bRjbb+6Ic31Ug/F5+PBP8+IY9a9d029FSzRrVDvz/OK VqfCc3pu14Z0wJIjTGgZ3WJSLJc+7xRHCK5JktdGG381x9Rru2TUIHelPEf41Mlsi3Zy BwuhDl3BNHlreW+qTRSyrZGS5KQ8BRzhQRcEBc5qDwlY3S8w2qkNf2eDCdeHNnw3kNYy HiGyvEKwoOCtvePDnlgM5t98CMHgu51NP0mdsDOUZG1f2jwjN8Xi2O6jo2Ed7MzqsVrD bqF248Hx/WHTPTmY3gekem8q6hP5/SNlb/jpwdy9ISJ/Z/gqV/O6978CAWLK6JbYsygQ TDEg== 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:to:from:x-gm-message-state:from:to:cc :subject:date; bh=ceS53dBC44zXtToPxcVfNPKGDYvq9xpEKY2mO0aTDyM=; b=6jm3gVBj0TxTPYr4RU+uvbhQGIl49NZjROubd2G6CT6nj/fRSht6jML3on6Q1nhSp0 KgMlMz+UdsOmPjLILPUCrn6w5W9ZDmB6jA2AVltv2o8iV38eZz42IQpyrbv3M6lH0T3U NG7EVQ6co1pI5BGED9+7WWdWyqyXCVmIJYD/RUJEyfzTI0zA/navlTFrnQYD0NpBGP95 uh0VWw1xHEmR53NlAsDUi+iSMK6Xoas1DH5qb2Nd+GNTeWXf/KtQeDbk045edVsEF3Bt gdLKGx6Vi/TVUDyk8eLef1H3fVTZa1K/o1julmkIFkdOD1tKGLfWN6Pdtt5zEMMFGtHc GguA== X-Gm-Message-State: ACrzQf1lAxa7jyRZcRqxWLbeKnmC2Df1BXf7SCquxnafYxoerZK6FZF9 j22ZEwYWFFF0KVHWsC1UjnjDbIjrHUZvKw== X-Received: by 2002:a5d:5b19:0:b0:22b:237c:3de8 with SMTP id bx25-20020a5d5b19000000b0022b237c3de8mr2542401wrb.285.1663864553008; Thu, 22 Sep 2022 09:35:53 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id iw1-20020a05600c54c100b003b3401f1e24sm6452599wmb.28.2022.09.22.09.35.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 09:35:52 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 22/39] chardev/baum: Replace magic values by X_MAX / Y_MAX definitions Date: Thu, 22 Sep 2022 17:35:19 +0100 Message-Id: <20220922163536.1096175-23-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220922163536.1096175-1-peter.maydell@linaro.org> References: <20220922163536.1096175-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42f.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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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 Message-id: 20220819153931.3147384-2-peter.maydell@linaro.org --- 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);