linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: ipa: avoid a bogus warning
@ 2020-10-31 15:15 Alex Elder
  2020-10-31 20:25 ` Jakub Kicinski
  2020-10-31 20:40 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Alex Elder @ 2020-10-31 15:15 UTC (permalink / raw)
  To: davem, kuba
  Cc: evgreen, subashab, cpratapa, bjorn.andersson, netdev, linux-kernel

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 <elder@linaro.org>
---
Sorry about this; I got no warnings on my primary build system.

 drivers/net/ipa/ipa_data.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

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
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] net: ipa: avoid a bogus warning
  2020-10-31 15:15 [PATCH net-next] net: ipa: avoid a bogus warning Alex Elder
@ 2020-10-31 20:25 ` Jakub Kicinski
  2020-10-31 20:40 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Jakub Kicinski @ 2020-10-31 20:25 UTC (permalink / raw)
  To: Alex Elder
  Cc: davem, evgreen, subashab, cpratapa, bjorn.andersson, netdev,
	linux-kernel

On Sat, 31 Oct 2020 10:15:24 -0500 Alex Elder wrote:
> 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 <elder@linaro.org>

Applied, thanks!

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] net: ipa: avoid a bogus warning
  2020-10-31 15:15 [PATCH net-next] net: ipa: avoid a bogus warning Alex Elder
  2020-10-31 20:25 ` Jakub Kicinski
@ 2020-10-31 20:40 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2020-10-31 20:40 UTC (permalink / raw)
  To: Alex Elder
  Cc: davem, kuba, evgreen, subashab, cpratapa, bjorn.andersson,
	netdev, linux-kernel

Hello:

This patch was applied to netdev/net-next.git (refs/heads/master):

On Sat, 31 Oct 2020 10:15:24 -0500 you wrote:
> 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.
> 
> [...]

Here is the summary with links:
  - [net-next] net: ipa: avoid a bogus warning
    https://git.kernel.org/netdev/net-next/c/624251b4b5a0

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-10-31 20:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-31 15:15 [PATCH net-next] net: ipa: avoid a bogus warning Alex Elder
2020-10-31 20:25 ` Jakub Kicinski
2020-10-31 20:40 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).