Skip to content

Commit

Permalink
net: ipa: don't use u32p_replace_bits()
Browse files Browse the repository at this point in the history
In two spots we use u32_replace_bits() to replace a set of bits in a
register while preserving the rest.  Both of those cases just zero
the bits being replaced, and this can be done more simply without
using that function.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Alex Elder authored and Jakub Kicinski committed Sep 24, 2022
1 parent 4dfa5f0 commit a50d37b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/ipa/ipa_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ static void ipa_filter_tuple_zero(struct ipa_endpoint *endpoint)
val = ioread32(endpoint->ipa->reg_virt + offset);

/* Zero all filter-related fields, preserving the rest */
u32p_replace_bits(&val, 0, IPA_REG_ENDP_FILTER_HASH_MSK_ALL);
val &= ~IPA_REG_ENDP_FILTER_HASH_MSK_ALL;

iowrite32(val, endpoint->ipa->reg_virt + offset);
}
Expand Down Expand Up @@ -571,7 +571,7 @@ static void ipa_route_tuple_zero(struct ipa *ipa, u32 route_id)
val = ioread32(ipa->reg_virt + offset);

/* Zero all route-related fields, preserving the rest */
u32p_replace_bits(&val, 0, IPA_REG_ENDP_ROUTER_HASH_MSK_ALL);
val &= ~IPA_REG_ENDP_ROUTER_HASH_MSK_ALL;

iowrite32(val, ipa->reg_virt + offset);
}
Expand Down

0 comments on commit a50d37b

Please sign in to comment.