Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1260021 > unrolled thread

[PATCH] drivers:staging:gdm72xx Fix line over 80 characters

Started byBogicevic Sasa <brutallesale@gmail.com>
First post2015-10-31 17:40 +0100
Last post2015-10-31 19:50 +0100
Articles 5 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] drivers:staging:gdm72xx Fix line over 80 characters Bogicevic Sasa <brutallesale@gmail.com> - 2015-10-31 17:40 +0100
    Re: [PATCH] drivers:staging:gdm72xx Fix line over 80 characters Joe Perches <joe@perches.com> - 2015-10-31 18:00 +0100
      Re: [PATCH] drivers:staging:gdm72xx Fix line over 80 characters Bogicevic Sasa <brutallesale@gmail.com> - 2015-10-31 18:20 +0100
        Re: [PATCH] drivers:staging:gdm72xx Fix line over 80 characters Joe Perches <joe@perches.com> - 2015-10-31 19:50 +0100
          Re: [PATCH] drivers:staging:gdm72xx Fix line over 80 characters Bogicevic Sasa <brutallesale@gmail.com> - 2015-10-31 19:50 +0100

#1260021 — [PATCH] drivers:staging:gdm72xx Fix line over 80 characters

FromBogicevic Sasa <brutallesale@gmail.com>
Date2015-10-31 17:40 +0100
Subject[PATCH] drivers:staging:gdm72xx Fix line over 80 characters
Message-ID<qpHma-57i-25@gated-at.bofh.it>
This fixes line over 80 character messages from checkpatch.pl

Signed-off-by: Bogicevic Sasa <brutallesale@gmail.com>
---
 drivers/staging/gdm72xx/gdm_qos.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/gdm72xx/gdm_qos.c b/drivers/staging/gdm72xx/gdm_qos.c
index c03204b..44d04bd 100644
--- a/drivers/staging/gdm72xx/gdm_qos.c
+++ b/drivers/staging/gdm72xx/gdm_qos.c
@@ -382,7 +382,7 @@ void gdm_recv_qos_hci_packet(void *nic_ptr, u8 *buf, int size)
 
 		spin_lock_irqsave(&qcb->qos_lock, flags);
 		qcb->csr[index].sfid = sfid;
-		qcb->csr[index].classifier_rule_en = ((buf[pos++] << 8) & 0xff00);
+		qcb->csr[index].classifier_rule_en = (buf[pos++] << 8) & 0xff00;
 		qcb->csr[index].classifier_rule_en += buf[pos++];
 		if (qcb->csr[index].classifier_rule_en == 0)
 			qcb->qos_null_idx = index;
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1260022

FromJoe Perches <joe@perches.com>
Date2015-10-31 18:00 +0100
Message-ID<qpHFw-5gm-5@gated-at.bofh.it>
In reply to#1260021
On Sat, 2015-10-31 at 17:38 +0100, Bogicevic Sasa wrote:
> This fixes line over 80 character messages from checkpatch.pl
[]
> diff --git a/drivers/staging/gdm72xx/gdm_qos.c b/drivers/staging/gdm72xx/gdm_qos.c
[]
> @@ -382,7 +382,7 @@ void gdm_recv_qos_hci_packet(void *nic_ptr, u8 *buf, int size)
>  
>  		spin_lock_irqsave(&qcb->qos_lock, flags);
>  		qcb->csr[index].sfid = sfid;
> -		qcb->csr[index].classifier_rule_en = ((buf[pos++] << 8) & 0xff00);
> +		qcb->csr[index].classifier_rule_en = (buf[pos++] << 8) & 0xff00;
>  		qcb->csr[index].classifier_rule_en += buf[pos++];
>  		if (qcb->csr[index].classifier_rule_en == 0)
>  			qcb->qos_null_idx = index;

If you do this one, please do all of them in the
same block.

		qcb->csr[index].srcport_lo = ((buf[pos++]<<8)&0xff00);
		qcb->csr[index].srcport_lo += buf[pos++];
		qcb->csr[index].srcport_hi = ((buf[pos++]<<8)&0xff00);
		qcb->csr[index].srcport_hi += buf[pos++];
		qcb->csr[index].dstport_lo = ((buf[pos++]<<8)&0xff00);
		qcb->csr[index].dstport_lo += buf[pos++];
		qcb->csr[index].dstport_hi = ((buf[pos++]<<8)&0xff00);

It'd probably be nicer to use a temporary for
qcb->csr[index] too.

Also, the += is kind of odd.  These are really a
le16_to_cpu conversion, so it might be nicer to use
that mechanism.

	csr->srcport_lo = get_unaligned_le16(&buf[pos]);
	pos += 2;


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1260023

FromBogicevic Sasa <brutallesale@gmail.com>
Date2015-10-31 18:20 +0100
Message-ID<qpHYR-5Cb-3@gated-at.bofh.it>
In reply to#1260022
On 10/31, Joe Perches wrote:
>On Sat, 2015-10-31 at 17:38 +0100, Bogicevic Sasa wrote:
>> This fixes line over 80 character messages from checkpatch.pl
>[]
>> diff --git a/drivers/staging/gdm72xx/gdm_qos.c b/drivers/staging/gdm72xx/gdm_qos.c
>[]
>> @@ -382,7 +382,7 @@ void gdm_recv_qos_hci_packet(void *nic_ptr, u8 *buf, int size)
>>
>>  		spin_lock_irqsave(&qcb->qos_lock, flags);
>>  		qcb->csr[index].sfid = sfid;
>> -		qcb->csr[index].classifier_rule_en = ((buf[pos++] << 8) & 0xff00);
>> +		qcb->csr[index].classifier_rule_en = (buf[pos++] << 8) & 0xff00;
>>  		qcb->csr[index].classifier_rule_en += buf[pos++];
>>  		if (qcb->csr[index].classifier_rule_en == 0)
>>  			qcb->qos_null_idx = index;
>
>If you do this one, please do all of them in the
>same block.
>
>		qcb->csr[index].srcport_lo = ((buf[pos++]<<8)&0xff00);
>		qcb->csr[index].srcport_lo += buf[pos++];
>		qcb->csr[index].srcport_hi = ((buf[pos++]<<8)&0xff00);
>		qcb->csr[index].srcport_hi += buf[pos++];
>		qcb->csr[index].dstport_lo = ((buf[pos++]<<8)&0xff00);
>		qcb->csr[index].dstport_lo += buf[pos++];
>		qcb->csr[index].dstport_hi = ((buf[pos++]<<8)&0xff00);
>
>It'd probably be nicer to use a temporary for
>qcb->csr[index] too.
>
>Also, the += is kind of odd.  These are really a
>le16_to_cpu conversion, so it might be nicer to use
>that mechanism.
>
>	csr->srcport_lo = get_unaligned_le16(&buf[pos]);
>	pos += 2;
>
>
It is not a problem to remove unnecesarry brackets but bear in mind I am
new to bitwise stuff. So how it should be, like this?

		qcb->csr[index].srcport_lo = get_unaligned_le16(&buf[pos]);
		pos += 2;
		qcb->csr[index].srcport_lo = buf[pos];
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1260034

FromJoe Perches <joe@perches.com>
Date2015-10-31 19:50 +0100
Message-ID<qpJnX-6nq-1@gated-at.bofh.it>
In reply to#1260023
On Sat, 2015-10-31 at 18:14 +0100, Bogicevic Sasa wrote:
> On 10/31, Joe Perches wrote:
> >On Sat, 2015-10-31 at 17:38 +0100, Bogicevic Sasa wrote:
> >> This fixes line over 80 character messages from checkpatch.pl
> >[]
> >> diff --git a/drivers/staging/gdm72xx/gdm_qos.c b/drivers/staging/gdm72xx/gdm_qos.c
> >[]
> >> @@ -382,7 +382,7 @@ void gdm_recv_qos_hci_packet(void *nic_ptr, u8 *buf, int size)
> >>
> >>  		spin_lock_irqsave(&qcb->qos_lock, flags);
> >>  		qcb->csr[index].sfid = sfid;
> >> -		qcb->csr[index].classifier_rule_en = ((buf[pos++] << 8) & 0xff00);
> >> +		qcb->csr[index].classifier_rule_en = (buf[pos++] << 8) & 0xff00;
> >>  		qcb->csr[index].classifier_rule_en += buf[pos++];
> >>  		if (qcb->csr[index].classifier_rule_en == 0)
> >>  			qcb->qos_null_idx = index;
> >
> >If you do this one, please do all of them in the
> >same block.
> >
> >		qcb->csr[index].srcport_lo = ((buf[pos++]<<8)&0xff00);
> >		qcb->csr[index].srcport_lo += buf[pos++];
> >		qcb->csr[index].srcport_hi = ((buf[pos++]<<8)&0xff00);
> >		qcb->csr[index].srcport_hi += buf[pos++];
> >		qcb->csr[index].dstport_lo = ((buf[pos++]<<8)&0xff00);
> >		qcb->csr[index].dstport_lo += buf[pos++];
> >		qcb->csr[index].dstport_hi = ((buf[pos++]<<8)&0xff00);
> >
> >It'd probably be nicer to use a temporary for
> >qcb->csr[index] too.
> >
> >Also, the += is kind of odd.  These are really a
> >le16_to_cpu conversion, so it might be nicer to use
> >that mechanism.
> >
> >	csr->srcport_lo = get_unaligned_le16(&buf[pos]);
> >	pos += 2;
> >
> >
> It is not a problem to remove unnecesarry brackets but bear in mind I am
> new to bitwise stuff.

No worries, it's not that obvious.

>  So how it should be, like this?
> 
> 		qcb->csr[index].srcport_lo = get_unaligned_le16(&buf[pos]);
> 		pos += 2;
> 		qcb->csr[index].srcport_lo = buf[pos];

No, it'd be:

		csr->srcport_lo = get_unaligned_le16(&buf[pos]);
		pos += 2;
		csr->srcport_hi = get_unaligned_le16(&buf[pos]);
		pos += 2;
		csr->dstport_lo = get_unaligned_le16(&buf[pos]);
		pos += 2;
		csr->dstport_hi = get_unaligned_le16(&buf[pos]);
		pos += 2;


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1260036

FromBogicevic Sasa <brutallesale@gmail.com>
Date2015-10-31 19:50 +0100
Message-ID<qpJnX-6nq-9@gated-at.bofh.it>
In reply to#1260034
On 10/31, Joe Perches wrote:
>On Sat, 2015-10-31 at 18:14 +0100, Bogicevic Sasa wrote:
>> On 10/31, Joe Perches wrote:
>> >On Sat, 2015-10-31 at 17:38 +0100, Bogicevic Sasa wrote:
>> >> This fixes line over 80 character messages from checkpatch.pl
>> >[]
>> >> diff --git a/drivers/staging/gdm72xx/gdm_qos.c b/drivers/staging/gdm72xx/gdm_qos.c
>> >[]
>> >> @@ -382,7 +382,7 @@ void gdm_recv_qos_hci_packet(void *nic_ptr, u8 *buf, int size)
>> >>
>> >>  		spin_lock_irqsave(&qcb->qos_lock, flags);
>> >>  		qcb->csr[index].sfid = sfid;
>> >> -		qcb->csr[index].classifier_rule_en = ((buf[pos++] << 8) & 0xff00);
>> >> +		qcb->csr[index].classifier_rule_en = (buf[pos++] << 8) & 0xff00;
>> >>  		qcb->csr[index].classifier_rule_en += buf[pos++];
>> >>  		if (qcb->csr[index].classifier_rule_en == 0)
>> >>  			qcb->qos_null_idx = index;
>> >
>> >If you do this one, please do all of them in the
>> >same block.
>> >
>> >		qcb->csr[index].srcport_lo = ((buf[pos++]<<8)&0xff00);
>> >		qcb->csr[index].srcport_lo += buf[pos++];
>> >		qcb->csr[index].srcport_hi = ((buf[pos++]<<8)&0xff00);
>> >		qcb->csr[index].srcport_hi += buf[pos++];
>> >		qcb->csr[index].dstport_lo = ((buf[pos++]<<8)&0xff00);
>> >		qcb->csr[index].dstport_lo += buf[pos++];
>> >		qcb->csr[index].dstport_hi = ((buf[pos++]<<8)&0xff00);
>> >
>> >It'd probably be nicer to use a temporary for
>> >qcb->csr[index] too.
>> >
>> >Also, the += is kind of odd.  These are really a
>> >le16_to_cpu conversion, so it might be nicer to use
>> >that mechanism.
>> >
>> >	csr->srcport_lo = get_unaligned_le16(&buf[pos]);
>> >	pos += 2;
>> >
>> >
>> It is not a problem to remove unnecesarry brackets but bear in mind I am
>> new to bitwise stuff.
>
>No worries, it's not that obvious.
>
>>  So how it should be, like this?
>>
>> 		qcb->csr[index].srcport_lo = get_unaligned_le16(&buf[pos]);
>> 		pos += 2;
>> 		qcb->csr[index].srcport_lo = buf[pos];
>
>No, it'd be:
>
>		csr->srcport_lo = get_unaligned_le16(&buf[pos]);
>		pos += 2;
>		csr->srcport_hi = get_unaligned_le16(&buf[pos]);
>		pos += 2;
>		csr->dstport_lo = get_unaligned_le16(&buf[pos]);
>		pos += 2;
>		csr->dstport_hi = get_unaligned_le16(&buf[pos]);
>		pos += 2;
>
>
Ah ok Ill do it like that than and resend
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web