[OPW,kernel,PATCHv2] staging:wlan-ng:Fix checkpatch warnings
diff mbox

Message ID 1394772489-36560-1-git-send-email-swetha.kanagala@gmail.com
State New, archived
Headers show

Commit Message

swetha.kanagala@gmail.com March 14, 2014, 4:48 a.m. UTC
From: Swetha Kanagala <swetha.kanagala@gmail.com>

Fix formating corrections to the previous patch as per the comments.

Signed-off-by: Swetha Kanagala <swetha.kanagala@gmail.com>
---
 drivers/staging/wlan-ng/prism2sta.c |  144 +++++++++++++++++------------------
 1 file changed, 72 insertions(+), 72 deletions(-)

Comments

Pablo Neira Ayuso March 14, 2014, 7:47 a.m. UTC | #1
This patch subject is too generic. Please, specify what you're indeed
fixing. Note that checkpatch can spot different many kind of problems.

Regarding the patch title:

staging: wlan-ng: patch description here
        ^        ^
BTW, we also usually add spaces between the tags".

On Fri, Mar 14, 2014 at 10:18:09AM +0530, swetha.kanagala@gmail.com wrote:
> From: Swetha Kanagala <swetha.kanagala@gmail.com>
> 
> Fix formating corrections to the previous patch as per the comments.
> 
> Signed-off-by: Swetha Kanagala <swetha.kanagala@gmail.com>
> ---
>  drivers/staging/wlan-ng/prism2sta.c |  144 +++++++++++++++++------------------
>  1 file changed, 72 insertions(+), 72 deletions(-)
> 
> diff --git a/drivers/staging/wlan-ng/prism2sta.c b/drivers/staging/wlan-ng/prism2sta.c
> index bfe51a2..8f92dff 100644
> --- a/drivers/staging/wlan-ng/prism2sta.c
> +++ b/drivers/staging/wlan-ng/prism2sta.c
> @@ -405,8 +405,8 @@ static int prism2sta_mlmerequest(wlandevice_t *wlandev, struct p80211msg *msg)
>  			break;
>  		}
>  	default:
> -		netdev_warn(wlandev->netdev
> -			, "Unknown mgmt request message 0x%08x", msg->msgcode);
> +		netdev_warn(wlandev->netdev,
> +			 "Unknown mgmt request message 0x%08x", msg->msgcode);
>  		break;
>  	}
>  
> @@ -454,9 +454,9 @@ u32 prism2sta_ifstate(wlandevice_t *wlandev, u32 ifstate)
>  			 */
>  			result = hfa384x_drvr_start(hw);
>  			if (result) {
> -				netdev_err(wlandev->netdev
> -				, "hfa384x_drvr_start() failed, result=%d\n"
> -				, (int)result);
> +				netdev_err(wlandev->netdev,
> +				 "hfa384x_drvr_start() failed, result=%d\n",
> +				 (int)result);
                                 ^^^^^^^^^^^

Another thing you could fix here:

static int prism2sta_mlmerequest(wlandevice_t *wlandev, struct p80211msg *msg)  
{
        hfa384x_t *hw = (hfa384x_t *) wlandev->priv;

        int result = 0;
        ...

result is already "int" so the casting there is unnecessary.

Better fix this in a follow-up patch that can be reviewed separately.

Thanks.
Pablo Neira Ayuso March 14, 2014, 7:50 a.m. UTC | #2
On Fri, Mar 14, 2014 at 08:47:46AM +0100, Pablo Neira Ayuso wrote:
> This patch subject is too generic. Please, specify what you're indeed
> fixing. Note that checkpatch can spot different many kind of problems.

Just to clarify this further, if you're indeed fixing many things,
then it's good if you describe what it was fixed in the patch
description (given that it won't fit in the patch title).

Patch
diff mbox

diff --git a/drivers/staging/wlan-ng/prism2sta.c b/drivers/staging/wlan-ng/prism2sta.c
index bfe51a2..8f92dff 100644
--- a/drivers/staging/wlan-ng/prism2sta.c
+++ b/drivers/staging/wlan-ng/prism2sta.c
@@ -405,8 +405,8 @@  static int prism2sta_mlmerequest(wlandevice_t *wlandev, struct p80211msg *msg)
 			break;
 		}
 	default:
-		netdev_warn(wlandev->netdev
-			, "Unknown mgmt request message 0x%08x", msg->msgcode);
+		netdev_warn(wlandev->netdev,
+			 "Unknown mgmt request message 0x%08x", msg->msgcode);
 		break;
 	}
 
@@ -454,9 +454,9 @@  u32 prism2sta_ifstate(wlandevice_t *wlandev, u32 ifstate)
 			 */
 			result = hfa384x_drvr_start(hw);
 			if (result) {
-				netdev_err(wlandev->netdev
-				, "hfa384x_drvr_start() failed, result=%d\n"
-				, (int)result);
+				netdev_err(wlandev->netdev,
+				 "hfa384x_drvr_start() failed, result=%d\n",
+				 (int)result);
 				result =
 				 P80211ENUM_resultcode_implementation_failure;
 				wlandev->msdstate = WLAN_MSD_HWPRESENT;
@@ -470,8 +470,8 @@  u32 prism2sta_ifstate(wlandevice_t *wlandev, u32 ifstate)
 			result = P80211ENUM_resultcode_success;
 			break;
 		case WLAN_MSD_RUNNING:
-			netdev_warn(wlandev->netdev
-, "Cannot enter fwload state from enable state, you must disable first.\n");
+			netdev_warn(wlandev->netdev,
+	 "Cannot enter fwload state from enable state, you must disable first.\n");
 			result = P80211ENUM_resultcode_invalid_parameters;
 			break;
 		case WLAN_MSD_HWFAIL:
@@ -499,8 +499,8 @@  u32 prism2sta_ifstate(wlandevice_t *wlandev, u32 ifstate)
 			result = hfa384x_drvr_start(hw);
 			if (result) {
 				netdev_err(wlandev->netdev,
-				 "hfa384x_drvr_start() failed, result=%d\n"
-				, (int)result);
+				 "hfa384x_drvr_start() failed, result=%d\n",
+				 (int)result);
 				result =
 				  P80211ENUM_resultcode_implementation_failure;
 				wlandev->msdstate = WLAN_MSD_HWPRESENT;
@@ -509,9 +509,9 @@  u32 prism2sta_ifstate(wlandevice_t *wlandev, u32 ifstate)
 
 			result = prism2sta_getcardinfo(wlandev);
 			if (result) {
-				netdev_err(wlandev->netdev
-				, "prism2sta_getcardinfo() failed, result=%d\n"
-				, (int)result);
+				netdev_err(wlandev->netdev,
+				 "prism2sta_getcardinfo() failed, result=%d\n",
+				 (int)result);
 				result =
 				  P80211ENUM_resultcode_implementation_failure;
 				hfa384x_drvr_stop(hw);
@@ -520,9 +520,9 @@  u32 prism2sta_ifstate(wlandevice_t *wlandev, u32 ifstate)
 			}
 			result = prism2sta_globalsetup(wlandev);
 			if (result) {
-				netdev_err(wlandev->netdev
-				, "prism2sta_globalsetup() failed, result=%d\n"
-				, (int)result);
+				netdev_err(wlandev->netdev,
+				 "prism2sta_globalsetup() failed, result=%d\n",
+				 (int)result);
 				result =
 				  P80211ENUM_resultcode_implementation_failure;
 				hfa384x_drvr_stop(hw);
@@ -681,13 +681,13 @@  static int prism2sta_getcardinfo(wlandevice_t *wlandev)
 	hw->ident_sta_fw.variant &= ~((u16) (BIT(14) | BIT(15)));
 
 	if (hw->ident_sta_fw.id == 0x1f) {
-		netdev_info(wlandev->netdev
-		       , "ident: sta f/w: id=0x%02x %d.%d.%d\n",
+		netdev_info(wlandev->netdev,
+			 "ident: sta f/w: id=0x%02x %d.%d.%d\n",
 		       hw->ident_sta_fw.id, hw->ident_sta_fw.major,
 		       hw->ident_sta_fw.minor, hw->ident_sta_fw.variant);
 	} else {
-		netdev_info(wlandev->netdev
-		       , "ident:  ap f/w: id=0x%02x %d.%d.%d\n",
+		netdev_info(wlandev->netdev,
+			 "ident:  ap f/w: id=0x%02x %d.%d.%d\n",
 		       hw->ident_sta_fw.id, hw->ident_sta_fw.major,
 		       hw->ident_sta_fw.minor, hw->ident_sta_fw.variant);
 		netdev_err(wlandev->netdev, "Unsupported Tertiary AP firmeare loaded!\n");
@@ -711,8 +711,8 @@  static int prism2sta_getcardinfo(wlandevice_t *wlandev)
 	hw->cap_sup_mfi.bottom = le16_to_cpu(hw->cap_sup_mfi.bottom);
 	hw->cap_sup_mfi.top = le16_to_cpu(hw->cap_sup_mfi.top);
 
-	netdev_info(wlandev->netdev
-	       , "MFI:SUP:role=0x%02x:id=0x%02x:var=0x%02x:b/t=%d/%d\n",
+	netdev_info(wlandev->netdev,
+		 "MFI:SUP:role=0x%02x:id=0x%02x:var=0x%02x:b/t=%d/%d\n",
 	       hw->cap_sup_mfi.role, hw->cap_sup_mfi.id,
 	       hw->cap_sup_mfi.variant, hw->cap_sup_mfi.bottom,
 	       hw->cap_sup_mfi.top);
@@ -734,8 +734,8 @@  static int prism2sta_getcardinfo(wlandevice_t *wlandev)
 	hw->cap_sup_cfi.bottom = le16_to_cpu(hw->cap_sup_cfi.bottom);
 	hw->cap_sup_cfi.top = le16_to_cpu(hw->cap_sup_cfi.top);
 
-	netdev_info(wlandev->netdev
-	       , "CFI:SUP:role=0x%02x:id=0x%02x:var=0x%02x:b/t=%d/%d\n",
+	netdev_info(wlandev->netdev,
+		 "CFI:SUP:role=0x%02x:id=0x%02x:var=0x%02x:b/t=%d/%d\n",
 	       hw->cap_sup_cfi.role, hw->cap_sup_cfi.id,
 	       hw->cap_sup_cfi.variant, hw->cap_sup_cfi.bottom,
 	       hw->cap_sup_cfi.top);
@@ -757,8 +757,8 @@  static int prism2sta_getcardinfo(wlandevice_t *wlandev)
 	hw->cap_sup_pri.bottom = le16_to_cpu(hw->cap_sup_pri.bottom);
 	hw->cap_sup_pri.top = le16_to_cpu(hw->cap_sup_pri.top);
 
-	netdev_info(wlandev->netdev
-	       , "PRI:SUP:role=0x%02x:id=0x%02x:var=0x%02x:b/t=%d/%d\n",
+	netdev_info(wlandev->netdev,
+		 "PRI:SUP:role=0x%02x:id=0x%02x:var=0x%02x:b/t=%d/%d\n",
 	       hw->cap_sup_pri.role, hw->cap_sup_pri.id,
 	       hw->cap_sup_pri.variant, hw->cap_sup_pri.bottom,
 	       hw->cap_sup_pri.top);
@@ -781,14 +781,14 @@  static int prism2sta_getcardinfo(wlandevice_t *wlandev)
 	hw->cap_sup_sta.top = le16_to_cpu(hw->cap_sup_sta.top);
 
 	if (hw->cap_sup_sta.id == 0x04) {
-		netdev_info(wlandev->netdev
-		       , "STA:SUP:role=0x%02x:id=0x%02x:var=0x%02x:b/t=%d/%d\n",
+		netdev_info(wlandev->netdev,
+			 "STA:SUP:role=0x%02x:id=0x%02x:var=0x%02x:b/t=%d/%d\n",
 		       hw->cap_sup_sta.role, hw->cap_sup_sta.id,
 		       hw->cap_sup_sta.variant, hw->cap_sup_sta.bottom,
 		       hw->cap_sup_sta.top);
 	} else {
-		netdev_info(wlandev->netdev
-		       , "AP:SUP:role=0x%02x:id=0x%02x:var=0x%02x:b/t=%d/%d\n",
+		netdev_info(wlandev->netdev,
+			 "AP:SUP:role=0x%02x:id=0x%02x:var=0x%02x:b/t=%d/%d\n",
 		       hw->cap_sup_sta.role, hw->cap_sup_sta.id,
 		       hw->cap_sup_sta.variant, hw->cap_sup_sta.bottom,
 		       hw->cap_sup_sta.top);
@@ -811,8 +811,8 @@  static int prism2sta_getcardinfo(wlandevice_t *wlandev)
 	hw->cap_act_pri_cfi.bottom = le16_to_cpu(hw->cap_act_pri_cfi.bottom);
 	hw->cap_act_pri_cfi.top = le16_to_cpu(hw->cap_act_pri_cfi.top);
 
-	netdev_info(wlandev->netdev
-	       , "PRI-CFI:ACT:role=0x%02x:id=0x%02x:var=0x%02x:b/t=%d/%d\n",
+	netdev_info(wlandev->netdev,
+		 "PRI-CFI:ACT:role=0x%02x:id=0x%02x:var=0x%02x:b/t=%d/%d\n",
 	       hw->cap_act_pri_cfi.role, hw->cap_act_pri_cfi.id,
 	       hw->cap_act_pri_cfi.variant, hw->cap_act_pri_cfi.bottom,
 	       hw->cap_act_pri_cfi.top);
@@ -834,8 +834,8 @@  static int prism2sta_getcardinfo(wlandevice_t *wlandev)
 	hw->cap_act_sta_cfi.bottom = le16_to_cpu(hw->cap_act_sta_cfi.bottom);
 	hw->cap_act_sta_cfi.top = le16_to_cpu(hw->cap_act_sta_cfi.top);
 
-	netdev_info(wlandev->netdev
-	       , "STA-CFI:ACT:role=0x%02x:id=0x%02x:var=0x%02x:b/t=%d/%d\n",
+	netdev_info(wlandev->netdev,
+		 "STA-CFI:ACT:role=0x%02x:id=0x%02x:var=0x%02x:b/t=%d/%d\n",
 	       hw->cap_act_sta_cfi.role, hw->cap_act_sta_cfi.id,
 	       hw->cap_act_sta_cfi.variant, hw->cap_act_sta_cfi.bottom,
 	       hw->cap_act_sta_cfi.top);
@@ -857,8 +857,8 @@  static int prism2sta_getcardinfo(wlandevice_t *wlandev)
 	hw->cap_act_sta_mfi.bottom = le16_to_cpu(hw->cap_act_sta_mfi.bottom);
 	hw->cap_act_sta_mfi.top = le16_to_cpu(hw->cap_act_sta_mfi.top);
 
-	netdev_info(wlandev->netdev
-	       , "STA-MFI:ACT:role=0x%02x:id=0x%02x:var=0x%02x:b/t=%d/%d\n",
+	netdev_info(wlandev->netdev,
+		 "STA-MFI:ACT:role=0x%02x:id=0x%02x:var=0x%02x:b/t=%d/%d\n",
 	       hw->cap_act_sta_mfi.role, hw->cap_act_sta_mfi.id,
 	       hw->cap_act_sta_mfi.variant, hw->cap_act_sta_mfi.bottom,
 	       hw->cap_act_sta_mfi.top);
@@ -1073,8 +1073,8 @@  static void prism2sta_inf_scanresults(wlandevice_t *wlandev,
 			 sr->result[i].chid,
 			 sr->result[i].anl,
 			 sr->result[i].sl, sr->result[i].bcnint);
-		netdev_dbg(wlandev->netdev
-			, "  capinfo=0x%04x proberesp_rate=%d\n",
+		netdev_dbg(wlandev->netdev,
+			 "  capinfo=0x%04x proberesp_rate=%d\n",
 			 sr->result[i].capinfo, sr->result[i].proberesp_rate);
 	}
 	/* issue a join request */
@@ -1084,8 +1084,8 @@  static void prism2sta_inf_scanresults(wlandevice_t *wlandev,
 					HFA384x_RID_JOINREQUEST,
 					&joinreq, HFA384x_RID_JOINREQUEST_LEN);
 	if (result) {
-		netdev_err(wlandev->netdev
-		, "setconfig(joinreq) failed, result=%d\n", result);
+		netdev_err(wlandev->netdev,
+		 "setconfig(joinreq) failed, result=%d\n", result);
 	}
 }
 
@@ -1176,8 +1176,8 @@  static void prism2sta_inf_chinforesults(wlandevice_t *wlandev,
 		chinforesult->pnl = le16_to_cpu(result->pnl);
 		chinforesult->active = le16_to_cpu(result->active);
 
-		netdev_dbg(wlandev->netdev
-		, "chinfo: channel %d, %s level (avg/peak)=%d/%d dB, pcf %d\n",
+		netdev_dbg(wlandev->netdev,
+		 "chinfo: channel %d, %s level (avg/peak)=%d/%d dB, pcf %d\n",
 			 chan + 1,
 			 (chinforesult->active & HFA384x_CHINFORESULT_BSSACTIVE)
 				? "signal" : "noise",
@@ -1226,8 +1226,8 @@  void prism2sta_processing_defer(struct work_struct *data)
 		 */
 		netif_carrier_off(wlandev->netdev);
 
-		netdev_info(wlandev->netdev
-		, "linkstatus=NOTCONNECTED (unhandled)\n");
+		netdev_info(wlandev->netdev,
+		 "linkstatus=NOTCONNECTED (unhandled)\n");
 		break;
 
 	case HFA384x_LINK_CONNECTED:
@@ -1264,8 +1264,8 @@  void prism2sta_processing_defer(struct work_struct *data)
 						wlandev->bssid,
 						WLAN_BSSID_LEN);
 			if (result) {
-				netdev_dbg(wlandev->netdev
-				   , "getconfig(0x%02x) failed, result = %d\n",
+				netdev_dbg(wlandev->netdev,
+				    "getconfig(0x%02x) failed, result = %d\n",
 				     HFA384x_RID_CURRENTBSSID, result);
 				return;
 			}
@@ -1274,8 +1274,8 @@  void prism2sta_processing_defer(struct work_struct *data)
 							HFA384x_RID_CURRENTSSID,
 							&ssid, sizeof(ssid));
 			if (result) {
-				netdev_dbg(wlandev->netdev
-				    , "getconfig(0x%02x) failed, result = %d\n",
+				netdev_dbg(wlandev->netdev,
+				     "getconfig(0x%02x) failed, result = %d\n",
 				     HFA384x_RID_CURRENTSSID, result);
 				return;
 			}
@@ -1288,8 +1288,8 @@  void prism2sta_processing_defer(struct work_struct *data)
 							HFA384x_RID_PORTSTATUS,
 							&portstatus);
 			if (result) {
-				netdev_dbg(wlandev->netdev
-				, "getconfig(0x%02x) failed, result = %d\n",
+				netdev_dbg(wlandev->netdev,
+				 "getconfig(0x%02x) failed, result = %d\n",
 				     HFA384x_RID_PORTSTATUS, result);
 				return;
 			}
@@ -1316,8 +1316,8 @@  void prism2sta_processing_defer(struct work_struct *data)
 		 * Block Transmits, Ignore receives of data frames
 		 */
 		if (wlandev->netdev->type == ARPHRD_ETHER)
-			netdev_info(wlandev->netdev
-			       , "linkstatus=DISCONNECTED (unhandled)\n");
+			netdev_info(wlandev->netdev,
+			 "linkstatus=DISCONNECTED (unhandled)\n");
 		wlandev->macmode = WLAN_MACMODE_NONE;
 
 		netif_carrier_off(wlandev->netdev);
@@ -1421,8 +1421,8 @@  void prism2sta_processing_defer(struct work_struct *data)
 					       HFA384x_RID_JOINREQUEST,
 					       &joinreq,
 					       HFA384x_RID_JOINREQUEST_LEN);
-			netdev_info(wlandev->netdev
-			       , "linkstatus=ASSOCFAIL (re-submitting join)\n");
+			netdev_info(wlandev->netdev,
+			 "linkstatus=ASSOCFAIL (re-submitting join)\n");
 		} else {
 			netdev_info(wlandev->netdev, "linkstatus=ASSOCFAIL (unhandled)\n");
 		}
@@ -1518,16 +1518,16 @@  static void prism2sta_inf_assocstatus(wlandevice_t *wlandev,
 
 	if (i >= hw->authlist.cnt) {
 		if (rec.assocstatus != HFA384x_ASSOCSTATUS_AUTHFAIL)
-			netdev_warn(wlandev->netdev
-	, "assocstatus info frame received for non-authenticated station.\n");
+			netdev_warn(wlandev->netdev,
+	 "assocstatus info frame received for non-authenticated station.\n");
 	} else {
 		hw->authlist.assoc[i] =
 		    (rec.assocstatus == HFA384x_ASSOCSTATUS_STAASSOC ||
 		     rec.assocstatus == HFA384x_ASSOCSTATUS_REASSOC);
 
 		if (rec.assocstatus == HFA384x_ASSOCSTATUS_AUTHFAIL)
-			netdev_warn(wlandev->netdev
-, "authfail assocstatus info frame received for authenticated station.\n");
+			netdev_warn(wlandev->netdev,
+	 "authfail assocstatus info frame received for authenticated station.\n");
 	}
 }
 
@@ -1981,15 +1981,15 @@  void prism2sta_commsqual_defer(struct work_struct *data)
 				&hw->qual, HFA384x_RID_DBMCOMMSQUALITY_LEN);
 
 		if (result) {
-			netdev_err(wlandev->netdev
-				, "error fetching commsqual\n");
+			netdev_err(wlandev->netdev,
+				 "error fetching commsqual\n");
 			return;
 		}
 
-		netdev_dbg(wlandev->netdev, "commsqual %d %d %d\n"
-			 , le16_to_cpu(hw->qual.CQ_currBSS)
-			 ,  le16_to_cpu(hw->qual.ASL_currBSS)
-			 , le16_to_cpu(hw->qual.ANL_currFC));
+		netdev_dbg(wlandev->netdev, "commsqual %d %d %d\n",
+			  le16_to_cpu(hw->qual.CQ_currBSS),
+			  le16_to_cpu(hw->qual.ASL_currBSS),
+			  le16_to_cpu(hw->qual.ANL_currFC));
 	}
 
 	/* Get the signal rate */
@@ -1998,8 +1998,8 @@  void prism2sta_commsqual_defer(struct work_struct *data)
 	result = p80211req_dorequest(wlandev, (u8 *) &msg);
 
 	if (result) {
-		netdev_dbg(wlandev->netdev
-			, "get signal rate failed, result = %d\n", result);
+		netdev_dbg(wlandev->netdev,
+			 "get signal rate failed, result = %d\n", result);
 		return;
 	}
 
@@ -2017,8 +2017,8 @@  void prism2sta_commsqual_defer(struct work_struct *data)
 		hw->txrate = 110;
 		break;
 	default:
-		netdev_dbg(wlandev->netdev, "Bad ratebit (%d)\n"
-				, mibitem->data);
+		netdev_dbg(wlandev->netdev, "Bad ratebit (%d)\n",
+				 mibitem->data);
 	}
 
 	/* Lastly, we need to make sure the BSSID didn't change on us */
@@ -2026,8 +2026,8 @@  void prism2sta_commsqual_defer(struct work_struct *data)
 					HFA384x_RID_CURRENTBSSID,
 					wlandev->bssid, WLAN_BSSID_LEN);
 	if (result) {
-		netdev_dbg(wlandev->netdev
-				 , "getconfig(0x%02x) failed, result = %d\n",
+		netdev_dbg(wlandev->netdev,
+				  "getconfig(0x%02x) failed, result = %d\n",
 				 HFA384x_RID_CURRENTBSSID, result);
 		return;
 	}
@@ -2036,9 +2036,9 @@  void prism2sta_commsqual_defer(struct work_struct *data)
 					HFA384x_RID_CURRENTSSID,
 					&ssid, sizeof(ssid));
 	if (result) {
-		netdev_dbg(wlandev->netdev
-		, "getconfig(0x%02x) failed,result = %d\n"
-		, HFA384x_RID_CURRENTSSID, result);
+		netdev_dbg(wlandev->netdev,
+		 "getconfig(0x%02x) failed,result = %d\n",
+		 HFA384x_RID_CURRENTSSID, result);
 		return;
 	}
 	prism2mgmt_bytestr2pstr((struct hfa384x_bytestr *) &ssid,