From: Qi Zhang <qi.z.zhang@intel.com>
To: qiming.yang@intel.com
Cc: xiaolong.ye@intel.com, dev@dpdk.org,
Qi Zhang <qi.z.zhang@intel.com>,
stable@dpdk.org, Dan Nowlin <dan.nowlin@intel.com>,
Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Subject: [dpdk-stable] [PATCH 07/12] net/ice/base: fix loop limit
Date: Thu, 5 Dec 2019 20:38:42 +0800 [thread overview]
Message-ID: <20191205123847.39579-8-qi.z.zhang@intel.com> (raw)
In-Reply-To: <20191205123847.39579-1-qi.z.zhang@intel.com>
In ice_prot_type_to_id routine, correct the loop limit check
to use ARRAY_SIZE instead of looking for the array element to
have a specific value.
Fixes: fed0c5ca5f19 ("net/ice/base: support programming a new switch recipe")
Cc: stable@dpdk.org
Signed-off-by: Dan Nowlin <dan.nowlin@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
drivers/net/ice/base/ice_switch.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ice/base/ice_switch.c b/drivers/net/ice/base/ice_switch.c
index 3ed84ca01..b2945a9e2 100644
--- a/drivers/net/ice/base/ice_switch.c
+++ b/drivers/net/ice/base/ice_switch.c
@@ -4880,7 +4880,7 @@ static bool ice_prot_type_to_id(enum ice_protocol_type type, u16 *id)
{
u16 i;
- for (i = 0; ice_prot_id_tbl[i].type != ICE_PROTOCOL_LAST; i++)
+ for (i = 0; i < ARRAY_SIZE(ice_prot_id_tbl); i++)
if (ice_prot_id_tbl[i].type == type) {
*id = ice_prot_id_tbl[i].protocol_id;
return true;
--
2.13.6
next parent reply other threads:[~2019-12-05 12:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20191205123847.39579-1-qi.z.zhang@intel.com>
2019-12-05 12:38 ` Qi Zhang [this message]
2019-12-05 12:38 ` [dpdk-stable] [PATCH 08/12] net/ice/base: increase PF reset wait timeout Qi Zhang
[not found] ` <20200106033851.43978-1-qi.z.zhang@intel.com>
2020-01-06 3:38 ` [dpdk-stable] [PATCH v2 07/12] net/ice/base: fix loop limit Qi Zhang
2020-01-06 3:38 ` [dpdk-stable] [PATCH v2 08/12] net/ice/base: increase PF reset wait timeout Qi Zhang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191205123847.39579-8-qi.z.zhang@intel.com \
--to=qi.z.zhang@intel.com \
--cc=dan.nowlin@intel.com \
--cc=dev@dpdk.org \
--cc=paul.m.stillwell.jr@intel.com \
--cc=qiming.yang@intel.com \
--cc=stable@dpdk.org \
--cc=xiaolong.ye@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).