]> git.baikalelectronics.ru Git - kernel.git/commit
net: ipa: don't index mem data array by ID
authorAlex Elder <elder@linaro.org>
Thu, 10 Jun 2021 19:23:08 +0000 (14:23 -0500)
committerDavid S. Miller <davem@davemloft.net>
Thu, 10 Jun 2021 21:50:08 +0000 (14:50 -0700)
commitbcd7a346eb3489568031990dff7ac1602c8aa8a3
treea2c1ba1603548024f248273b416e001b3975d3c8
parentdca94dc8a3613ac4f0f9bb3c657e2ea52bfa85e9
net: ipa: don't index mem data array by ID

Finally the code handles the IPA memory region array in the
configuration data without assuming it is indexed by region ID.
Get rid of the array index designators where these arrays are
initialized.  As a result, there's no more need to define an
explicitly undefined memory region ID, so get rid of that.

Change ipa_mem_find() so it no longer assumes the ipa->mem[] array
is indexed by memory region ID.  Instead, have it search the array
for the entry having the requested memory ID, and return the address
of the descriptor if found.  Otherwise return NULL.

Stop allowing memory regions to be defined with zero size and zero
canary value.  Check for this condition in ipa_mem_valid_one().
As a result, it is not necessary to check for this case in
ipa_mem_config().

Finally, there is no need for IPA_MEM_UNDEFINED to be defined any
more, so get rid of it.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ipa/ipa_data-v3.5.1.c
drivers/net/ipa/ipa_data-v4.11.c
drivers/net/ipa/ipa_data-v4.2.c
drivers/net/ipa/ipa_data-v4.5.c
drivers/net/ipa/ipa_data-v4.9.c
drivers/net/ipa/ipa_mem.c
drivers/net/ipa/ipa_mem.h