Commit a57f23f6 authored by Fabian Frederick's avatar Fabian Frederick Committed by Roland Dreier

IB/mlx4: Use ARRAY_SIZE instead of sizeof/sizeof[0]

Signed-off-by: default avatarFabian Frederick <fabf@skynet.be>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
Signed-off-by: default avatarRoland Dreier <roland@purestorage.com>
parent 114840c3
...@@ -910,8 +910,7 @@ static int __mlx4_ib_default_rules_match(struct ib_qp *qp, ...@@ -910,8 +910,7 @@ static int __mlx4_ib_default_rules_match(struct ib_qp *qp,
const struct default_rules *pdefault_rules = default_table; const struct default_rules *pdefault_rules = default_table;
u8 link_layer = rdma_port_get_link_layer(qp->device, flow_attr->port); u8 link_layer = rdma_port_get_link_layer(qp->device, flow_attr->port);
for (i = 0; i < sizeof(default_table)/sizeof(default_table[0]); i++, for (i = 0; i < ARRAY_SIZE(default_table); i++, pdefault_rules++) {
pdefault_rules++) {
__u32 field_types[IB_FLOW_SPEC_SUPPORT_LAYERS]; __u32 field_types[IB_FLOW_SPEC_SUPPORT_LAYERS];
memset(&field_types, 0, sizeof(field_types)); memset(&field_types, 0, sizeof(field_types));
...@@ -965,8 +964,7 @@ static int __mlx4_ib_create_default_rules( ...@@ -965,8 +964,7 @@ static int __mlx4_ib_create_default_rules(
int size = 0; int size = 0;
int i; int i;
for (i = 0; i < sizeof(pdefault_rules->rules_create_list)/ for (i = 0; i < ARRAY_SIZE(pdefault_rules->rules_create_list); i++) {
sizeof(pdefault_rules->rules_create_list[0]); i++) {
int ret; int ret;
union ib_flow_spec ib_spec; union ib_flow_spec ib_spec;
switch (pdefault_rules->rules_create_list[i]) { switch (pdefault_rules->rules_create_list[i]) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment