diff options
author | Fabian Frederick <fabf@skynet.be> | 2014-08-12 19:20:07 -0400 |
---|---|---|
committer | Roland Dreier <roland@purestorage.com> | 2014-08-13 01:00:23 -0400 |
commit | a57f23f675bf679b2be093571ae09fe2199c5e76 (patch) | |
tree | d5154d98d7b0548804aa7cf7e384c39427172450 /drivers/infiniband/hw/mlx4 | |
parent | 114840c3d29b9cbd867faa69595a2aee6f6b54a2 (diff) |
IB/mlx4: Use ARRAY_SIZE instead of sizeof/sizeof[0]
Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband/hw/mlx4')
-rw-r--r-- | drivers/infiniband/hw/mlx4/main.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c index 0f7027e7db13..0dc807f7b069 100644 --- a/drivers/infiniband/hw/mlx4/main.c +++ b/drivers/infiniband/hw/mlx4/main.c | |||
@@ -910,8 +910,7 @@ static int __mlx4_ib_default_rules_match(struct ib_qp *qp, | |||
910 | const struct default_rules *pdefault_rules = default_table; | 910 | const struct default_rules *pdefault_rules = default_table; |
911 | u8 link_layer = rdma_port_get_link_layer(qp->device, flow_attr->port); | 911 | u8 link_layer = rdma_port_get_link_layer(qp->device, flow_attr->port); |
912 | 912 | ||
913 | for (i = 0; i < sizeof(default_table)/sizeof(default_table[0]); i++, | 913 | for (i = 0; i < ARRAY_SIZE(default_table); i++, pdefault_rules++) { |
914 | pdefault_rules++) { | ||
915 | __u32 field_types[IB_FLOW_SPEC_SUPPORT_LAYERS]; | 914 | __u32 field_types[IB_FLOW_SPEC_SUPPORT_LAYERS]; |
916 | memset(&field_types, 0, sizeof(field_types)); | 915 | memset(&field_types, 0, sizeof(field_types)); |
917 | 916 | ||
@@ -965,8 +964,7 @@ static int __mlx4_ib_create_default_rules( | |||
965 | int size = 0; | 964 | int size = 0; |
966 | int i; | 965 | int i; |
967 | 966 | ||
968 | for (i = 0; i < sizeof(pdefault_rules->rules_create_list)/ | 967 | for (i = 0; i < ARRAY_SIZE(pdefault_rules->rules_create_list); i++) { |
969 | sizeof(pdefault_rules->rules_create_list[0]); i++) { | ||
970 | int ret; | 968 | int ret; |
971 | union ib_flow_spec ib_spec; | 969 | union ib_flow_spec ib_spec; |
972 | switch (pdefault_rules->rules_create_list[i]) { | 970 | switch (pdefault_rules->rules_create_list[i]) { |