Skip to content

Commit 99cd6a6

Browse files
Yang Lidavem330
authored andcommitted
dpaa2-eth: Simplify bool conversion
Fix the following coccicheck warnings: ./drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c:1199:42-47: WARNING: conversion to bool not needed here ./drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c:1218:54-59: WARNING: conversion to bool not needed here Reported-by: Abaci Robot <abaci@linux.alibaba.com> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 5454f5c commit 99cd6a6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1196,7 +1196,7 @@ static int dpaa2_eth_build_gso_fd(struct dpaa2_eth_priv *priv,
11961196
/* Setup the SG entry for the header */
11971197
dpaa2_sg_set_addr(sgt, tso_hdr_dma);
11981198
dpaa2_sg_set_len(sgt, hdr_len);
1199-
dpaa2_sg_set_final(sgt, data_left > 0 ? false : true);
1199+
dpaa2_sg_set_final(sgt, data_left <= 0);
12001200

12011201
/* Compose the SG entries for each fragment of data */
12021202
num_sge = 1;
@@ -1215,7 +1215,7 @@ static int dpaa2_eth_build_gso_fd(struct dpaa2_eth_priv *priv,
12151215
}
12161216
dpaa2_sg_set_addr(sgt, addr);
12171217
dpaa2_sg_set_len(sgt, size);
1218-
dpaa2_sg_set_final(sgt, size == data_left ? true : false);
1218+
dpaa2_sg_set_final(sgt, size == data_left);
12191219

12201220
num_sge++;
12211221

0 commit comments

Comments
 (0)