ethernet: marvell/octeontx2: Simplify the return expression of npc_is_same
authordingsenjie <dingsenjie@yulong.com>
Fri, 18 Jun 2021 07:34:31 +0000 (15:34 +0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 18 Jun 2021 19:07:48 +0000 (12:07 -0700)
Simplify the return expression in the rvu_npc_fs.c

Signed-off-by: dingsenjie <dingsenjie@yulong.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c

index 87d7c6a..6863314 100644 (file)
@@ -123,11 +123,8 @@ static bool npc_is_field_present(struct rvu *rvu, enum key_fields type, u8 intf)
 static bool npc_is_same(struct npc_key_field *input,
                        struct npc_key_field *field)
 {
-       int ret;
-
-       ret = memcmp(&input->layer_mdata, &field->layer_mdata,
-                    sizeof(struct npc_layer_mdata));
-       return ret == 0;
+       return memcmp(&input->layer_mdata, &field->layer_mdata,
+                    sizeof(struct npc_layer_mdata)) == 0;
 }
 
 static void npc_set_layer_mdata(struct npc_mcam *mcam, enum key_fields type,