Message ID | 20171106154813.19936-6-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 3096D603FF for <patchwork-qemu-devel@patchwork.kernel.org>; Mon, 6 Nov 2017 15:50:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 16EF029D9A for <patchwork-qemu-devel@patchwork.kernel.org>; Mon, 6 Nov 2017 15:50:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0B3C329E0C; Mon, 6 Nov 2017 15:50:50 +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 979CC29D9A for <patchwork-qemu-devel@patchwork.kernel.org>; Mon, 6 Nov 2017 15:50:49 +0000 (UTC) Received: from localhost ([::1]:48768 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 1eBjfh-0007t3-AG for patchwork-qemu-devel@patchwork.kernel.org; Mon, 06 Nov 2017 10:50:45 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33383) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <andrew.smirnov@gmail.com>) id 1eBjdd-000737-JA for qemu-devel@nongnu.org; Mon, 06 Nov 2017 10:48:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <andrew.smirnov@gmail.com>) id 1eBjdc-0000Pr-SA for qemu-devel@nongnu.org; Mon, 06 Nov 2017 10:48:37 -0500 Received: from mail-pg0-x242.google.com ([2607:f8b0:400e:c05::242]:44212) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from <andrew.smirnov@gmail.com>) id 1eBjda-0000Nq-Le; Mon, 06 Nov 2017 10:48:34 -0500 Received: by mail-pg0-x242.google.com with SMTP id j3so8525048pga.1; Mon, 06 Nov 2017 07:48:34 -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=GXWoMvTsiaJTqHX4ULprtUDRnbXpQqmoLhRAiqv6NfQ=; b=QwxWMsqUH6XBm5mxjsIsttSk1krNDN+6qED70FsKsAERDGVFehiW1pH/3ch3sX8wEP 7h0UR3MOJiQQLY6v1guOES2X3mYdlTHawnWQAibYfp6k/oAfcMzcdTPpNwDvime7OlKu 1SsUAl4VxWAzSrp4F3YWpDleD34EGLdDfJK6+qPvEXrIsw+iASZmrTMmF6drZD4pgpT7 /03r3I1q/gSiij3HZszxXF5mLHuRE3J8+s7q531QUppCRZmDqWuUCIaoszIW6mdIRBok B+uSK3Z+nuIDaG98Zzuuvgb4K+8YtjBi/n4XRh79sO3prJNMHbtst9csfsevyq8ttgO6 1A+Q== 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=GXWoMvTsiaJTqHX4ULprtUDRnbXpQqmoLhRAiqv6NfQ=; b=RYnlzBeexKjUVgay5OJtEYlvjdWDJ5SwPReKba1TP32d7BHbCFA9yg19NiMwV3yl+x SQ7h8f0M9JymMM25T9Kle1mAkZaTvgXrsfdeZaHLGj5wwmLyvFDwhTvDY6Eh/LQhdqdS aM/jIQAwC04A03sykapSSuhO6uFgQNgA6WoPRnoD41t2VRj4+Fovc5y0ddgyiGAx0N54 xyZLdg1ExHr2iHchrkLFqZtWdCu53jwGnR0Wpl8OGDKdxKLS8P/KwLNraEmRRd4PXlSy /4SUJQ3wNVZNCdIWKHXQuBZ2PpYytfSW/anXYmcTUg9QA+MxBhbV2FEFlaSd5m5lpqrQ +6iQ== X-Gm-Message-State: AMCzsaVe9V0H4CZhfi4H39styuqt5w4kOW/pxx/clL7za/+Cxv9IOI21 vvTpDf/ZsGx38UAPGrmT7+Gb3q2wMwE= X-Google-Smtp-Source: ABhQp+R/ckJfmDXpqfjT6aHo20HDd9LhmoOus68CozdEqleUcJo5TA9POtp/Xt5eOkd4WffCufwX5w== X-Received: by 10.99.160.86 with SMTP id u22mr15471908pgn.283.1509983313389; Mon, 06 Nov 2017 07:48:33 -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 x1sm22719590pfh.113.2017.11.06.07.48.32 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 06 Nov 2017 07:48:32 -0800 (PST) From: Andrey Smirnov <andrew.smirnov@gmail.com> To: qemu-arm@nongnu.org Date: Mon, 6 Nov 2017 07:47:48 -0800 Message-Id: <20171106154813.19936-6-andrew.smirnov@gmail.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171106154813.19936-1-andrew.smirnov@gmail.com> References: <20171106154813.19936-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:c05::242 Subject: [Qemu-devel] [PATCH v3 05/30] 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 dda0816fb3..18de508e8c 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;