Subject: Re: [PATCH v2 1/2] i40e: Add helper for VF inited state check with timeout

From: Jakub Kicinski <[email-masked]>
Date: Wed, 12 Jul 2023 12:36:13 -0700

On Wed, 12 Jul 2023 15:32:46 +0200 Ivan Vecera wrote:
> +	for (i = 0; i < 15; i++)
> +		if (!test_bit(I40E_VF_STATE_INIT, &vf->vf_states))
> +			msleep(20);
> +
> +	if (!test_bit(I40E_VF_STATE_INIT, &vf->vf_states)) {
> +		dev_err(&vf->pf->pdev->dev,
> +			"VF %d still in reset. Try again.\n", vf->vf_id);
> +		return false;

I like my loop more but if you want to have the msleep() indented just
add an else { return true; } branch. Take advantage of the fact this is
a function, now, and you can just return.