From patchwork Thu Mar 5 17:56:46 2020 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: 11422445 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 11F3B924 for ; Thu, 5 Mar 2020 17:58:22 +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 DCB8A2072D for ; Thu, 5 Mar 2020 17:58:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="QrUl+qX7" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DCB8A2072D 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:54370 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j9ulI-000160-2S for patchwork-qemu-devel@patchwork.kernel.org; Thu, 05 Mar 2020 12:58:20 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47067) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j9uk7-0007Gf-UG for qemu-devel@nongnu.org; Thu, 05 Mar 2020 12:57:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j9uk6-0002kL-Un for qemu-devel@nongnu.org; Thu, 05 Mar 2020 12:57:07 -0500 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:26938 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j9uk6-0002jQ-QD for qemu-devel@nongnu.org; Thu, 05 Mar 2020 12:57:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1583431026; 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=Tw4AXOFUsVnWWH/+MEC8+/Jzhzp7Eu5EQAdmUFQrX44=; b=QrUl+qX7YjvvjTEi0ddyZwljl9VY6VpIEHCeM4702cd9LzZw9uCHaKO1IIPy7RR/ZWFLfh gLpFoONjMFjZe1ureK37acscKKSFjD8JIEGYepbIAo0Rit0skoXxDCXSo0iwi/ZUAmy71H mzpUACiBlj9QMnZqnvJLpM4pL64atQc= 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-463-jk2EZzg5NaaLkL2LTD_Xgw-1; Thu, 05 Mar 2020 12:57:05 -0500 X-MC-Unique: jk2EZzg5NaaLkL2LTD_Xgw-1 Received: by mail-wr1-f70.google.com with SMTP id q18so2601808wrw.5 for ; Thu, 05 Mar 2020 09:57:04 -0800 (PST) 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=+MbtoWKkcqHCz+vfqyTzTQ/PF32JMBmzxf8ccd5VY20=; b=uFsv2zuh2IZZqnzW/AyOGxmJ+zeHyi6pi0goP3LTBsrVwjpGkemm3rZSYt/QFh0NDa SSnzWGA3bMcD5hv5J6wZEnAEnTYrBpkrJ0khN8YqQZe4tZrbcZvE5Inqzyvle04y+BV6 eMabmsV4JM6Q2ECsskJTOvNRxcM36qpw8jnZOmYdtZT61DsGNewv6BzPnyG5NDj3Mxyd le3Co4kDQPP4Kan5nAUKv/W8p1ZNXNIaR1A0DmB6E8NLYNeok9RT6IfVfA55zOgpFFJL WXNYSpVfyYFLC/tGxwjJ/ofWkTxeslmKnnFIhd77VjIV0o0RMx0szI8lTFNyWRxgADlN paOg== X-Gm-Message-State: ANhLgQ1/LNmeNDA0TZCZgE32OwyN41ktfsSKjNbBk2CySdTxeIjwnjoh EZU2GdbgMrTM9Y65RFPLQOrX6lnyaZT8toJU3ON+DmSvFGFNJkf/tJe84lBn+6u/3snQjq/OnYt NXge9wufFWhpm0do= X-Received: by 2002:a05:6000:108:: with SMTP id o8mr120891wrx.312.1583431023632; Thu, 05 Mar 2020 09:57:03 -0800 (PST) X-Google-Smtp-Source: ADFU+vuWmokTTXWO/3o9W34TZ6DMM4KH3ciqzOZWMvRg7PGY3DDIVccA2xbcBAAbGbz94dLSvuoqxg== X-Received: by 2002:a05:6000:108:: with SMTP id o8mr120874wrx.312.1583431023428; Thu, 05 Mar 2020 09:57:03 -0800 (PST) Received: from x1w.redhat.com (47.red-88-21-205.staticip.rima-tde.net. [88.21.205.47]) by smtp.gmail.com with ESMTPSA id d203sm9699558wmd.37.2020.03.05.09.57.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Mar 2020 09:57:02 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 2/6] hw/net/smc91c111: Let smc91c111_can_receive() return a boolean Date: Thu, 5 Mar 2020 18:56:46 +0100 Message-Id: <20200305175651.4563-3-philmd@redhat.com> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200305175651.4563-1-philmd@redhat.com> References: <20200305175651.4563-1-philmd@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.81 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: qemu-ppc@nongnu.org, Dmitry Fleytman , Peter Maydell , "Michael S. Tsirkin" , Andrew Jeffery , Jason Wang , Alistair Francis , Joel Stanley , Beniamino Galvani , Max Filippov , qemu-arm@nongnu.org, Peter Chubb , =?utf-8?q?C=C3=A9dric_Le_Goater?= , "Edgar E. Iglesias" , Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , David Gibson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" The smc91c111_can_receive() function simply returns a boolean value. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis Reviewed-by: Cédric Le Goater --- hw/net/smc91c111.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/net/smc91c111.c b/hw/net/smc91c111.c index e9eb6f6c05..02be60c955 100644 --- a/hw/net/smc91c111.c +++ b/hw/net/smc91c111.c @@ -130,16 +130,16 @@ static void smc91c111_update(smc91c111_state *s) qemu_set_irq(s->irq, level); } -static int smc91c111_can_receive(smc91c111_state *s) +static bool smc91c111_can_receive(smc91c111_state *s) { if ((s->rcr & RCR_RXEN) == 0 || (s->rcr & RCR_SOFT_RST)) { - return 1; + return true; } if (s->allocated == (1 << NUM_PACKETS) - 1 || s->rx_fifo_len == NUM_PACKETS) { - return 0; + return false; } - return 1; + return true; } static inline void smc91c111_flush_queued_packets(smc91c111_state *s)