mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2025-01-18 11:54:37 +08:00
i40e: small clean ups from review
As mentioned by Joe Perches clean up a loop flow. Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com> CC: Joe Perches <joe@perches.com> Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
This commit is contained in:
parent
93bc73b827
commit
ddf434acc0
@ -174,8 +174,7 @@ static int i40e_get_lump(struct i40e_pf *pf, struct i40e_lump_tracking *pile,
|
||||
u16 needed, u16 id)
|
||||
{
|
||||
int ret = -ENOMEM;
|
||||
int i = 0;
|
||||
int j = 0;
|
||||
int i, j;
|
||||
|
||||
if (!pile || needed == 0 || id >= I40E_PILE_VALID_BIT) {
|
||||
dev_info(&pf->pdev->dev,
|
||||
@ -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 */
|
||||
i = pile->search_hint;
|
||||
while (i < pile->num_entries && ret < 0) {
|
||||
while (i < pile->num_entries) {
|
||||
/* skip already allocated entries */
|
||||
if (pile->list[i] & I40E_PILE_VALID_BIT) {
|
||||
i++;
|
||||
@ -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;
|
||||
ret = i;
|
||||
pile->search_hint = i + j;
|
||||
break;
|
||||
} else {
|
||||
/* not enough, so skip over it and continue looking */
|
||||
i += j;
|
||||
|
Loading…
Reference in New Issue
Block a user