Skip to content

Commit

Permalink
net: ipa: refactor endpoint loops
Browse files Browse the repository at this point in the history
Change two functions that iterate over all endpoints to use while
loops, using "endpoint_id" as the index variables in both spots.

Signed-off-by: Alex Elder <[email protected]>
Signed-off-by: Jakub Kicinski <[email protected]>
  • Loading branch information
Alex Elder authored and kuba-moo committed Oct 29, 2022
1 parent 2b87d72 commit e359ba8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions drivers/net/ipa/ipa_endpoint.c
Original file line number Diff line number Diff line change
Expand Up @@ -426,10 +426,10 @@ ipa_endpoint_program_suspend(struct ipa_endpoint *endpoint, bool enable)
*/
void ipa_endpoint_modem_pause_all(struct ipa *ipa, bool enable)
{
u32 endpoint_id;
u32 endpoint_id = 0;

for (endpoint_id = 0; endpoint_id < IPA_ENDPOINT_MAX; endpoint_id++) {
struct ipa_endpoint *endpoint = &ipa->endpoint[endpoint_id];
while (endpoint_id < IPA_ENDPOINT_MAX) {
struct ipa_endpoint *endpoint = &ipa->endpoint[endpoint_id++];

if (endpoint->ee_id != GSI_EE_MODEM)
continue;
Expand Down Expand Up @@ -1008,10 +1008,10 @@ static void ipa_endpoint_init_hol_block_disable(struct ipa_endpoint *endpoint)

void ipa_endpoint_modem_hol_block_clear_all(struct ipa *ipa)
{
u32 i;
u32 endpoint_id = 0;

for (i = 0; i < IPA_ENDPOINT_MAX; i++) {
struct ipa_endpoint *endpoint = &ipa->endpoint[i];
while (endpoint_id < IPA_ENDPOINT_MAX) {
struct ipa_endpoint *endpoint = &ipa->endpoint[endpoint_id++];

if (endpoint->toward_ipa || endpoint->ee_id != GSI_EE_MODEM)
continue;
Expand Down

0 comments on commit e359ba8

Please sign in to comment.