Thread (10 messages) flat view 10 messages, 4 authors, 2013-09-24

Re: [net 5/6] i40e: better return values

From: Joe Perches <joe@perches.com>
Date: 2013-09-24 11:34:50

On Tue, 2013-09-24 at 02:45 -0700, Jeff Kirsher wrote:
quoted hunk ↗ jump to hunk
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
[]
quoted hunk ↗ jump to hunk
@@ -3339,9 +3345,7 @@ static u8 i40e_dcb_get_num_tc(struct i40e_dcbx_config *dcbcfg)
 	/* Traffic class index starts from zero so
 	 * increment to return the actual count
 	 */
-	num_tc++;
-
-	return num_tc;
+	return num_tc++;
Ick.  post_increment problem.

	return ++num_tc;

There's nothing wrong with the original code
unless this is a bugfix which should be documented
better than "better return values".
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help