Message ID | 20170918195100.17593-7-andrew.smirnov@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 87D85601E9 for <patchwork-qemu-devel@patchwork.kernel.org>; Mon, 18 Sep 2017 20:01:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 716A928CE1 for <patchwork-qemu-devel@patchwork.kernel.org>; Mon, 18 Sep 2017 20:01:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 65D9C28D61; Mon, 18 Sep 2017 20:01:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D67FD28D73 for <patchwork-qemu-devel@patchwork.kernel.org>; Mon, 18 Sep 2017 20:01:02 +0000 (UTC) Received: from localhost ([::1]:38658 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org>) id 1du2Dz-0005ir-9W for patchwork-qemu-devel@patchwork.kernel.org; Mon, 18 Sep 2017 16:00:59 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37370) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <andrew.smirnov@gmail.com>) id 1du24t-0006ox-BP for qemu-devel@nongnu.org; Mon, 18 Sep 2017 15:51:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <andrew.smirnov@gmail.com>) id 1du24s-0006IQ-LC for qemu-devel@nongnu.org; Mon, 18 Sep 2017 15:51:35 -0400 Received: from mail-pf0-x242.google.com ([2607:f8b0:400e:c00::242]:35297) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from <andrew.smirnov@gmail.com>) id 1du24q-0006G7-8H; Mon, 18 Sep 2017 15:51:32 -0400 Received: by mail-pf0-x242.google.com with SMTP id i23so595368pfi.2; Mon, 18 Sep 2017 12:51:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=BNk/XMXexa9eZG4ckigFUy60XK40Fo/MvaxQGV5lvgQ=; b=QvhgHHB8flbUfpapmkGLhLYiMeXuQ25iYA143oGavJCb3eZovhxdABdDGg6sgsiUZ3 /V7sRrZO6UO9M/dJ5t92RkEdcvslWJt7p/Awr07+cIVbW8qlJEvHsrXmR7Bz3moPmXPJ 2LUxODZbk1vpAo070mikblrl+2h+Xb66xoNUwYHK/nPjOl1siVPLCh3l857PKYghMbnB bksEh2CoIA5jqi7HXLkV4GU4uKyvTvi61PRFnpFDC02SPwhmJvXSCETGFomoNGkSdA4C Kp4/gJ2xdTrADHqCU9EKAXvT6CO+Vak8tBQtdAJU38dsYHxUwzD+rePsgUe9VHcvv4M0 oCzg== 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; bh=BNk/XMXexa9eZG4ckigFUy60XK40Fo/MvaxQGV5lvgQ=; b=dIK2H42UrddseyAdfwxnKgwBuL95XFCGOKVr9HJNRrrlerTN9QLzakXDbPtSnY5TMh 3/IfiSvx64Dk79L4IAt/iD56UQW3cga9PRAijXJHIQ3dpTBsCNgoUPztbzRwDNGcZA2m PLRt65F2oCQ7R4VeLgNSxUOdOHzN4jQl/Bdntb4TCKrYxFGoN46/rkxPUDhanO8Prt// PA6wgi9cS4IHUZjoLMoC7pcZELNDiHqomTlOIUzhwzg0+EUaTC+AwJjU0ngpMflUkjzp Z8czHepy0v1T2UvIrjELzBFVfQJeLnTKJ63Q0BzzeK/mGQynx7NHcMvFapTBYkVySwK2 qhcA== X-Gm-Message-State: AHPjjUjcs/s/tZJ3AMMw+OOXp/iqbV3g7caP/jv1V1FfLK1Jj0hjUzX+ la+Xa2W2BTY4fuBkP/4= X-Google-Smtp-Source: AOwi7QAMng1NP353B/itu0CPRwDTFZErnf5F1S0bvXKcywbKS7WTmgd9r/CbBBdZ3qWTYL7YsNeUMw== X-Received: by 10.84.253.23 with SMTP id z23mr18994021pll.210.1505764291145; Mon, 18 Sep 2017 12:51:31 -0700 (PDT) Received: from squirtle.westlake.spaceflightindustries.com ([173.226.206.194]) by smtp.gmail.com with ESMTPSA id d186sm200791pfd.117.2017.09.18.12.51.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 18 Sep 2017 12:51:30 -0700 (PDT) From: Andrey Smirnov <andrew.smirnov@gmail.com> To: qemu-arm@nongnu.org Date: Mon, 18 Sep 2017 12:50:49 -0700 Message-Id: <20170918195100.17593-7-andrew.smirnov@gmail.com> X-Mailer: git-send-email 2.13.5 In-Reply-To: <20170918195100.17593-1-andrew.smirnov@gmail.com> References: <20170918195100.17593-1-andrew.smirnov@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c00::242 Subject: [Qemu-devel] [PATCH 06/17] imx_fec: Use MIN instead of explicit ternary operator X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <http://lists.nongnu.org/archive/html/qemu-devel/> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Cc: Andrey Smirnov <andrew.smirnov@gmail.com>, Peter Maydell <peter.maydell@linaro.org>, Jason Wang <jasowang@redhat.com>, qemu-devel@nongnu.org, yurovsky@gmail.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" <qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org> X-Virus-Scanned: ClamAV using ClamSMTP |
diff --git a/hw/net/imx_fec.c b/hw/net/imx_fec.c index 989c11be5f..8a77136d38 100644 --- a/hw/net/imx_fec.c +++ b/hw/net/imx_fec.c @@ -1074,7 +1074,7 @@ static ssize_t imx_enet_receive(NetClientState *nc, const uint8_t *buf, TYPE_IMX_FEC, __func__); break; } - buf_len = (size <= s->regs[ENET_MRBR]) ? size : s->regs[ENET_MRBR]; + buf_len = MIN(size, s->regs[ENET_MRBR]); bd.length = buf_len; size -= buf_len;
Cc: Peter Maydell <peter.maydell@linaro.org> Cc: Jason Wang <jasowang@redhat.com> Cc: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org Cc: yurovsky@gmail.com Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> --- hw/net/imx_fec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)