Commit ddf434ac authored by Jesse Brandeburg's avatar Jesse Brandeburg Committed by Jeff Kirsher

i40e: small clean ups from review

As mentioned by Joe Perches clean up a loop flow.
Signed-off-by: default avatarJesse Brandeburg <jesse.brandeburg@intel.com>
CC: Joe Perches <joe@perches.com>
Tested-by: default avatarKavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 93bc73b8
...@@ -174,8 +174,7 @@ static int i40e_get_lump(struct i40e_pf *pf, struct i40e_lump_tracking *pile, ...@@ -174,8 +174,7 @@ static int i40e_get_lump(struct i40e_pf *pf, struct i40e_lump_tracking *pile,
u16 needed, u16 id) u16 needed, u16 id)
{ {
int ret = -ENOMEM; int ret = -ENOMEM;
int i = 0; int i, j;
int j = 0;
if (!pile || needed == 0 || id >= I40E_PILE_VALID_BIT) { if (!pile || needed == 0 || id >= I40E_PILE_VALID_BIT) {
dev_info(&pf->pdev->dev, dev_info(&pf->pdev->dev,
...@@ -186,7 +185,7 @@ static int i40e_get_lump(struct i40e_pf *pf, struct i40e_lump_tracking *pile, ...@@ -186,7 +185,7 @@ static int i40e_get_lump(struct i40e_pf *pf, struct i40e_lump_tracking *pile,
/* start the linear search with an imperfect hint */ /* start the linear search with an imperfect hint */
i = pile->search_hint; i = pile->search_hint;
while (i < pile->num_entries && ret < 0) { while (i < pile->num_entries) {
/* skip already allocated entries */ /* skip already allocated entries */
if (pile->list[i] & I40E_PILE_VALID_BIT) { if (pile->list[i] & I40E_PILE_VALID_BIT) {
i++; i++;
...@@ -205,6 +204,7 @@ static int i40e_get_lump(struct i40e_pf *pf, struct i40e_lump_tracking *pile, ...@@ -205,6 +204,7 @@ static int i40e_get_lump(struct i40e_pf *pf, struct i40e_lump_tracking *pile,
pile->list[i+j] = id | I40E_PILE_VALID_BIT; pile->list[i+j] = id | I40E_PILE_VALID_BIT;
ret = i; ret = i;
pile->search_hint = i + j; pile->search_hint = i + j;
break;
} else { } else {
/* not enough, so skip over it and continue looking */ /* not enough, so skip over it and continue looking */
i += j; i += j;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment