Skip to contentSkip to conversation

drivers: bluetooth: bfusb: Line over 80 characters in conditional stataments

PATCH In review Anchal Jain 2 participants 3 messages Sep 14, 2016 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 drivers: bluetooth: bfusb: Line over 80 characters in conditional stataments

This patch remove the warning of checkpatch.pl Line over 80 characters. to remove this warning break the conditional statements into small chunks.

---
 drivers/bluetooth/bfusb.c | 27 ++++++++++++++++++---------
 1 file changed, 18 insertions(+), 9 deletions(-)
drivers/bluetooth/bfusb.c +18 -9
index 3bf4ec6..1c2e16d 100644
@@ -148,7 +148,7 @@ static int bfusb_send_bulk(struct bfusb_data *data, struct sk_buff *skb)
 
 	err = usb_submit_urb(urb, GFP_ATOMIC);
 	if (err) {
-		BT_ERR("%s bulk tx submit failed urb %p err %d", 
+		BT_ERR("%s bulk tx submit failed urb %p err %d",
 					data->hdev->name, urb, err);
 		skb_unlink(skb, &data->pending_q);
 		usb_free_urb(urb);
@@ -289,30 +289,38 @@ static inline int bfusb_recv_block(struct bfusb_data *data, int hdr, unsigned ch
 		switch (pkt_type) {
 		case HCI_EVENT_PKT:
 			if (len >= HCI_EVENT_HDR_SIZE) {
-				struct hci_event_hdr *hdr = (struct hci_event_hdr *) buf;
+				struct hci_event_hdr *hdr = (struct
+							     hci_event_hdr *)
+							     buf;
 				pkt_len = HCI_EVENT_HDR_SIZE + hdr->plen;
 			} else {
-				BT_ERR("%s event block is too short", data->hdev->name);
+				BT_ERR("%s event block is too short",
+				       data->hdev->name);
 				return -EILSEQ;
 			}
 			break;
 
 		case HCI_ACLDATA_PKT:
 			if (len >= HCI_ACL_HDR_SIZE) {
-				struct hci_acl_hdr *hdr = (struct hci_acl_hdr *) buf;
-				pkt_len = HCI_ACL_HDR_SIZE + __le16_to_cpu(hdr->dlen);
+				struct hci_acl_hdr *hdr = (struct hci_acl_hdr *)
+							  buf;
+				pkt_len = HCI_ACL_HDR_SIZE + __le16_to_cpu
+								(hdr->dlen);
 			} else {
-				BT_ERR("%s data block is too short", data->hdev->name);
+				BT_ERR("%s data block is too short",
+				       data->hdev->name);
 				return -EILSEQ;
 			}
 			break;
 
 		case HCI_SCODATA_PKT:
 			if (len >= HCI_SCO_HDR_SIZE) {
-				struct hci_sco_hdr *hdr = (struct hci_sco_hdr *) buf;
+				struct hci_sco_hdr *hdr = (struct hci_sco_hdr *)
+							   buf;
 				pkt_len = HCI_SCO_HDR_SIZE + hdr->dlen;
 			} else {
-				BT_ERR("%s audio block is too short", data->hdev->name);
+				BT_ERR("%s audio block is too short",
+				       data->hdev->name);
 				return -EILSEQ;
 			}
 			break;
@@ -329,7 +337,8 @@ static inline int bfusb_recv_block(struct bfusb_data *data, int hdr, unsigned ch
 		data->reassembly = skb;
 	} else {
 		if (!data->reassembly) {
-			BT_ERR("%s unexpected continuation block", data->hdev->name);
+			BT_ERR("%s unexpected continuation block",
+			       data->hdev->name);
 			return -EIO;
 		}
 	}
Signature · 1 line
1.9.1
#1 lore raw
Quoted 2 lines · Anchal Jain

This patch remove the warning of checkpatch.pl Line over 80 characters. to remove this warning break the conditional statements into small chunks.

Hi,

Good try. But few things to note here:

1. For the Outreachy, it is advised to send patches in the drivers/staging only.
2. Subject of this patch is too log. May be you can say something like 'Bluetooth: bfusb: Fix line over 80 characters'
3. to -> To

Quoted 19 lines
---
 drivers/bluetooth/bfusb.c | 27 ++++++++++++++++++---------
 1 file changed, 18 insertions(+), 9 deletions(-)
drivers/bluetooth/bfusb.c +1 -1
index 3bf4ec6..1c2e16d 100644
@@ -148,7 +148,7 @@ static int bfusb_send_bulk(struct bfusb_data *data, struct sk_buff *skb)
 
        err = usb_submit_urb(urb, GFP_ATOMIC);
        if (err) {
-               BT_ERR("%s bulk tx submit failed urb %p err %d",
+               BT_ERR("%s bulk tx submit failed urb %p err %d",
                                        data->hdev->name, urb, err);
                skb_unlink(skb, &data->pending_q);
                usb_free_urb(urb);

drivers/bluetooth/bfusb.c static inline int bfusb_recv_block(struct bfusb_data *data, int hdr, unsigned ch · line 294

Quoted 7 lines
drivers/bluetooth/bfusb.c +3 -1
@@ -289,30 +289,38 @@ static inline int bfusb_recv_block(struct bfusb_data *data, int hdr, unsigned ch
                switch (pkt_type) {
                case HCI_EVENT_PKT:
                        if (len >= HCI_EVENT_HDR_SIZE) {
-                               struct hci_event_hdr *hdr = (struct hci_event_hdr *) buf;
+                               struct hci_event_hdr *hdr = (struct
+                                                            hci_event_hdr *)
+                                                            buf;

Don't you think this looks ugly after the change?

Quoted 7 lines
drivers/bluetooth/bfusb.c +2 -1
                                pkt_len = HCI_EVENT_HDR_SIZE + hdr->plen;
                        } else {
-                               BT_ERR("%s event block is too short", data->hdev->name);
+                               BT_ERR("%s event block is too short",
+                                      data->hdev->name);
                                return -EILSEQ;
                        }

drivers/bluetooth/bfusb.c static inline int bfusb_recv_block(struct bfusb_data *data, int hdr, unsigned ch · line 308

Quoted 10 lines
drivers/bluetooth/bfusb.c +4 -2
                        break;
 
                case HCI_ACLDATA_PKT:
                        if (len >= HCI_ACL_HDR_SIZE) {
-                               struct hci_acl_hdr *hdr = (struct hci_acl_hdr *) buf;
-                               pkt_len = HCI_ACL_HDR_SIZE + __le16_to_cpu(hdr->dlen);
+                               struct hci_acl_hdr *hdr = (struct hci_acl_hdr *)
+                                                         buf;
+                               pkt_len = HCI_ACL_HDR_SIZE + __le16_to_cpu
+                                                               (hdr->dlen);

Same comment for this change as well. Normally it is advisable to solve other checkpatch.pl errors/warnings than solving 80 characters one.

Quoted 40 lines
drivers/bluetooth/bfusb.c +8 -5
                        } else {
-                               BT_ERR("%s data block is too short", data->hdev->name);
+                               BT_ERR("%s data block is too short",
+                                      data->hdev->name);
                                return -EILSEQ;
                        }
                        break;
 
                case HCI_SCODATA_PKT:
                        if (len >= HCI_SCO_HDR_SIZE) {
-                               struct hci_sco_hdr *hdr = (struct hci_sco_hdr *) buf;
+                               struct hci_sco_hdr *hdr = (struct hci_sco_hdr *)
+                                                          buf;
                                pkt_len = HCI_SCO_HDR_SIZE + hdr->dlen;
                        } else {
-                               BT_ERR("%s audio block is too short", data->hdev->name);
+                               BT_ERR("%s audio block is too short",
+                                      data->hdev->name);
                                return -EILSEQ;
                        }
                        break;
@@ -329,7 +337,8 @@ static inline int bfusb_recv_block(struct bfusb_data *data, int hdr, unsigned ch
                data->reassembly = skb;
        } else {
                if (!data->reassembly) {
-                       BT_ERR("%s unexpected continuation block", data->hdev->name);
+                       BT_ERR("%s unexpected continuation block",
+                              data->hdev->name);
                        return -EIO;
                }
        }
--

1.9.1

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20160914151712.GA9806%40life-desktop.
For more options, visit https://groups.google.com/d/optout.

Signature · 2 lines
Vaishali
http://vaishalithakkar.in/
#2 lore raw

Thank you,

Gerg Inform me, To stay in staging directory I will keep this thing in my mind.

Quoted 132 lines · Vaishali Thakkar
Quoted 2 lines · Anchal Jain

This patch remove the warning of checkpatch.pl Line over 80 characters. to remove this warning break the conditional statements into small

chunks.

Hi,

Good try. But few things to note here:

1. For the Outreachy, it is advised to send patches in the drivers/staging only.
2. Subject of this patch is too log. May be you can say something like 'Bluetooth: bfusb: Fix line over 80 characters'
3. to -> To

drivers/bluetooth/bfusb.c static int bfusb_send_bulk(struct bfusb_data *data,

Quoted 10 lines
---
 drivers/bluetooth/bfusb.c | 27 ++++++++++++++++++---------
 1 file changed, 18 insertions(+), 9 deletions(-)
drivers/bluetooth/bfusb.c +0 -0
index 3bf4ec6..1c2e16d 100644
@@ -148,7 +148,7 @@ static int bfusb_send_bulk(struct bfusb_data *data,

struct sk_buff *skb)

drivers/bluetooth/bfusb.c static inline int bfusb_recv_block(struct

Quoted 9 lines
drivers/bluetooth/bfusb.c +1 -1
        err = usb_submit_urb(urb, GFP_ATOMIC);
        if (err) {
-               BT_ERR("%s bulk tx submit failed urb %p err %d",
+               BT_ERR("%s bulk tx submit failed urb %p err %d",
                                        data->hdev->name, urb, err);
                skb_unlink(skb, &data->pending_q);
                usb_free_urb(urb);
@@ -289,30 +289,38 @@ static inline int bfusb_recv_block(struct

bfusb_data *data, int hdr, unsigned ch

drivers/bluetooth/bfusb.c static inline int bfusb_recv_block(struct bfusb_data *data, int hdr, unsigned ch

Quoted 4 lines
drivers/bluetooth/bfusb.c +0 -1
                switch (pkt_type) {
                case HCI_EVENT_PKT:
                        if (len >= HCI_EVENT_HDR_SIZE) {
-                               struct hci_event_hdr *hdr = (struct

hci_event_hdr *) buf;

drivers/bluetooth/bfusb.c static inline int bfusb_recv_block(struct · line 293

Quoted 2 lines
drivers/bluetooth/bfusb.c +2 -0
+                               struct hci_event_hdr *hdr = (struct
+

hci_event_hdr *)

drivers/bluetooth/bfusb.c static inline int bfusb_recv_block(struct · line 294

Quoted 1 line
drivers/bluetooth/bfusb.c +1 -0
+                                                            buf;

Don't you think this looks ugly after the change?

drivers/bluetooth/bfusb.c static inline int bfusb_recv_block(struct bfusb_data *data, int hdr, unsigned ch

Quoted 3 lines
drivers/bluetooth/bfusb.c +0 -1
                                pkt_len = HCI_EVENT_HDR_SIZE + hdr->plen;
                        } else {
-                               BT_ERR("%s event block is too short",

data->hdev->name);

drivers/bluetooth/bfusb.c static inline int bfusb_recv_block(struct bfusb_data *data, int hdr, unsigned ch

Quoted 9 lines
drivers/bluetooth/bfusb.c +2 -1
+                               BT_ERR("%s event block is too short",
+                                      data->hdev->name);
                                return -EILSEQ;
                        }
                        break;
 
                case HCI_ACLDATA_PKT:
                        if (len >= HCI_ACL_HDR_SIZE) {
-                               struct hci_acl_hdr *hdr = (struct

hci_acl_hdr *) buf;

drivers/bluetooth/bfusb.c static inline int bfusb_recv_block(struct · line 303

Quoted 1 line
drivers/bluetooth/bfusb.c +0 -1
-                               pkt_len = HCI_ACL_HDR_SIZE +

__le16_to_cpu(hdr->dlen);

drivers/bluetooth/bfusb.c static inline int bfusb_recv_block(struct · line 305

Quoted 1 line
drivers/bluetooth/bfusb.c +1 -0
+                               struct hci_acl_hdr *hdr = (struct

hci_acl_hdr *)

drivers/bluetooth/bfusb.c static inline int bfusb_recv_block(struct · line 307

Quoted 2 lines
drivers/bluetooth/bfusb.c +2 -0
+                                                         buf;
+                               pkt_len = HCI_ACL_HDR_SIZE +

__le16_to_cpu

drivers/bluetooth/bfusb.c static inline int bfusb_recv_block(struct · line 308

Quoted 1 line
drivers/bluetooth/bfusb.c +1 -0
+

(hdr->dlen);

Same comment for this change as well. Normally it is advisable to solve other
checkpatch.pl errors/warnings than solving 80 characters one.

drivers/bluetooth/bfusb.c static inline int bfusb_recv_block(struct · line 305

Quoted 2 lines
drivers/bluetooth/bfusb.c +0 -1
                        } else {
-                               BT_ERR("%s data block is too short",

data->hdev->name);

drivers/bluetooth/bfusb.c static inline int bfusb_recv_block(struct bfusb_data *data, int hdr, unsigned ch

Quoted 9 lines
drivers/bluetooth/bfusb.c +2 -1
+                               BT_ERR("%s data block is too short",
+                                      data->hdev->name);
                                return -EILSEQ;
                        }
                        break;
 
                case HCI_SCODATA_PKT:
                        if (len >= HCI_SCO_HDR_SIZE) {
-                               struct hci_sco_hdr *hdr = (struct

hci_sco_hdr *) buf;

drivers/bluetooth/bfusb.c static inline int bfusb_recv_block(struct · line 318

Quoted 1 line
drivers/bluetooth/bfusb.c +1 -0
+                               struct hci_sco_hdr *hdr = (struct

hci_sco_hdr *)

drivers/bluetooth/bfusb.c static inline int bfusb_recv_block(struct bfusb_data *data, int hdr, unsigned ch

Quoted 4 lines
drivers/bluetooth/bfusb.c +1 -1
+                                                          buf;
                                pkt_len = HCI_SCO_HDR_SIZE + hdr->dlen;
                        } else {
-                               BT_ERR("%s audio block is too short",

data->hdev->name);

drivers/bluetooth/bfusb.c static inline int bfusb_recv_block(struct bfusb_data

Quoted 6 lines
drivers/bluetooth/bfusb.c +2 -0
+                               BT_ERR("%s audio block is too short",
+                                      data->hdev->name);
                                return -EILSEQ;
                        }
                        break;
@@ -329,7 +337,8 @@ static inline int bfusb_recv_block(struct bfusb_data

*data, int hdr, unsigned ch

drivers/bluetooth/bfusb.c static inline int bfusb_recv_block(struct bfusb_data *data, int hdr, unsigned ch

Quoted 4 lines
drivers/bluetooth/bfusb.c +0 -1
                data->reassembly = skb;
        } else {
                if (!data->reassembly) {
-                       BT_ERR("%s unexpected continuation block",

data->hdev->name);

Quoted 10 lines
drivers/bluetooth/bfusb.c +2 -1
+                       BT_ERR("%s unexpected continuation block",
+                              data->hdev->name);
                        return -EIO;
                }
        }
--

1.9.1

--
You received this message because you are subscribed to the Google

Groups "outreachy-kernel" group.

Quoted 1 line

To unsubscribe from this group and stop receiving emails from it, send

an email to [email protected].

Quoted 2 lines

To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/

msgid/outreachy-kernel/20160914151712.GA9806%40life-desktop.

Quoted 1 line

For more options, visit https://groups.google.com/d/optout.

--
Vaishali
http://vaishalithakkar.in/