* [PATCH 1/3] drivers: bluetooth: bfusb: Line over 80 characters in conditional stataments
@ 2016-09-14 15:18 Anchal Jain
2016-09-14 16:27 ` [Outreachy kernel] " Vaishali Thakkar
0 siblings, 1 reply; 3+ messages in thread
From: Anchal Jain @ 2016-09-14 15:18 UTC (permalink / raw)
To: marcel; +Cc: outreachy-kernel, gustavo
This patch remove the warning of checkpatch.pl Line over 80 characters.
to remove this warning break the conditional statements into small chunks.
Signed-off-by: Anchal Jain <anchalj109@gmail.com>
---
drivers/bluetooth/bfusb.c | 27 ++++++++++++++++++---------
1 file changed, 18 insertions(+), 9 deletions(-)
diff --git a/drivers/bluetooth/bfusb.c b/drivers/bluetooth/bfusb.c
index 3bf4ec6..1c2e16d 100644
--- a/drivers/bluetooth/bfusb.c
+++ b/drivers/bluetooth/bfusb.c
@@ -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;
}
}
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Outreachy kernel] [PATCH 1/3] drivers: bluetooth: bfusb: Line over 80 characters in conditional stataments
2016-09-14 15:18 [PATCH 1/3] drivers: bluetooth: bfusb: Line over 80 characters in conditional stataments Anchal Jain
@ 2016-09-14 16:27 ` Vaishali Thakkar
2016-09-14 17:49 ` Anchal Jain
0 siblings, 1 reply; 3+ messages in thread
From: Vaishali Thakkar @ 2016-09-14 16:27 UTC (permalink / raw)
To: Anchal Jain; +Cc: Marcel Holtmann, outreachy-kernel, gustavo
On Wed, Sep 14, 2016 at 8:48 PM, Anchal Jain <anchalj109@gmail.com> wrote:
> 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
> Signed-off-by: Anchal Jain <anchalj109@gmail.com>
> ---
> drivers/bluetooth/bfusb.c | 27 ++++++++++++++++++---------
> 1 file changed, 18 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/bluetooth/bfusb.c b/drivers/bluetooth/bfusb.c
> index 3bf4ec6..1c2e16d 100644
> --- a/drivers/bluetooth/bfusb.c
> +++ b/drivers/bluetooth/bfusb.c
> @@ -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;
Don't you think this looks ugly after the change?
> 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);
Same comment for this change as well. Normally it is advisable to solve other
checkpatch.pl errors/warnings than solving 80 characters one.
> } 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 outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> 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.
--
Vaishali
http://vaishalithakkar.in/
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Outreachy kernel] [PATCH 1/3] drivers: bluetooth: bfusb: Line over 80 characters in conditional stataments
2016-09-14 16:27 ` [Outreachy kernel] " Vaishali Thakkar
@ 2016-09-14 17:49 ` Anchal Jain
0 siblings, 0 replies; 3+ messages in thread
From: Anchal Jain @ 2016-09-14 17:49 UTC (permalink / raw)
To: Vaishali Thakkar; +Cc: Marcel Holtmann, outreachy-kernel, gustavo
[-- Attachment #1: Type: text/plain, Size: 5570 bytes --]
Thank you,
Gerg Inform me, To stay in staging directory I will keep this thing in my
mind.
On Wed, Sep 14, 2016 at 9:57 PM, Vaishali Thakkar <vthakkar1994@gmail.com>
wrote:
> On Wed, Sep 14, 2016 at 8:48 PM, Anchal Jain <anchalj109@gmail.com> wrote:
> > 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
>
> > Signed-off-by: Anchal Jain <anchalj109@gmail.com>
> > ---
> > drivers/bluetooth/bfusb.c | 27 ++++++++++++++++++---------
> > 1 file changed, 18 insertions(+), 9 deletions(-)
> >
> > diff --git a/drivers/bluetooth/bfusb.c b/drivers/bluetooth/bfusb.c
> > index 3bf4ec6..1c2e16d 100644
> > --- a/drivers/bluetooth/bfusb.c
> > +++ b/drivers/bluetooth/bfusb.c
> > @@ -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;
>
> Don't you think this looks ugly after the change?
>
> > 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);
>
> Same comment for this change as well. Normally it is advisable to solve
> other
> checkpatch.pl errors/warnings than solving 80 characters one.
>
> > } 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 outreachy-kernel+unsubscribe@googlegroups.com.
> > To post to this group, send email to outreachy-kernel@googlegroups.com.
> > 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.
>
>
>
> --
> Vaishali
> http://vaishalithakkar.in/
>
[-- Attachment #2: Type: text/html, Size: 8481 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-09-14 17:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-14 15:18 [PATCH 1/3] drivers: bluetooth: bfusb: Line over 80 characters in conditional stataments Anchal Jain
2016-09-14 16:27 ` [Outreachy kernel] " Vaishali Thakkar
2016-09-14 17:49 ` Anchal Jain
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.