Re: [PATCHv2 net-next] cxgb4: Enhance driver to update FW, when FW is too old

From: Neil Horman <nhorman@tuxdriver.com>
Date: 2015-10-09 13:02:14

	ret = t4_get_fw_version(adap, &adap->params.fw_vers);
+	/* Try multiple times before returning error */
+	for (i = 0; (ret == -EBUSY || ret == -EAGAIN) && i < 3; i++)
+		ret = t4_get_fw_version(adap, &adap->params.fw_vers);
+
	if (ret)
		return ret;

Nit: Just initalize ret to -EBUSY and change the test for i to < 4 rather than <
3.  That way you will only have one call site for t4_get_fw_version, which I
think is more readable.  Alternatively a do..while loop might be appropriate
here.

But I suppose I'm just splitting hairs at this point

Acked-by: Neil Horman <nhorman@tuxdriver.com>

 
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help