Message ID | 20171023201055.21973-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 D2AA460381 for <patchwork-qemu-devel@patchwork.kernel.org>; Mon, 23 Oct 2017 20:18:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C59A028951 for <patchwork-qemu-devel@patchwork.kernel.org>; Mon, 23 Oct 2017 20:18:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B924028956; Mon, 23 Oct 2017 20:18:45 +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 4087728951 for <patchwork-qemu-devel@patchwork.kernel.org>; Mon, 23 Oct 2017 20:18:45 +0000 (UTC) Received: from localhost ([::1]:40404 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 1e6jBM-0005K3-2l for patchwork-qemu-devel@patchwork.kernel.org; Mon, 23 Oct 2017 16:18:44 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46141) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <andrew.smirnov@gmail.com>) id 1e6j4G-0000AJ-3h for qemu-devel@nongnu.org; Mon, 23 Oct 2017 16:11:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <andrew.smirnov@gmail.com>) id 1e6j4F-0002Tz-7a for qemu-devel@nongnu.org; Mon, 23 Oct 2017 16:11:24 -0400 Received: from mail-pf0-x241.google.com ([2607:f8b0:400e:c00::241]:54594) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from <andrew.smirnov@gmail.com>) id 1e6j4D-0002SO-8V; Mon, 23 Oct 2017 16:11:21 -0400 Received: by mail-pf0-x241.google.com with SMTP id n89so17894991pfk.11; Mon, 23 Oct 2017 13:11:21 -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 :mime-version:content-transfer-encoding; bh=xnqBi/NrNQWv2EkLEjjv4DKMlIxiaS1iGRV2nOqWKr4=; b=dY7YfMdCE7CC2ggtYfepRMLy5YHEguXATbN7uv92dpf3MKZODUZn6lv2mhOk0CEzR9 8aUu6vnUkwajIazJkN8r+EU7KRKyNSddkLU2B2ZqgW2eP0LP/yysdQ3I9aaWVa/bIFgj qYAVlC5qAv1vJDMfaBmDOlZm05eq5c4Ob2w9DGjE9Rs3iUuG+jK031DOp7LmRTckL2GQ kIgydPiSqNpQuGD7ILe7F2c6SgSqI2lL29Os091e+4CoWkXlsIn/fkGKrKwPbmXliLUz ulGinrQcnFdPJ/3on/sbSxP251YminrkrP5OE7VgtG6YkHyAPFsMAU7wY/mwXk848whc WWcg== 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=xnqBi/NrNQWv2EkLEjjv4DKMlIxiaS1iGRV2nOqWKr4=; b=UkrPwt0uDq7ipFEPhmxUWEby0NSJPVLhKKj92Mz285J3NJuKS+FmoBY4rJhTlkfStD Bhy2BVxZ22elq6jNzEvOqnQEJ1wVId74nuSORjAaKF/SPP46d4SB/HbB5v7xkfaOlJVT /nLZSpdiL8agwiEzv2MhU2f0Kfz8Npy3QNdXbpbcM/JVZkzAwtEHQgh4ODp4YebELyXj sv0ysr9jREiTVR7NKvwkmbGnspvnGdSpiO2HWXKVSMRcXvBxn07zDgRdbgxpOyHstHCh Q466/mbErhLguT/kDDU7PM9XarP4tKx5Ap+ShiHfki9g/PnZUNdApkigBiEo/EBE+k1f to/A== X-Gm-Message-State: AMCzsaUVOmqDMCGykfwd91a+yqJsi0dczzn7/4X+ijc/zROOgWmQtB1T XLqVsb7VJVzXjOqo77kmvuzqtiAi X-Google-Smtp-Source: ABhQp+Spoxm7ctlxyRBfQ+Fjlo4W5CXpdgF9pKX4VWNWgqJgOZzPuhFJZQ+iPsgD5NeoDzR5upa4Cg== X-Received: by 10.99.107.6 with SMTP id g6mr12787263pgc.215.1508789480186; Mon, 23 Oct 2017 13:11:20 -0700 (PDT) Received: from squirtle.westlake.spaceflightindustries.com ([173.226.206.194]) by smtp.gmail.com with ESMTPSA id j1sm15181623pfj.108.2017.10.23.13.11.19 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 23 Oct 2017 13:11:19 -0700 (PDT) From: Andrey Smirnov <andrew.smirnov@gmail.com> To: qemu-arm@nongnu.org Date: Mon, 23 Oct 2017 13:10:33 -0700 Message-Id: <20171023201055.21973-6-andrew.smirnov@gmail.com> X-Mailer: git-send-email 2.13.5 In-Reply-To: <20171023201055.21973-1-andrew.smirnov@gmail.com> References: <20171023201055.21973-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::241 Subject: [Qemu-devel] [PATCH v2 05/27] 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;