linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/11] staging: wlan-ng: fix some style issues
@ 2016-11-07 17:55 Sergio Paracuellos
  2016-11-07 17:55 ` [PATCH 01/11] staging: wlan-ng: fix line style issue in macro WLAN_GET_FC_FSTYPE Sergio Paracuellos
                   ` (10 more replies)
  0 siblings, 11 replies; 15+ messages in thread
From: Sergio Paracuellos @ 2016-11-07 17:55 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-kernel

This patchset fix several style issues to comply with 
the standard kernel coding style.

Sergio Paracuellos (11):
  staging: wlan-ng: fix line style issue in macro WLAN_GET_FC_FSTYPE
  staging: wlan-ng: remove unnecessary out of memory message in
    p80211conv.c
  staging: wlan-ng: remove unnecessary parenthesis in hfa384x_usb.c
  staging: wlan-ng: replace BUG_ON() into WARN_ON() on
    hfa384x_usbin_callback
  staging: wlan-ng: match open parenthesis alignment in hfa384x_usb.c
  staging: wlan-ng: match open parenthesis alignment in p80211req.c
  staging: wlan-ng: change comparison to NULL to preferred style.
  staging: wlan-ng: remove unnecessary blank lines in p80211wep.c
  staging: wlan-ng: fix parenthesis alignment in prism2fw.c
  staging: wlan-ng: remove unnecessary blank lines in prism2fw.c
  staging: wlan-ng: remove unnecessary parenthesis in prism2fw.c

 drivers/staging/wlan-ng/hfa384x_usb.c | 47 +++++++++++++------------
 drivers/staging/wlan-ng/p80211conv.c  |  2 --
 drivers/staging/wlan-ng/p80211hdr.h   |  3 +-
 drivers/staging/wlan-ng/p80211req.c   | 10 +++---
 drivers/staging/wlan-ng/p80211wep.c   |  6 +---
 drivers/staging/wlan-ng/prism2fw.c    | 65 +++++++++++++++++------------------
 6 files changed, 64 insertions(+), 69 deletions(-)

-- 
1.9.1

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH 01/11] staging: wlan-ng: fix line style issue in macro WLAN_GET_FC_FSTYPE
  2016-11-07 17:55 [PATCH 00/11] staging: wlan-ng: fix some style issues Sergio Paracuellos
@ 2016-11-07 17:55 ` Sergio Paracuellos
  2016-11-07 18:57   ` Joe Perches
  2016-11-07 17:55 ` [PATCH 02/11] staging: wlan-ng: remove unnecessary out of memory message in p80211conv.c Sergio Paracuellos
                   ` (9 subsequent siblings)
  10 siblings, 1 reply; 15+ messages in thread
From: Sergio Paracuellos @ 2016-11-07 17:55 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-kernel

This patch fix the following checkpatch.pl script warning:
WARNING: line over 80 characters

It also add spaces between or operators inside the macro to
comply with the standard kernel coding style.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 drivers/staging/wlan-ng/p80211hdr.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/wlan-ng/p80211hdr.h b/drivers/staging/wlan-ng/p80211hdr.h
index c9b7337..c8f78d9 100644
--- a/drivers/staging/wlan-ng/p80211hdr.h
+++ b/drivers/staging/wlan-ng/p80211hdr.h
@@ -132,7 +132,8 @@
 /*------------------------------------------------------------*/
 
 #define WLAN_GET_FC_FTYPE(n)	((((u16)(n)) & (BIT(2) | BIT(3))) >> 2)
-#define WLAN_GET_FC_FSTYPE(n)	((((u16)(n)) & (BIT(4)|BIT(5)|BIT(6)|BIT(7))) >> 4)
+#define WLAN_GET_FC_FSTYPE(n)	((((u16)(n)) & \
+				(BIT(4) | BIT(5) | BIT(6) | BIT(7))) >> 4)
 #define WLAN_GET_FC_TODS(n)	((((u16)(n)) & (BIT(8))) >> 8)
 #define WLAN_GET_FC_FROMDS(n)	((((u16)(n)) & (BIT(9))) >> 9)
 #define WLAN_GET_FC_ISWEP(n)	((((u16)(n)) & (BIT(14))) >> 14)
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 02/11] staging: wlan-ng: remove unnecessary out of memory message in p80211conv.c
  2016-11-07 17:55 [PATCH 00/11] staging: wlan-ng: fix some style issues Sergio Paracuellos
  2016-11-07 17:55 ` [PATCH 01/11] staging: wlan-ng: fix line style issue in macro WLAN_GET_FC_FSTYPE Sergio Paracuellos
@ 2016-11-07 17:55 ` Sergio Paracuellos
  2016-11-07 17:55 ` [PATCH 03/11] staging: wlan-ng: remove unnecessary parenthesis in hfa384x_usb.c Sergio Paracuellos
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 15+ messages in thread
From: Sergio Paracuellos @ 2016-11-07 17:55 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-kernel

This patch fix the following checkpatch script warning:
WARNING: Possible unnecessary 'out of memory' message.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 drivers/staging/wlan-ng/p80211conv.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/wlan-ng/p80211conv.c b/drivers/staging/wlan-ng/p80211conv.c
index 5080d42..8387e6a 100644
--- a/drivers/staging/wlan-ng/p80211conv.c
+++ b/drivers/staging/wlan-ng/p80211conv.c
@@ -618,8 +618,6 @@ int p80211skb_rxmeta_attach(struct wlandevice *wlandev, struct sk_buff *skb)
 	rxmeta = kzalloc(sizeof(*rxmeta), GFP_ATOMIC);
 
 	if (!rxmeta) {
-		netdev_err(wlandev->netdev,
-			   "%s: Failed to allocate rxmeta.\n", wlandev->name);
 		result = 1;
 		goto exit;
 	}
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 03/11] staging: wlan-ng: remove unnecessary parenthesis in hfa384x_usb.c
  2016-11-07 17:55 [PATCH 00/11] staging: wlan-ng: fix some style issues Sergio Paracuellos
  2016-11-07 17:55 ` [PATCH 01/11] staging: wlan-ng: fix line style issue in macro WLAN_GET_FC_FSTYPE Sergio Paracuellos
  2016-11-07 17:55 ` [PATCH 02/11] staging: wlan-ng: remove unnecessary out of memory message in p80211conv.c Sergio Paracuellos
@ 2016-11-07 17:55 ` Sergio Paracuellos
  2016-11-07 17:55 ` [PATCH 04/11] staging: wlan-ng: replace BUG_ON() into WARN_ON() on hfa384x_usbin_callback Sergio Paracuellos
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 15+ messages in thread
From: Sergio Paracuellos @ 2016-11-07 17:55 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-kernel

This patch removes unnecessary parentheses in different statements of
hfa384x_usb.c file in order to to comply with the standard kernel
coding style.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 drivers/staging/wlan-ng/hfa384x_usb.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c b/drivers/staging/wlan-ng/hfa384x_usb.c
index a83026e..d234ed76 100644
--- a/drivers/staging/wlan-ng/hfa384x_usb.c
+++ b/drivers/staging/wlan-ng/hfa384x_usb.c
@@ -682,7 +682,7 @@ static inline int usbctlx_cmd_completor_fn(struct usbctlx_completor *head)
 	completor->head.complete = usbctlx_cmd_completor_fn;
 	completor->cmdresp = cmdresp;
 	completor->result = result;
-	return &(completor->head);
+	return &completor->head;
 }
 
 /*----------------------------------------------------------------
@@ -729,7 +729,7 @@ static int usbctlx_rrid_completor_fn(struct usbctlx_completor *head)
 	completor->rridresp = rridresp;
 	completor->riddata = riddata;
 	completor->riddatalen = riddatalen;
-	return &(completor->head);
+	return &completor->head;
 }
 
 /*----------------------------------------------------------------
@@ -779,7 +779,7 @@ static int usbctlx_rmem_completor_fn(struct usbctlx_completor *head)
 	completor->rmemresp = rmemresp;
 	completor->data = data;
 	completor->len = len;
-	return &(completor->head);
+	return &completor->head;
 }
 
 /*----------------------------------------------------------------
@@ -1836,7 +1836,7 @@ int hfa384x_drvr_flashdl_enable(struct hfa384x *hw)
 
 	/* Retrieve the buffer loc&size and timeout */
 	result = hfa384x_drvr_getconfig(hw, HFA384x_RID_DOWNLOADBUFFER,
-					&(hw->bufinfo), sizeof(hw->bufinfo));
+					&hw->bufinfo, sizeof(hw->bufinfo));
 	if (result)
 		return result;
 
@@ -1844,7 +1844,7 @@ int hfa384x_drvr_flashdl_enable(struct hfa384x *hw)
 	hw->bufinfo.offset = le16_to_cpu(hw->bufinfo.offset);
 	hw->bufinfo.len = le16_to_cpu(hw->bufinfo.len);
 	result = hfa384x_drvr_getconfig16(hw, HFA384x_RID_MAXLOADTIME,
-					  &(hw->dltimeout));
+					  &hw->dltimeout);
 	if (result)
 		return result;
 
@@ -2648,7 +2648,7 @@ int hfa384x_drvr_txframe(struct hfa384x *hw, struct sk_buff *skb,
 	    cpu_to_le16(hw->txbuff.txfrm.desc.tx_control);
 
 	/* copy the header over to the txdesc */
-	memcpy(&(hw->txbuff.txfrm.desc.frame_control), p80211_hdr,
+	memcpy(&hw->txbuff.txfrm.desc.frame_control, p80211_hdr,
 	       sizeof(union p80211_hdr));
 
 	/* if we're using host WEP, increase size by IV+ICV */
@@ -2678,9 +2678,9 @@ int hfa384x_drvr_txframe(struct hfa384x *hw, struct sk_buff *skb,
 		memcpy(ptr, p80211_wep->icv, sizeof(p80211_wep->icv));
 
 	/* Send the USB packet */
-	usb_fill_bulk_urb(&(hw->tx_urb), hw->usb,
+	usb_fill_bulk_urb(&hw->tx_urb, hw->usb,
 			  hw->endp_out,
-			  &(hw->txbuff), ROUNDUP64(usbpktlen),
+			  &hw->txbuff, ROUNDUP64(usbpktlen),
 			  hfa384x_usbout_callback, hw->wlandev);
 	hw->tx_urb.transfer_flags |= USB_QUEUE_BULK;
 
@@ -2962,9 +2962,9 @@ static void hfa384x_usbctlxq_run(struct hfa384x *hw)
 		list_move_tail(&head->list, &hw->ctlxq.active);
 
 		/* Fill the out packet */
-		usb_fill_bulk_urb(&(hw->ctlx_urb), hw->usb,
+		usb_fill_bulk_urb(&hw->ctlx_urb, hw->usb,
 				  hw->endp_out,
-				  &(head->outbuf), ROUNDUP64(head->outbufsize),
+				  &head->outbuf, ROUNDUP64(head->outbufsize),
 				  hfa384x_ctlxout_callback, hw);
 		hw->ctlx_urb.transfer_flags |= USB_QUEUE_BULK;
 
@@ -3470,7 +3470,7 @@ static void hfa384x_usbin_rx(struct wlandevice *wlandev, struct sk_buff *skb)
 static void hfa384x_int_rxmonitor(struct wlandevice *wlandev,
 				  struct hfa384x_usb_rxfrm *rxfrm)
 {
-	struct hfa384x_rx_frame *rxdesc = &(rxfrm->desc);
+	struct hfa384x_rx_frame *rxdesc = &rxfrm->desc;
 	unsigned int hdrlen = 0;
 	unsigned int datalen = 0;
 	unsigned int skblen = 0;
@@ -3528,7 +3528,7 @@ static void hfa384x_int_rxmonitor(struct wlandevice *wlandev,
 	 * (ctl frames may be less than a full header)
 	 */
 	datap = skb_put(skb, hdrlen);
-	memcpy(datap, &(rxdesc->frame_control), hdrlen);
+	memcpy(datap, &rxdesc->frame_control, hdrlen);
 
 	/* If any, copy the data from the card to the skb */
 	if (datalen > 0) {
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 04/11] staging: wlan-ng: replace BUG_ON() into WARN_ON() on hfa384x_usbin_callback
  2016-11-07 17:55 [PATCH 00/11] staging: wlan-ng: fix some style issues Sergio Paracuellos
                   ` (2 preceding siblings ...)
  2016-11-07 17:55 ` [PATCH 03/11] staging: wlan-ng: remove unnecessary parenthesis in hfa384x_usb.c Sergio Paracuellos
@ 2016-11-07 17:55 ` Sergio Paracuellos
  2016-11-07 17:55 ` [PATCH 05/11] staging: wlan-ng: match open parenthesis alignment in hfa384x_usb.c Sergio Paracuellos
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 15+ messages in thread
From: Sergio Paracuellos @ 2016-11-07 17:55 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-kernel

This patch avoids using BUG_ON() from driver,
and return from hfa384x_usbin_callback with WARN_ON()
if skb was NULL or data in skb is different from expected one.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 drivers/staging/wlan-ng/hfa384x_usb.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c b/drivers/staging/wlan-ng/hfa384x_usb.c
index d234ed76..349f122 100644
--- a/drivers/staging/wlan-ng/hfa384x_usb.c
+++ b/drivers/staging/wlan-ng/hfa384x_usb.c
@@ -3057,7 +3057,10 @@ static void hfa384x_usbin_callback(struct urb *urb)
 		goto exit;
 
 	skb = hw->rx_urb_skb;
-	BUG_ON(!skb || (skb->data != urb->transfer_buffer));
+	if (!skb || (skb->data != urb->transfer_buffer)) {
+		WARN_ON(1);
+		return;
+	}
 
 	hw->rx_urb_skb = NULL;
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 05/11] staging: wlan-ng: match open parenthesis alignment in hfa384x_usb.c
  2016-11-07 17:55 [PATCH 00/11] staging: wlan-ng: fix some style issues Sergio Paracuellos
                   ` (3 preceding siblings ...)
  2016-11-07 17:55 ` [PATCH 04/11] staging: wlan-ng: replace BUG_ON() into WARN_ON() on hfa384x_usbin_callback Sergio Paracuellos
@ 2016-11-07 17:55 ` Sergio Paracuellos
  2016-11-07 17:55 ` [PATCH 06/11] staging: wlan-ng: match open parenthesis alignment in p80211req.c Sergio Paracuellos
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 15+ messages in thread
From: Sergio Paracuellos @ 2016-11-07 17:55 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-kernel

This patch fix open parenthesis alignment in hfa384x_usb.c file to
comply with the standard kernel coding style.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 drivers/staging/wlan-ng/hfa384x_usb.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c b/drivers/staging/wlan-ng/hfa384x_usb.c
index 349f122..5f11f6e 100644
--- a/drivers/staging/wlan-ng/hfa384x_usb.c
+++ b/drivers/staging/wlan-ng/hfa384x_usb.c
@@ -676,8 +676,8 @@ static inline int usbctlx_cmd_completor_fn(struct usbctlx_completor *head)
 
 static inline struct usbctlx_completor *
 init_cmd_completor(struct usbctlx_cmd_completor *completor,
-			const struct hfa384x_usb_statusresp *cmdresp,
-			struct hfa384x_cmdresult *result)
+		   const struct hfa384x_usb_statusresp *cmdresp,
+		   struct hfa384x_cmdresult *result)
 {
 	completor->head.complete = usbctlx_cmd_completor_fn;
 	completor->cmdresp = cmdresp;
@@ -721,9 +721,9 @@ static int usbctlx_rrid_completor_fn(struct usbctlx_completor *head)
 
 static inline struct usbctlx_completor *
 init_rrid_completor(struct usbctlx_rrid_completor *completor,
-			const struct hfa384x_usb_rridresp *rridresp,
-			void *riddata,
-			unsigned int riddatalen)
+		    const struct hfa384x_usb_rridresp *rridresp,
+		    void *riddata,
+		    unsigned int riddatalen)
 {
 	completor->head.complete = usbctlx_rrid_completor_fn;
 	completor->rridresp = rridresp;
@@ -771,9 +771,9 @@ static int usbctlx_rmem_completor_fn(struct usbctlx_completor *head)
 
 static inline struct usbctlx_completor *
 init_rmem_completor(struct usbctlx_rmem_completor *completor,
-			struct hfa384x_usb_rmemresp *rmemresp,
-			void *data,
-			unsigned int len)
+		    struct hfa384x_usb_rmemresp *rmemresp,
+		    void *data,
+		    unsigned int len)
 {
 	completor->head.complete = usbctlx_rmem_completor_fn;
 	completor->rmemresp = rmemresp;
@@ -2343,7 +2343,7 @@ int hfa384x_drvr_readpda(struct hfa384x *hw, void *buf, unsigned int len)
 
 		/* units of bytes */
 		result = hfa384x_dormem_wait(hw, currpage, curroffset, buf,
-						len);
+					     len);
 
 		if (result) {
 			netdev_warn(hw->wlandev->netdev,
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 06/11] staging: wlan-ng: match open parenthesis alignment in p80211req.c
  2016-11-07 17:55 [PATCH 00/11] staging: wlan-ng: fix some style issues Sergio Paracuellos
                   ` (4 preceding siblings ...)
  2016-11-07 17:55 ` [PATCH 05/11] staging: wlan-ng: match open parenthesis alignment in hfa384x_usb.c Sergio Paracuellos
@ 2016-11-07 17:55 ` Sergio Paracuellos
  2016-11-07 17:55 ` [PATCH 07/11] staging: wlan-ng: change comparison to NULL to preferred style Sergio Paracuellos
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 15+ messages in thread
From: Sergio Paracuellos @ 2016-11-07 17:55 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-kernel

This patch fix open parenthesis alignment in p80211req.c file to
comply with the standard kernel coding style.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 drivers/staging/wlan-ng/p80211req.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/wlan-ng/p80211req.c b/drivers/staging/wlan-ng/p80211req.c
index c4d8e1b..621df98 100644
--- a/drivers/staging/wlan-ng/p80211req.c
+++ b/drivers/staging/wlan-ng/p80211req.c
@@ -75,8 +75,8 @@
 static void p80211req_handlemsg(struct wlandevice *wlandev,
 				struct p80211msg *msg);
 static void p80211req_mibset_mibget(struct wlandevice *wlandev,
-				   struct p80211msg_dot11req_mibget *mib_msg,
-				   int isget);
+				    struct p80211msg_dot11req_mibget *mib_msg,
+				    int isget);
 
 static void p80211req_handle_action(struct wlandevice *wlandev, u32 *data,
 				    int isget, u32 flag)
@@ -124,7 +124,7 @@ int p80211req_dorequest(struct wlandevice *wlandev, u8 *msgbuf)
 
 	/* Check Permissions */
 	if (!capable(CAP_NET_ADMIN) &&
-	(msg->msgcode != DIDmsg_dot11req_mibget)) {
+	    (msg->msgcode != DIDmsg_dot11req_mibget)) {
 		netdev_err(wlandev->netdev,
 			   "%s: only dot11req_mibget allowed for non-root.\n",
 			   wlandev->name);
@@ -195,8 +195,8 @@ static void p80211req_handlemsg(struct wlandevice *wlandev,
 }
 
 static void p80211req_mibset_mibget(struct wlandevice *wlandev,
-				   struct p80211msg_dot11req_mibget *mib_msg,
-				   int isget)
+				    struct p80211msg_dot11req_mibget *mib_msg,
+				    int isget)
 {
 	struct p80211itemd *mibitem = (struct p80211itemd *)mib_msg->mibattribute.data;
 	struct p80211pstrd *pstr = (struct p80211pstrd *)mibitem->data;
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 07/11] staging: wlan-ng: change comparison to NULL to preferred style.
  2016-11-07 17:55 [PATCH 00/11] staging: wlan-ng: fix some style issues Sergio Paracuellos
                   ` (5 preceding siblings ...)
  2016-11-07 17:55 ` [PATCH 06/11] staging: wlan-ng: match open parenthesis alignment in p80211req.c Sergio Paracuellos
@ 2016-11-07 17:55 ` Sergio Paracuellos
  2016-11-07 17:55 ` [PATCH 08/11] staging: wlan-ng: remove unnecessary blank lines in p80211wep.c Sergio Paracuellos
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 15+ messages in thread
From: Sergio Paracuellos @ 2016-11-07 17:55 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-kernel

Comparison to NULL could be written in preferred form.
Change it to comply with the standard kernel coding style.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 drivers/staging/wlan-ng/p80211wep.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/wlan-ng/p80211wep.c b/drivers/staging/wlan-ng/p80211wep.c
index 2e33fd7..4de7479 100644
--- a/drivers/staging/wlan-ng/p80211wep.c
+++ b/drivers/staging/wlan-ng/p80211wep.c
@@ -125,7 +125,7 @@ int wep_change_key(struct wlandevice *wlandev, int keynum, u8 *key, int keylen)
 		return -1;
 	if (keylen >= MAX_KEYLEN)
 		return -1;
-	if (key == NULL)
+	if (!key)
 		return -1;
 	if (keynum < 0)
 		return -1;
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 08/11] staging: wlan-ng: remove unnecessary blank lines in p80211wep.c
  2016-11-07 17:55 [PATCH 00/11] staging: wlan-ng: fix some style issues Sergio Paracuellos
                   ` (6 preceding siblings ...)
  2016-11-07 17:55 ` [PATCH 07/11] staging: wlan-ng: change comparison to NULL to preferred style Sergio Paracuellos
@ 2016-11-07 17:55 ` Sergio Paracuellos
  2016-11-07 17:55 ` [PATCH 09/11] staging: wlan-ng: fix parenthesis alignment in prism2fw.c Sergio Paracuellos
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 15+ messages in thread
From: Sergio Paracuellos @ 2016-11-07 17:55 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-kernel

This patch removes unnecessary blank line in p80211wep.c file to
comply with the standard kernel coding style.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 drivers/staging/wlan-ng/p80211wep.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/staging/wlan-ng/p80211wep.c b/drivers/staging/wlan-ng/p80211wep.c
index 4de7479..6492ffe 100644
--- a/drivers/staging/wlan-ng/p80211wep.c
+++ b/drivers/staging/wlan-ng/p80211wep.c
@@ -52,8 +52,6 @@
 #include <linux/wireless.h>
 #include <linux/random.h>
 #include <linux/kernel.h>
-
-
 #include "p80211hdr.h"
 #include "p80211types.h"
 #include "p80211msg.h"
@@ -132,7 +130,6 @@ int wep_change_key(struct wlandevice *wlandev, int keynum, u8 *key, int keylen)
 	if (keynum >= NUM_WEPKEYS)
 		return -1;
 
-
 	wlandev->wep_keylens[keynum] = keylen;
 	memcpy(wlandev->wep_keys[keynum], key, keylen);
 
@@ -176,7 +173,6 @@ int wep_decrypt(struct wlandevice *wlandev, u8 *buf, u32 len, int key_override,
 
 	keylen += 3;		/* add in IV bytes */
 
-
 	/* set up the RC4 state */
 	for (i = 0; i < 256; i++)
 		s[i] = i;
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 09/11] staging: wlan-ng: fix parenthesis alignment in prism2fw.c
  2016-11-07 17:55 [PATCH 00/11] staging: wlan-ng: fix some style issues Sergio Paracuellos
                   ` (7 preceding siblings ...)
  2016-11-07 17:55 ` [PATCH 08/11] staging: wlan-ng: remove unnecessary blank lines in p80211wep.c Sergio Paracuellos
@ 2016-11-07 17:55 ` Sergio Paracuellos
  2016-11-07 17:55 ` [PATCH 10/11] staging: wlan-ng: remove unnecessary blank lines " Sergio Paracuellos
  2016-11-07 17:55 ` [PATCH 11/11] staging: wlan-ng: remove unnecessary parenthesis " Sergio Paracuellos
  10 siblings, 0 replies; 15+ messages in thread
From: Sergio Paracuellos @ 2016-11-07 17:55 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-kernel

This patch fix open parenthesis alignment matching in prism2fw.c file
to comply with the standard kernel coding style.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 drivers/staging/wlan-ng/prism2fw.c | 51 ++++++++++++++++++++------------------
 1 file changed, 27 insertions(+), 24 deletions(-)

diff --git a/drivers/staging/wlan-ng/prism2fw.c b/drivers/staging/wlan-ng/prism2fw.c
index d90b1f4..fbb8be1 100644
--- a/drivers/staging/wlan-ng/prism2fw.c
+++ b/drivers/staging/wlan-ng/prism2fw.c
@@ -161,7 +161,7 @@ struct imgchunk {
 /* Local Function Declarations */
 
 static int prism2_fwapply(const struct ihex_binrec *rfptr,
-struct wlandevice *wlandev);
+			  struct wlandevice *wlandev);
 
 static int read_fwfile(const struct ihex_binrec *rfptr);
 
@@ -172,13 +172,15 @@ static int prism2_fwapply(const struct ihex_binrec *rfptr,
 static int mkpdrlist(struct pda *pda);
 
 static int plugimage(struct imgchunk *fchunk, unsigned int nfchunks,
-	      struct s3plugrec *s3plug, unsigned int ns3plug, struct pda *pda);
+		     struct s3plugrec *s3plug, unsigned int ns3plug,
+		     struct pda *pda);
 
 static int crcimage(struct imgchunk *fchunk, unsigned int nfchunks,
-	     struct s3crcrec *s3crc, unsigned int ns3crc);
+		    struct s3crcrec *s3crc, unsigned int ns3crc);
 
 static int writeimage(struct wlandevice *wlandev, struct imgchunk *fchunk,
-	       unsigned int nfchunks);
+		      unsigned int nfchunks);
+
 static void free_chunks(struct imgchunk *fchunk, unsigned int *nfchunks);
 
 static void free_srecs(void);
@@ -207,13 +209,13 @@ static int prism2_fwtry(struct usb_device *udev, struct wlandevice *wlandev)
 	const struct firmware *fw_entry = NULL;
 
 	netdev_info(wlandev->netdev, "prism2_usb: Checking for firmware %s\n",
-	       PRISM2_USB_FWFILE);
+		    PRISM2_USB_FWFILE);
 	if (request_ihex_firmware(&fw_entry,
 				  PRISM2_USB_FWFILE, &udev->dev) != 0) {
 		netdev_info(wlandev->netdev,
-		       "prism2_usb: Firmware not available, but not essential\n");
+			    "prism2_usb: Firmware not available, but not essential\n");
 		netdev_info(wlandev->netdev,
-		       "prism2_usb: can continue to use card anyway.\n");
+			    "prism2_usb: can continue to use card anyway.\n");
 		return 1;
 	}
 
@@ -397,7 +399,7 @@ static int prism2_fwapply(const struct ihex_binrec *rfptr,
  *----------------------------------------------------------------
  */
 static int crcimage(struct imgchunk *fchunk, unsigned int nfchunks,
-	     struct s3crcrec *s3crc, unsigned int ns3crc)
+		    struct s3crcrec *s3crc, unsigned int ns3crc)
 {
 	int result = 0;
 	int i;
@@ -674,7 +676,8 @@ static int mkpdrlist(struct pda *pda)
  *----------------------------------------------------------------
  */
 static int plugimage(struct imgchunk *fchunk, unsigned int nfchunks,
-	      struct s3plugrec *s3plug, unsigned int ns3plug, struct pda *pda)
+		     struct s3plugrec *s3plug, unsigned int ns3plug,
+		     struct pda *pda)
 {
 	int result = 0;
 	int i;			/* plug index */
@@ -902,8 +905,8 @@ static int read_fwfile(const struct ihex_binrec *record)
 		case S3ADDR_START:
 			startaddr = *ptr32;
 			pr_debug("  S7 start addr, record=%d addr=0x%08x\n",
-				      rcnt,
-				      startaddr);
+				 rcnt,
+				 startaddr);
 			break;
 		case S3ADDR_PLUG:
 			s3plug[ns3plug].itemcode = *ptr32;
@@ -911,10 +914,10 @@ static int read_fwfile(const struct ihex_binrec *record)
 			s3plug[ns3plug].len = *(ptr32 + 2);
 
 			pr_debug("  S3 plugrec, record=%d itemcode=0x%08x addr=0x%08x len=%d\n",
-				      rcnt,
-				      s3plug[ns3plug].itemcode,
-				      s3plug[ns3plug].addr,
-				      s3plug[ns3plug].len);
+				 rcnt,
+				 s3plug[ns3plug].itemcode,
+				 s3plug[ns3plug].addr,
+				 s3plug[ns3plug].len);
 
 			ns3plug++;
 			if (ns3plug == S3PLUG_MAX) {
@@ -928,10 +931,10 @@ static int read_fwfile(const struct ihex_binrec *record)
 			s3crc[ns3crc].dowrite = *(ptr32 + 2);
 
 			pr_debug("  S3 crcrec, record=%d addr=0x%08x len=%d write=0x%08x\n",
-				      rcnt,
-				      s3crc[ns3crc].addr,
-				      s3crc[ns3crc].len,
-				      s3crc[ns3crc].dowrite);
+				 rcnt,
+				 s3crc[ns3crc].addr,
+				 s3crc[ns3crc].len,
+				 s3crc[ns3crc].dowrite);
 			ns3crc++;
 			if (ns3crc == S3CRC_MAX) {
 				pr_err("S3 crcrec limit reached - aborting\n");
@@ -942,10 +945,10 @@ static int read_fwfile(const struct ihex_binrec *record)
 			s3info[ns3info].len = *ptr16;
 			s3info[ns3info].type = *(ptr16 + 1);
 
-			pr_debug("  S3 inforec, record=%d len=0x%04x type=0x%04x\n",
-				      rcnt,
-				      s3info[ns3info].len,
-				      s3info[ns3info].type);
+			pr_debug("  S3 inforec, record=%d len=0x%04x type=0x%04x\n",
+				 rcnt,
+				 s3info[ns3info].len,
+				 s3info[ns3info].type);
 			if (((s3info[ns3info].len - 1) * sizeof(u16)) >
 			   sizeof(s3info[ns3info].info)) {
 				pr_err("S3 inforec length too long - aborting\n");
@@ -999,7 +1002,7 @@ static int read_fwfile(const struct ihex_binrec *record)
  *----------------------------------------------------------------
  */
 static int writeimage(struct wlandevice *wlandev, struct imgchunk *fchunk,
-	       unsigned int nfchunks)
+		      unsigned int nfchunks)
 {
 	int result = 0;
 	struct p80211msg_p2req_ramdl_state *rstmsg;
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 10/11] staging: wlan-ng: remove unnecessary blank lines in prism2fw.c
  2016-11-07 17:55 [PATCH 00/11] staging: wlan-ng: fix some style issues Sergio Paracuellos
                   ` (8 preceding siblings ...)
  2016-11-07 17:55 ` [PATCH 09/11] staging: wlan-ng: fix parenthesis alignment in prism2fw.c Sergio Paracuellos
@ 2016-11-07 17:55 ` Sergio Paracuellos
  2016-11-07 17:55 ` [PATCH 11/11] staging: wlan-ng: remove unnecessary parenthesis " Sergio Paracuellos
  10 siblings, 0 replies; 15+ messages in thread
From: Sergio Paracuellos @ 2016-11-07 17:55 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-kernel

This patch removes unnecessary blank lines in prism2fw.c file to
comply with the standard kernel coding style.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 drivers/staging/wlan-ng/prism2fw.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/drivers/staging/wlan-ng/prism2fw.c b/drivers/staging/wlan-ng/prism2fw.c
index fbb8be1..a73c308 100644
--- a/drivers/staging/wlan-ng/prism2fw.c
+++ b/drivers/staging/wlan-ng/prism2fw.c
@@ -443,7 +443,6 @@ static int crcimage(struct imgchunk *fchunk, unsigned int nfchunks,
 		dest = fchunk[c].data + chunkoff;
 		*dest = 0xde;
 		*(dest + 1) = 0xc0;
-
 	}
 	return result;
 }
@@ -469,7 +468,6 @@ static void free_chunks(struct imgchunk *fchunk, unsigned int *nfchunks)
 
 	*nfchunks = 0;
 	memset(fchunk, 0, sizeof(*fchunk));
-
 }
 
 /*----------------------------------------------------------------
@@ -645,7 +643,6 @@ static int mkpdrlist(struct pda *pda)
 
 		(pda->nrec)++;
 		curroff += le16_to_cpu(pda16[curroff]) + 1;
-
 	}
 	if (curroff >= (HFA384x_PDA_LEN_MAX / 2 - 1)) {
 		pr_err("no end record found or invalid lengths in PDR data, exiting. %x %d\n",
@@ -761,7 +758,6 @@ static int plugimage(struct imgchunk *fchunk, unsigned int nfchunks,
 		}
 	}
 	return result;
-
 }
 
 /*----------------------------------------------------------------
@@ -890,7 +886,6 @@ static int read_fwfile(const struct ihex_binrec *record)
 	pr_debug("Reading fw file ...\n");
 
 	while (record) {
-
 		rcnt++;
 
 		len = be16_to_cpu(record->len);
@@ -1118,7 +1113,6 @@ static int writeimage(struct wlandevice *wlandev, struct imgchunk *fchunk,
 				result = 1;
 				goto free_result;
 			}
-
 		}
 	}
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 11/11] staging: wlan-ng: remove unnecessary parenthesis in prism2fw.c
  2016-11-07 17:55 [PATCH 00/11] staging: wlan-ng: fix some style issues Sergio Paracuellos
                   ` (9 preceding siblings ...)
  2016-11-07 17:55 ` [PATCH 10/11] staging: wlan-ng: remove unnecessary blank lines " Sergio Paracuellos
@ 2016-11-07 17:55 ` Sergio Paracuellos
  10 siblings, 0 replies; 15+ messages in thread
From: Sergio Paracuellos @ 2016-11-07 17:55 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-kernel

This patch removes unnecessary parentheses in different statements of
prism2fw.c file in order to to comply with the standard kernel
coding style.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 drivers/staging/wlan-ng/prism2fw.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/wlan-ng/prism2fw.c b/drivers/staging/wlan-ng/prism2fw.c
index a73c308..5f50f87 100644
--- a/drivers/staging/wlan-ng/prism2fw.c
+++ b/drivers/staging/wlan-ng/prism2fw.c
@@ -611,7 +611,7 @@ static int mkpdrlist(struct pda *pda)
 	curroff = 0;
 	while (curroff < (HFA384x_PDA_LEN_MAX / 2 - 1) &&
 	       le16_to_cpu(pda16[curroff + 1]) != HFA384x_PDR_END_OF_PDA) {
-		pda->rec[pda->nrec] = (struct hfa384x_pdrec *)&(pda16[curroff]);
+		pda->rec[pda->nrec] = (struct hfa384x_pdrec *)&pda16[curroff];
 
 		if (le16_to_cpu(pda->rec[pda->nrec]->code) ==
 		    HFA384x_PDR_NICID) {
@@ -649,7 +649,7 @@ static int mkpdrlist(struct pda *pda)
 		       curroff, pda->nrec);
 		return 1;
 	}
-	pda->rec[pda->nrec] = (struct hfa384x_pdrec *)&(pda16[curroff]);
+	pda->rec[pda->nrec] = (struct hfa384x_pdrec *)&pda16[curroff];
 	(pda->nrec)++;
 	return 0;
 }
@@ -754,7 +754,7 @@ static int plugimage(struct imgchunk *fchunk, unsigned int nfchunks,
 			memset(dest, 0, s3plug[i].len);
 			strncpy(dest, PRISM2_USB_FWFILE, s3plug[i].len - 1);
 		} else {	/* plug a PDR */
-			memcpy(dest, &(pda->rec[j]->data), s3plug[i].len);
+			memcpy(dest, &pda->rec[j]->data, s3plug[i].len);
 		}
 	}
 	return result;
@@ -950,7 +950,7 @@ static int read_fwfile(const struct ihex_binrec *record)
 				return 1;
 			}
 
-			tmpinfo = (u16 *)&(s3info[ns3info].info.version);
+			tmpinfo = (u16 *)&s3info[ns3info].info.version;
 			pr_debug("            info=");
 			for (i = 0; i < s3info[ns3info].len - 1; i++) {
 				tmpinfo[i] = *(ptr16 + 2 + i);
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH 01/11] staging: wlan-ng: fix line style issue in macro WLAN_GET_FC_FSTYPE
  2016-11-07 17:55 ` [PATCH 01/11] staging: wlan-ng: fix line style issue in macro WLAN_GET_FC_FSTYPE Sergio Paracuellos
@ 2016-11-07 18:57   ` Joe Perches
  2016-11-08  5:35     ` Sergio Paracuellos
  0 siblings, 1 reply; 15+ messages in thread
From: Joe Perches @ 2016-11-07 18:57 UTC (permalink / raw)
  To: Sergio Paracuellos, gregkh; +Cc: devel, linux-kernel

On Mon, 2016-11-07 at 18:55 +0100, Sergio Paracuellos wrote:
> This patch fix the following checkpatch.pl script warning:
> WARNING: line over 80 characters
> 
> It also add spaces between or operators inside the macro to
> comply with the standard kernel coding style.
[]
> diff --git a/drivers/staging/wlan-ng/p80211hdr.h b/drivers/staging/wlan-ng/p80211hdr.h
[]
> @@ -132,7 +132,8 @@
>  /*------------------------------------------------------------*/
>  
>  #define WLAN_GET_FC_FTYPE(n)	((((u16)(n)) & (BIT(2) | BIT(3))) >> 2)
> -#define WLAN_GET_FC_FSTYPE(n)	((((u16)(n)) & (BIT(4)|BIT(5)|BIT(6)|BIT(7))) >> 4)
> +#define WLAN_GET_FC_FSTYPE(n)	((((u16)(n)) & \
> +				(BIT(4) | BIT(5) | BIT(6) | BIT(7))) >> 4)

Probably better to use GENMASK

#define WLAN_GET_FC_FTYPE(n)		((((u16)(n)) & GENMASK(3, 2)) >> 2) 
#define WLAN_GET_FC_FSTYPE(n)		((((u16)(n)) & GENMASK(7, 4)) >> 4)

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 01/11] staging: wlan-ng: fix line style issue in macro WLAN_GET_FC_FSTYPE
  2016-11-07 18:57   ` Joe Perches
@ 2016-11-08  5:35     ` Sergio Paracuellos
  2016-11-10  7:26       ` Greg KH
  0 siblings, 1 reply; 15+ messages in thread
From: Sergio Paracuellos @ 2016-11-08  5:35 UTC (permalink / raw)
  To: Joe Perches, gregkh; +Cc: devel, linux-kernel

Thanks for pointing that Joe. There other files and macros where
GENMASK stuff could be applied in wlan-ng driver. Maybe it should be 
better to apply this patch as it is now and send another patch later 
which changes all of them. What do you think?

Cheers,
	Sergio Paracuellos

El 2016年11月07日 a las 19:57, Joe Perches escribió:
> On Mon, 2016-11-07 at 18:55 +0100, Sergio Paracuellos wrote:
>> This patch fix the following checkpatch.pl script warning:
>> WARNING: line over 80 characters
>>
>> It also add spaces between or operators inside the macro to
>> comply with the standard kernel coding style.
> []
>> diff --git a/drivers/staging/wlan-ng/p80211hdr.h b/drivers/staging/wlan-ng/p80211hdr.h
> []
>> @@ -132,7 +132,8 @@
>>   /*------------------------------------------------------------*/
>>
>>   #define WLAN_GET_FC_FTYPE(n)	((((u16)(n)) & (BIT(2) | BIT(3))) >> 2)
>> -#define WLAN_GET_FC_FSTYPE(n)	((((u16)(n)) & (BIT(4)|BIT(5)|BIT(6)|BIT(7))) >> 4)
>> +#define WLAN_GET_FC_FSTYPE(n)	((((u16)(n)) & \
>> +				(BIT(4) | BIT(5) | BIT(6) | BIT(7))) >> 4)
>
> Probably better to use GENMASK
>
> #define WLAN_GET_FC_FTYPE(n)		((((u16)(n)) & GENMASK(3, 2)) >> 2)
> #define WLAN_GET_FC_FSTYPE(n)		((((u16)(n)) & GENMASK(7, 4)) >> 4)
>

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 01/11] staging: wlan-ng: fix line style issue in macro WLAN_GET_FC_FSTYPE
  2016-11-08  5:35     ` Sergio Paracuellos
@ 2016-11-10  7:26       ` Greg KH
  0 siblings, 0 replies; 15+ messages in thread
From: Greg KH @ 2016-11-10  7:26 UTC (permalink / raw)
  To: Sergio Paracuellos; +Cc: Joe Perches, devel, linux-kernel

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

A: No.
Q: Should I include quotations after my reply?


http://daringfireball.net/2007/07/on_top
On Tue, Nov 08, 2016 at 06:35:36AM +0100, Sergio Paracuellos wrote:
> Thanks for pointing that Joe. There other files and macros where
> GENMASK stuff could be applied in wlan-ng driver. Maybe it should be better
> to apply this patch as it is now and send another patch later which changes
> all of them. What do you think?

Yes, that would be fine.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2016-11-10 11:33 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-07 17:55 [PATCH 00/11] staging: wlan-ng: fix some style issues Sergio Paracuellos
2016-11-07 17:55 ` [PATCH 01/11] staging: wlan-ng: fix line style issue in macro WLAN_GET_FC_FSTYPE Sergio Paracuellos
2016-11-07 18:57   ` Joe Perches
2016-11-08  5:35     ` Sergio Paracuellos
2016-11-10  7:26       ` Greg KH
2016-11-07 17:55 ` [PATCH 02/11] staging: wlan-ng: remove unnecessary out of memory message in p80211conv.c Sergio Paracuellos
2016-11-07 17:55 ` [PATCH 03/11] staging: wlan-ng: remove unnecessary parenthesis in hfa384x_usb.c Sergio Paracuellos
2016-11-07 17:55 ` [PATCH 04/11] staging: wlan-ng: replace BUG_ON() into WARN_ON() on hfa384x_usbin_callback Sergio Paracuellos
2016-11-07 17:55 ` [PATCH 05/11] staging: wlan-ng: match open parenthesis alignment in hfa384x_usb.c Sergio Paracuellos
2016-11-07 17:55 ` [PATCH 06/11] staging: wlan-ng: match open parenthesis alignment in p80211req.c Sergio Paracuellos
2016-11-07 17:55 ` [PATCH 07/11] staging: wlan-ng: change comparison to NULL to preferred style Sergio Paracuellos
2016-11-07 17:55 ` [PATCH 08/11] staging: wlan-ng: remove unnecessary blank lines in p80211wep.c Sergio Paracuellos
2016-11-07 17:55 ` [PATCH 09/11] staging: wlan-ng: fix parenthesis alignment in prism2fw.c Sergio Paracuellos
2016-11-07 17:55 ` [PATCH 10/11] staging: wlan-ng: remove unnecessary blank lines " Sergio Paracuellos
2016-11-07 17:55 ` [PATCH 11/11] staging: wlan-ng: remove unnecessary parenthesis " Sergio Paracuellos

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).