diff options
author | Alex Elder <elder@linaro.org> | 2021-07-26 19:40:07 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-07-26 23:38:11 +0200 |
commit | f2c1dac0abcfa93e8b20065b8d6b4b2b6f9990aa (patch) | |
tree | 9b4dbaa72b1475a1c515c65ad0a194abf688b91e /drivers/net/ipa/ipa_cmd.h | |
parent | Merge branch 'sja1105-bridge-port-traffic-termination' (diff) | |
download | linux-f2c1dac0abcfa93e8b20065b8d6b4b2b6f9990aa.tar.xz linux-f2c1dac0abcfa93e8b20065b8d6b4b2b6f9990aa.zip |
net: ipa: fix ipa_cmd_table_valid()
Stop supporting different sizes for hashed and non-hashed filter or
route tables. Add BUILD_BUG_ON() calls to verify the sizes of the
fields in the filter/route table initialization immediate command
are the same.
Add a check to ipa_cmd_table_valid() to ensure the size of the
memory region being checked fits within the immediate command field
that must hold it.
Remove two Boolean parameters used only for error reporting. This
actually fixes a bug that would only show up if IPA_VALIDATE were
defined. Define ipa_cmd_table_valid() unconditionally (no longer
dependent on IPA_VALIDATE).
Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ipa/ipa_cmd.h')
-rw-r--r-- | drivers/net/ipa/ipa_cmd.h | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/drivers/net/ipa/ipa_cmd.h b/drivers/net/ipa/ipa_cmd.h index b99262281f41..ea723419c826 100644 --- a/drivers/net/ipa/ipa_cmd.h +++ b/drivers/net/ipa/ipa_cmd.h @@ -57,20 +57,18 @@ struct ipa_cmd_info { enum dma_data_direction direction; }; -#ifdef IPA_VALIDATE - /** * ipa_cmd_table_valid() - Validate a memory region holding a table * @ipa: - IPA pointer * @mem: - IPA memory region descriptor * @route: - Whether the region holds a route or filter table - * @ipv6: - Whether the table is for IPv6 or IPv4 - * @hashed: - Whether the table is hashed or non-hashed * * Return: true if region is valid, false otherwise */ bool ipa_cmd_table_valid(struct ipa *ipa, const struct ipa_mem *mem, - bool route, bool ipv6, bool hashed); + bool route); + +#ifdef IPA_VALIDATE /** * ipa_cmd_data_valid() - Validate command-realted configuration is valid @@ -82,13 +80,6 @@ bool ipa_cmd_data_valid(struct ipa *ipa); #else /* !IPA_VALIDATE */ -static inline bool ipa_cmd_table_valid(struct ipa *ipa, - const struct ipa_mem *mem, bool route, - bool ipv6, bool hashed) -{ - return true; -} - static inline bool ipa_cmd_data_valid(struct ipa *ipa) { return true; |