From patchwork Tue Jan 2 19:36:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrey Smirnov X-Patchwork-Id: 10141265 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 ABB8A6035E for ; Tue, 2 Jan 2018 19:39:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9C4BA28DCF for ; Tue, 2 Jan 2018 19:39:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9134B28DF9; Tue, 2 Jan 2018 19:39:18 +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 278CA28DCF for ; Tue, 2 Jan 2018 19:39:18 +0000 (UTC) Received: from localhost ([::1]:52918 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eWSP7-0005IF-CS for patchwork-qemu-devel@patchwork.kernel.org; Tue, 02 Jan 2018 14:39:17 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58647) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eWSMf-0003IX-1A for qemu-devel@nongnu.org; Tue, 02 Jan 2018 14:36:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eWSMe-0000NX-7p for qemu-devel@nongnu.org; Tue, 02 Jan 2018 14:36:45 -0500 Received: from mail-pg0-x242.google.com ([2607:f8b0:400e:c05::242]:37963) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eWSMb-0000Jx-CZ; Tue, 02 Jan 2018 14:36:41 -0500 Received: by mail-pg0-x242.google.com with SMTP id t67so2960592pgc.5; Tue, 02 Jan 2018 11:36:41 -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=O09jzwslLkILJPDGbdloNmO6pLauAsRaj0sXr3hMuXfvLBeUCtdNuVuoFIja5b/Ovt +tUMaxQJNxo0EmR4+We6nM8PbnIuJY0J7GyiC3L2ZssjXMgcWXANghVqRoJPQAbKlq0/ ToteLM2Z8mxP7DBz7m+D8K5MR7kmSspyT0V5ecB9YoIbXxlpG3uPsRBaxLfHajsts6oA hZTNNxArzwUM0X9Ym+PShATXBXXV3mbbzDmoEcoMw6qmniDHt4X8jSAyjcBU7MRfEu5K WeUnm32VJmJDJruDaGWM26UDgL6VIxJbYXR80bl5TFTaIq317yw5w6jHHpYZvHoKW7S6 zN+w== 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=bZqfoK2BEuXJm8e8+mdF18+YSm59NRWD6VIppWQQfHIdRUioOGuc2s726+GHjrLSS7 1cOy50/9BFT97UtfH7vb164qbr11YUFbyPbOT/lIh+pM203sYRsixFdf7YAHJ4otsvMb 50QJ9qZNY5QtL5BvcCECvXxuZxW8EQC0wf8JEC2rWGDmGnuqa6gD796xJyKFWABfvM64 uuj/MFoeA6tTFCcCxPQyvUB9UrFWURxqQ8zAc9/R2wCWleE0KjYdyqE0V5D9X6laLjTx SSyO3iCV9V+ytKI0kf1t9U33lEaePtZOuwYuXRIW/VnP7BkbrafFXUAEf0ihbUk3WJwM f98Q== X-Gm-Message-State: AKGB3mLU6aB+vIBlkoruII4H8QHHPqLgPhoVGtjulltIBrkIb2bg9H7W qys2/bBD62cLEfSV648K49QldjcYlvs= X-Google-Smtp-Source: ACJfBovTy3it+Axi88gYlio13k/TSjeX5yqi/IGqzs6yXFyLChfUVCOciKXpualVMTP9vGLp27eGKw== X-Received: by 10.98.71.90 with SMTP id u87mr46529901pfa.75.1514921800125; Tue, 02 Jan 2018 11:36:40 -0800 (PST) Received: from squirtle.westlake.spaceflightindustries.com ([173.226.206.194]) by smtp.gmail.com with ESMTPSA id g9sm97905951pfk.0.2018.01.02.11.36.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 02 Jan 2018 11:36:39 -0800 (PST) From: Andrey Smirnov To: qemu-arm@nongnu.org Date: Tue, 2 Jan 2018 11:36:17 -0800 Message-Id: <20180102193622.27215-7-andrew.smirnov@gmail.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180102193622.27215-1-andrew.smirnov@gmail.com> References: <20180102193622.27215-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 v3 06/11] 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;