From patchwork Thu Dec 14 14:52:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrey Smirnov X-Patchwork-Id: 10112401 Return-Path: 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 3CA026019C for ; Thu, 14 Dec 2017 15:04:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2C1F622B39 for ; Thu, 14 Dec 2017 15:04:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 20F0D29004; Thu, 14 Dec 2017 15:04:11 +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 A241D22B39 for ; Thu, 14 Dec 2017 15:04:10 +0000 (UTC) Received: from localhost ([::1]:41440 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ePV3R-0001pQ-MA for patchwork-qemu-devel@patchwork.kernel.org; Thu, 14 Dec 2017 10:04:09 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55231) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ePUtB-0001Uc-BG for qemu-devel@nongnu.org; Thu, 14 Dec 2017 09:53:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ePUtA-0000Xd-Gn for qemu-devel@nongnu.org; Thu, 14 Dec 2017 09:53:33 -0500 Received: from mail-pg0-x242.google.com ([2607:f8b0:400e:c05::242]:34052) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ePUt6-0000Pz-Jr; Thu, 14 Dec 2017 09:53:28 -0500 Received: by mail-pg0-x242.google.com with SMTP id j4so3563776pgp.1; Thu, 14 Dec 2017 06:53:28 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=uZAjdu/ViWnu/aZpzw5alaZY2904L6KQcjj4bJJYMJ0=; b=E1JGzDxX1bhbaP6jeO8zp455Vr4BK0VaXqqZYyoq2/45CAQWOzmdQTeVnd+3M2zif9 LN/zAjILSiodVwZbF2q3wy9uYFap5RAXrVoFOyrppL91U+dIW+Xwfugl4OMjzNyU21ke wQZttBlEPRn47Pxdd3z1iRaGrRxsWDOV3e3gGhNVfP9o3NnX8B24d7uaGM2c2XTXjwIK 4w0yuTrfBa7Db6ZzXaWqzN+kmPyYVjcZjGwHu4i+iT/ps+P+V6xc7U7uMlZykpnO15Xv GKG/exUOUFpoN15vc+sjjXgMaUdtdFYMK5nsJplfw228/zwoW5FFB0OEafkcMIaDMf00 bTfg== 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=uZAjdu/ViWnu/aZpzw5alaZY2904L6KQcjj4bJJYMJ0=; b=JdSSvC3q4TCpa1Bo4sIh9jTVhxqlGNpZbJCs0nWqQfoMMGkqyL2XHzLav7oQWNVr62 dmWaYLJ0QL5OSRGk2gNJjPcOgli8P+ej+14odKXYS1B6aiO4Xj1eP7ev4071Ow1pU8pQ cw6tj103DdSIM+0p2PD3kF8mjmgOUG/MH5dvRQz6hlGY2bOVOtpA8qblHgCswaEC0HtU zWBn4kEVM/iQexU+IzXOgUOKjTJHztJ5NITsU/+m9WecC3oY4cTQqNzZZaTtBYN2ZGSH zyeQbm/o2ZQAhTVxJJejNKCnVKjyIIy0q+fe0wBRPkZkWvqNxhq6p9UX1EyfO01Z9wt1 uTFA== X-Gm-Message-State: AKGB3mKXQz/91n5Cfjqk5kjIP8IRq8Ada7R+ywnFqWMq2y4EIl933cmH nSNna/iho5LTxRD7y7vKXBcRAJ5y X-Google-Smtp-Source: ACJfBosapMHmgMSaqNSyhRgRlI4lMNOHt57Qcp17vpBWKSvxQdwU+ZLGZlwYImRUHhzlTiSrZRTLIQ== X-Received: by 10.84.174.129 with SMTP id r1mr9933657plb.337.1513263207250; Thu, 14 Dec 2017 06:53:27 -0800 (PST) Received: from squirtle.lan (c-24-22-235-96.hsd1.wa.comcast.net. [24.22.235.96]) by smtp.gmail.com with ESMTPSA id e7sm8757439pfj.44.2017.12.14.06.53.25 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 14 Dec 2017 06:53:26 -0800 (PST) From: Andrey Smirnov To: qemu-arm@nongnu.org Date: Thu, 14 Dec 2017 06:52:46 -0800 Message-Id: <20171214145255.31545-7-andrew.smirnov@gmail.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20171214145255.31545-1-andrew.smirnov@gmail.com> References: <20171214145255.31545-1-andrew.smirnov@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c05::242 Subject: [Qemu-devel] [PATCH v2 06/15] 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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Andrey Smirnov , Jason Wang , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org, yurovsky@gmail.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Cc: Peter Maydell Cc: Jason Wang Cc: Philippe Mathieu-Daudé Cc: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org Cc: yurovsky@gmail.com Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Andrey Smirnov --- hw/net/imx_fec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/net/imx_fec.c b/hw/net/imx_fec.c index 50da91bf9e..6feda18742 100644 --- a/hw/net/imx_fec.c +++ b/hw/net/imx_fec.c @@ -1076,7 +1076,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;