From: Alex Elder Date: Sat, 31 Oct 2020 15:15:24 +0000 (-0500) Subject: net: ipa: avoid a bogus warning X-Git-Tag: baikal/mips/sdk5.9~12029^2~410 X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=bac5e0967620481288fa2c7cb643591def431e83;p=kernel.git net: ipa: avoid a bogus warning The previous commit added support for IPA having up to six source and destination resources. But currently nothing uses more than four. (Five of each are used in a newer version of the hardware.) I find that in one of my build environments the compiler complains about newly-added code in two spots. Inspection shows that the warnings have no merit, but this compiler does not recognize that. ipa_main.c:457:39: warning: array index 5 is past the end of the array (which contains 4 elements) [-Warray-bounds] (and the same warning at line 483) We can make this warning go away by changing the number of elements in the source and destination resource limit arrays--now rather than waiting until we need it to support the newer hardware. This change was coming soon anyway; make it now to get rid of the warning. Signed-off-by: Alex Elder Link: https://lore.kernel.org/r/20201031151524.32132-1-elder@linaro.org Signed-off-by: Jakub Kicinski --- diff --git a/drivers/net/ipa/ipa_data.h b/drivers/net/ipa/ipa_data.h index 0225d81d85028..83c4b78373efb 100644 --- a/drivers/net/ipa/ipa_data.h +++ b/drivers/net/ipa/ipa_data.h @@ -46,8 +46,8 @@ */ /* The maximum value returned by ipa_resource_group_{src,dst}_count() */ -#define IPA_RESOURCE_GROUP_SRC_MAX 4 -#define IPA_RESOURCE_GROUP_DST_MAX 4 +#define IPA_RESOURCE_GROUP_SRC_MAX 5 +#define IPA_RESOURCE_GROUP_DST_MAX 5 /** * struct gsi_channel_data - GSI channel configuration data