From patchwork Wed May 5 21:10:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12241041 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B7DD5C433B4 for ; Wed, 5 May 2021 21:13:38 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4D2B3613EA for ; Wed, 5 May 2021 21:13:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4D2B3613EA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:47180 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1leOpt-00028m-54 for qemu-devel@archiver.kernel.org; Wed, 05 May 2021 17:13:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39868) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1leOnT-0008E1-QA for qemu-devel@nongnu.org; Wed, 05 May 2021 17:11:07 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:59584) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1leOnS-00049c-AC for qemu-devel@nongnu.org; Wed, 05 May 2021 17:11:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1620249064; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yGG470A3Jaz0DhDPrHiZEZ43qAaY5nNHcaGiMNivkn0=; b=X8HP1SO/x3wW+y8yFQy1VqYn4VsbNfiM4sGzhhfUe0MA3lKzLMvIMjeGddffSFuVGHHomJ qXTwvHaJV/UhYz2mHKElos5WCHctllqUtb9kvUuPd4Vhg+DVURIRxrn6exydJy/PzmHBvA /yJxe87P6xHZMcnSL+I0PB2utrVv4ec= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-516-i3gvtOTLPZSGB2hEGmtLpQ-1; Wed, 05 May 2021 17:11:01 -0400 X-MC-Unique: i3gvtOTLPZSGB2hEGmtLpQ-1 Received: by mail-wr1-f70.google.com with SMTP id n10-20020adfb74a0000b029010e1a98fb84so1237452wre.0 for ; Wed, 05 May 2021 14:11:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=yGG470A3Jaz0DhDPrHiZEZ43qAaY5nNHcaGiMNivkn0=; b=h9ZXhZrNRxrfEVxR1Qjd7viN9hOgVUl/bjXVqTYsQSjOqFvZqoBx3xCu19jvjdtPfA Fg5BIdqEX14xRzG0rg7nisAmUPmErc+bjBureFIrlSCpJPEyuNkEefmj1ZjU2t53QUOk xHfcn2sMjWuUJOZkcC7CJ+Sayqr4d3o7ND9Ce0jUnVKE96TQlznBnzaukG4yCl0GbcwB v9gtz+gYSL/tsPSifK/TP63M8aH9UjaQaXcSIZPW3zBKLfPlGjMprtoNqF+cil0Om2sb FX8NC/AuryV1BG7LuSj0yB7kIuNAa4Wwh5lPFiQDnnKZ7Mvook1ASSK73bMq1IrVf188 MbQA== X-Gm-Message-State: AOAM532WxGKAtAaBItfZaG9x/tqT/NzZSOO4n53ejEfRNOWGuEu1bprH WSW39wJ/amG0ma4VzjpQ4STa1aAZcMDaw+i9IE0ATai/9JyXggoXZhCRBrBZZIVCTthiGzrnZRO purrjcd5nPTmhND+HFsJmsCdr24lCU+bTrNI5R5QF+MX2kOKNXRN0bTebLMaAHW7E X-Received: by 2002:adf:d1ec:: with SMTP id g12mr1078585wrd.294.1620249059936; Wed, 05 May 2021 14:10:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyIGIU2wTR52pvVBtbElhLcb5ebrIvmDSZz3nPUhGj9Y9gRioNSfoYQBa7vB+kIDXVm3OwEMQ== X-Received: by 2002:adf:d1ec:: with SMTP id g12mr1078568wrd.294.1620249059800; Wed, 05 May 2021 14:10:59 -0700 (PDT) Received: from x1w.redhat.com (astrasbourg-653-1-188-220.w90-13.abo.wanadoo.fr. [90.13.127.220]) by smtp.gmail.com with ESMTPSA id w22sm7363254wmc.13.2021.05.05.14.10.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 May 2021 14:10:59 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 02/23] chardev/baum: Replace magic values by X_MAX / Y_MAX definitions Date: Wed, 5 May 2021 23:10:26 +0200 Message-Id: <20210505211047.1496765-3-philmd@redhat.com> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20210505211047.1496765-1-philmd@redhat.com> References: <20210505211047.1496765-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=170.10.133.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -34 X-Spam_score: -3.5 X-Spam_bar: --- X-Spam_report: (-3.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.693, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Samuel Thibault , qemu-block@nongnu.org, Richard Henderson , qemu-ppc@nongnu.org, Gerd Hoffmann , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Replace '84' magic value by the X_MAX definition, and '1' by Y_MAX. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Samuel Thibault Reviewed-by: Marc-André Lureau --- chardev/baum.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/chardev/baum.c b/chardev/baum.c index 5deca778bc4..adc3d7b3b56 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);