Message ID | 20171211213007.7353-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 67D1B60751 for <patchwork-qemu-devel@patchwork.kernel.org>; Mon, 11 Dec 2017 21:36:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 63EC329912 for <patchwork-qemu-devel@patchwork.kernel.org>; Mon, 11 Dec 2017 21:36:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5860929919; Mon, 11 Dec 2017 21:36:10 +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 E482C29912 for <patchwork-qemu-devel@patchwork.kernel.org>; Mon, 11 Dec 2017 21:36:09 +0000 (UTC) Received: from localhost ([::1]:55563 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 1eOVk9-0005jM-4Y for patchwork-qemu-devel@patchwork.kernel.org; Mon, 11 Dec 2017 16:36:09 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35793) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <andrew.smirnov@gmail.com>) id 1eOVf8-0000m8-Sk for qemu-devel@nongnu.org; Mon, 11 Dec 2017 16:30:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <andrew.smirnov@gmail.com>) id 1eOVf8-0004Ea-13 for qemu-devel@nongnu.org; Mon, 11 Dec 2017 16:30:58 -0500 Received: from mail-pf0-x244.google.com ([2607:f8b0:400e:c00::244]:39141) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from <andrew.smirnov@gmail.com>) id 1eOVf5-000452-8t; Mon, 11 Dec 2017 16:30:55 -0500 Received: by mail-pf0-x244.google.com with SMTP id l24so12535708pfj.6; Mon, 11 Dec 2017 13:30:55 -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=dO18p8HfCji6+WTlzIeO4Vyjx/kkuBnudAAxP+UeJ8isAITM8G4aRoUybA7xtmNrXs FBh4eg+F++U+Zgs86pzpHF4599j66EUnMcGY3w4+RfAn7qUxH4YcJAkYEKGqomBcRTHc rE6kriMBmEAUkSD60A8D1g5fnQa1yeXPSwRLtbfxYiz5Rodlu/8c85A+KFhj+MQrnkXt wAf7M2z+WiHaXKI6xlBJcrPbwJEHsYvTkFtEYdcG+LpjOd1DWLBJyyrJBTkVpJjLXjRl EcgogD3ZvWwJHymTd81l3M3SVNoRDhmQ9rAGrJYAZbPNhkWTT+0ZAz5+xZKgxcBFQ0ca CRpA== 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=aL/bmycN7o7cO9isTsvt1FarxGg9CDiQdBdQny6UsA7C31QO6AxJnijg5k4zi51ecA a+Hc6Vr7cPN9J/Xf4szDgmZeIi7BERMSL90NoOM7N1IrvYC6LzYeIXkE8i7DhxhPMn+t UyB5xdW+PMfMDgbOlDgLyK01RxAvP+nFyu3pFa1bz3rb4oeO8sQhJ1h3BjNxbhBcyJcB 6SbcJAbLanWBtLE+azIwuHji0JahTHWbsft2LUr6O/wVZvkf7l1weZRjkf/nmroMi1Rj RZgbNT5zj2dGNfep2ZWAj4PwoHR+xJb3xx30nkzMe+a55xCwiaURoHv/TIopkpa9zBhN GBIA== X-Gm-Message-State: AKGB3mJs/KPDQsB98XGXylahwM0iZesiUo32byeMAJaZPPsEnxO7Zz3Y Bz9fGihsbPwcCzXMa+r0kW5STfpR X-Google-Smtp-Source: ACJfBos7MCq8MKJJDzvtEMFwPbK7ZBbQp0xmN0Gsjb5wu8k114ju0A9jfWBH6uadKCm2MjUDigY/xg== X-Received: by 10.84.253.1 with SMTP id z1mr1624585pll.115.1513027854114; Mon, 11 Dec 2017 13:30:54 -0800 (PST) Received: from squirtle.westlake.spaceflightindustries.com ([173.226.206.194]) by smtp.gmail.com with ESMTPSA id q10sm25359690pgc.84.2017.12.11.13.30.53 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 11 Dec 2017 13:30:53 -0800 (PST) From: Andrey Smirnov <andrew.smirnov@gmail.com> To: qemu-arm@nongnu.org Date: Mon, 11 Dec 2017 13:30:00 -0800 Message-Id: <20171211213007.7353-7-andrew.smirnov@gmail.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20171211213007.7353-1-andrew.smirnov@gmail.com> References: <20171211213007.7353-1-andrew.smirnov@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c00::244 Subject: [Qemu-devel] [PATCH 06/13] 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: Peter Maydell <peter.maydell@linaro.org>, Andrey Smirnov <andrew.smirnov@gmail.com>, Jason Wang <jasowang@redhat.com>, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= <f4bug@amsat.org>, 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 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;