diff options
author | Markus Elfring <elfring@users.sourceforge.net> | 2017-04-17 10:40:32 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-04-18 13:55:08 -0400 |
commit | bd6aaf5535a6782b04e84ea575d65e95d2e7acbc (patch) | |
tree | a8588f488ed33b6117dec75b615e94224fc0f627 /drivers | |
parent | c5b2ce24f3d27366135d542a98b596c056cb75f3 (diff) | |
download | lwn-bd6aaf5535a6782b04e84ea575d65e95d2e7acbc.tar.gz lwn-bd6aaf5535a6782b04e84ea575d65e95d2e7acbc.zip |
net: mvpp2: Improve a size determination in two functions
Replace the specification of two data structures by pointer dereferences
as the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer according to the Linux coding style convention.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ethernet/marvell/mvpp2.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/marvell/mvpp2.c b/drivers/net/ethernet/marvell/mvpp2.c index 61fd87d0a4ec..3bddb8fcd595 100644 --- a/drivers/net/ethernet/marvell/mvpp2.c +++ b/drivers/net/ethernet/marvell/mvpp2.c @@ -2024,7 +2024,7 @@ static int mvpp2_prs_vlan_add(struct mvpp2 *priv, unsigned short tpid, int ai, goto error; } - memset(pe, 0 , sizeof(struct mvpp2_prs_entry)); + memset(pe, 0, sizeof(*pe)); mvpp2_prs_tcam_lu_set(pe, MVPP2_PRS_LU_VLAN); pe->index = tid; @@ -2165,7 +2165,7 @@ static int mvpp2_prs_double_vlan_add(struct mvpp2 *priv, unsigned short tpid1, goto error; } - memset(pe, 0, sizeof(struct mvpp2_prs_entry)); + memset(pe, 0, sizeof(*pe)); mvpp2_prs_tcam_lu_set(pe, MVPP2_PRS_LU_VLAN); pe->index = tid; |