iwlwifi: code cleanup to remove un-necessary "goto"
authorWey-Yi Guy <wey-yi.w.guy@intel.com>
Tue, 15 Jun 2010 00:09:56 +0000 (17:09 -0700)
committerReinette Chatre <reinette.chatre@intel.com>
Mon, 21 Jun 2010 17:47:39 +0000 (10:47 -0700)
Break out of loop and log the error message when encounter error; this is
better approach than using "goto".

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
drivers/net/wireless/iwlwifi/iwl-agn-calib.c

index d03b5e5..400eb31 100644 (file)
@@ -96,14 +96,14 @@ int iwl_send_calib_results(struct iwl_priv *priv)
                        hcmd.len = priv->calib_results[i].buf_len;
                        hcmd.data = priv->calib_results[i].buf;
                        ret = iwl_send_cmd_sync(priv, &hcmd);
-                       if (ret)
-                               goto err;
+                       if (ret) {
+                               IWL_ERR(priv, "Error %d iteration %d\n",
+                                       ret, i);
+                               break;
+                       }
                }
        }
 
-       return 0;
-err:
-       IWL_ERR(priv, "Error %d iteration %d\n", ret, i);
        return ret;
 }