]> Git Repo - qemu.git/commitdiff
imx_fec: Use MIN instead of explicit ternary operator
authorAndrey Smirnov <[email protected]>
Thu, 11 Jan 2018 13:25:36 +0000 (13:25 +0000)
committerPeter Maydell <[email protected]>
Thu, 11 Jan 2018 13:25:36 +0000 (13:25 +0000)
Cc: Peter Maydell <[email protected]>
Cc: Jason Wang <[email protected]>
Cc: Philippe Mathieu-Daudé <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Signed-off-by: Andrey Smirnov <[email protected]>
Signed-off-by: Peter Maydell <[email protected]>
hw/net/imx_fec.c

index 50da91bf9e051807361767781961637d9e4a1e24..6feda18742d7a92fa9b6a3358067c8f3892a65c3 100644 (file)
@@ -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;
 
This page took 0.0286 seconds and 4 git commands to generate.