Skip to contentSkip to conversation

Staging: wlan-ng: hfa384x_usb.c Fixed too long code line warnings.

PATCH Superseded Yan Laijun 3 participants 5 messages Nov 30, 2016 – Dec 2, 2016 Staging

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Yan Laijun

author
#0 lore raw

PATCH 1/1 Staging: wlan-ng: hfa384x_usb.c Fixed too long code line warnings.

Fixed checkpatch warning "line over 80 characters" in wlan-ng/hfa384x_usb.c file.

---
 drivers/staging/wlan-ng/hfa384x_usb.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/staging/wlan-ng/hfa384x_usb.c +2 -1
index 5f11f6e..3447fc5 100644
@@ -3037,7 +3037,7 @@ static void hfa384x_usbin_callback(struct urb *urb)
 {
 	struct wlandevice *wlandev = urb->context;
 	struct hfa384x *hw;
-	union hfa384x_usbin *usbin = (union hfa384x_usbin *)urb->transfer_buffer;
+	union hfa384x_usbin *usbin = NULL;
 	struct sk_buff *skb = NULL;
 	int result;
 	int urb_status;
@@ -3049,6 +3049,7 @@ static void hfa384x_usbin_callback(struct urb *urb)
 		ABORT
 	} action;
 
+	usbin = (union hfa384x_usbin *)urb->transfer_buffer;
 	if (!wlandev || !wlandev->netdev || wlandev->hwremoved)
 		goto exit;
 
Signature · 1 line
1.9.1
maintainer
#1 lore raw
Quoted 13 lines · Yan Laijun

Fixed checkpatch warning "line over 80 characters" in wlan-ng/hfa384x_usb.c file.

---
 drivers/staging/wlan-ng/hfa384x_usb.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/staging/wlan-ng/hfa384x_usb.c +0 -0
index 5f11f6e..3447fc5 100644

drivers/staging/wlan-ng/hfa384x_usb.c static void hfa384x_usbin_callback(struct urb *urb) · line 3040

Quoted 5 lines
drivers/staging/wlan-ng/hfa384x_usb.c +1 -1
@@ -3037,7 +3037,7 @@ static void hfa384x_usbin_callback(struct urb *urb)
 {
 	struct wlandevice *wlandev = urb->context;
 	struct hfa384x *hw;
-	union hfa384x_usbin *usbin = (union hfa384x_usbin *)urb->transfer_buffer;
+	union hfa384x_usbin *usbin = NULL;

Why set this to NULL if you then assign it to something else a few lines later?

thanks,

greg k-h

author
#2 lore raw

Remove initialization of usbin on its decarlation.

Yan Laijun (1):
Staging: wlan-ng: hfa384x_usb.c Fixed too long code line warnings.

 drivers/staging/wlan-ng/hfa384x_usb.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Signature · 1 line
1.9.1
author
#3 lore raw

PATCH v2 1/1 staging: wlan-ng: Fixed too long code line warnings.

Fixed checkpatch warning "line over 80 characters" in wlan-ng/hfa384x_usb.c file.

---
Changes in v2:
- Remove initialization of usbin on its decarlation.

---
 drivers/staging/wlan-ng/hfa384x_usb.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/staging/wlan-ng/hfa384x_usb.c +2 -1
index 5f11f6e..c7bda04 100644
@@ -3037,7 +3037,7 @@ static void hfa384x_usbin_callback(struct urb *urb)
 {
 	struct wlandevice *wlandev = urb->context;
 	struct hfa384x *hw;
-	union hfa384x_usbin *usbin = (union hfa384x_usbin *)urb->transfer_buffer;
+	union hfa384x_usbin *usbin;
 	struct sk_buff *skb = NULL;
 	int result;
 	int urb_status;
@@ -3049,6 +3049,7 @@ static void hfa384x_usbin_callback(struct urb *urb)
 		ABORT
 	} action;
 
+	usbin = (union hfa384x_usbin *)urb->transfer_buffer;
 	if (!wlandev || !wlandev->netdev || wlandev->hwremoved)
 		goto exit;
 
Signature · 1 line
1.9.1
#4 lore raw

Re: [PATCH v2] staging: wlan-ng: Fixed too long code line warnings.

Quoted 26 lines · Yan Laijun

Fixed checkpatch warning "line over 80 characters" in wlan-ng/hfa384x_usb.c file.

---
Changes in v2:
- Remove initialization of usbin on its decarlation.

---
 drivers/staging/wlan-ng/hfa384x_usb.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/staging/wlan-ng/hfa384x_usb.c +1 -1
index 5f11f6e..c7bda04 100644
@@ -3037,7 +3037,7 @@ static void hfa384x_usbin_callback(struct urb *urb)
 {
 	struct wlandevice *wlandev = urb->context;
 	struct hfa384x *hw;
-	union hfa384x_usbin *usbin = (union hfa384x_usbin *)urb->transfer_buffer;
+	union hfa384x_usbin *usbin;
 	struct sk_buff *skb = NULL;
 	int result;
 	int urb_status;

drivers/staging/wlan-ng/hfa384x_usb.c static void hfa384x_usbin_callback(struct urb *urb) · line 3055

Quoted 7 lines
drivers/staging/wlan-ng/hfa384x_usb.c +1 -0
@@ -3049,6 +3049,7 @@ static void hfa384x_usbin_callback(struct urb *urb)
 		ABORT
 	} action;
 
+	usbin = (union hfa384x_usbin *)urb->transfer_buffer;
 	if (!wlandev || !wlandev->netdev || wlandev->hwremoved)
 		goto exit;
 

If you separate declaration and assignment of usbin, maybe it makes sense to move the assignment down to where usbin is used for the first time.

Regards,
Markus