linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drivers:staging:gdm72xx Fix line over 80 characters
@ 2015-10-31 16:38 Bogicevic Sasa
  2015-10-31 16:57 ` Joe Perches
  0 siblings, 1 reply; 5+ messages in thread
From: Bogicevic Sasa @ 2015-10-31 16:38 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel, Bogicevic Sasa

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


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

* Re: [PATCH] drivers:staging:gdm72xx Fix line over 80 characters
  2015-10-31 16:38 [PATCH] drivers:staging:gdm72xx Fix line over 80 characters Bogicevic Sasa
@ 2015-10-31 16:57 ` Joe Perches
  2015-10-31 17:14   ` Bogicevic Sasa
  0 siblings, 1 reply; 5+ messages in thread
From: Joe Perches @ 2015-10-31 16:57 UTC (permalink / raw)
  To: Bogicevic Sasa; +Cc: gregkh, linux-kernel

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;



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

* Re: [PATCH] drivers:staging:gdm72xx Fix line over 80 characters
  2015-10-31 16:57 ` Joe Perches
@ 2015-10-31 17:14   ` Bogicevic Sasa
  2015-10-31 18:43     ` Joe Perches
  0 siblings, 1 reply; 5+ messages in thread
From: Bogicevic Sasa @ 2015-10-31 17:14 UTC (permalink / raw)
  To: Joe Perches; +Cc: gregkh, linux-kernel

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];

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

* Re: [PATCH] drivers:staging:gdm72xx Fix line over 80 characters
  2015-10-31 17:14   ` Bogicevic Sasa
@ 2015-10-31 18:43     ` Joe Perches
  2015-10-31 18:45       ` Bogicevic Sasa
  0 siblings, 1 reply; 5+ messages in thread
From: Joe Perches @ 2015-10-31 18:43 UTC (permalink / raw)
  To: Bogicevic Sasa; +Cc: gregkh, linux-kernel

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;



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

* Re: [PATCH] drivers:staging:gdm72xx Fix line over 80 characters
  2015-10-31 18:43     ` Joe Perches
@ 2015-10-31 18:45       ` Bogicevic Sasa
  0 siblings, 0 replies; 5+ messages in thread
From: Bogicevic Sasa @ 2015-10-31 18:45 UTC (permalink / raw)
  To: Joe Perches; +Cc: gregkh, linux-kernel

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

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

end of thread, other threads:[~2015-10-31 18:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-31 16:38 [PATCH] drivers:staging:gdm72xx Fix line over 80 characters Bogicevic Sasa
2015-10-31 16:57 ` Joe Perches
2015-10-31 17:14   ` Bogicevic Sasa
2015-10-31 18:43     ` Joe Perches
2015-10-31 18:45       ` Bogicevic Sasa

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).