From: Bogicevic Sasa <brutallesale@gmail.com>
To: Joe Perches <joe@perches.com>
Cc: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drivers:staging:gdm72xx Fix line over 80 characters
Date: Sat, 31 Oct 2015 18:14:16 +0100 [thread overview]
Message-ID: <20151031171416.GA19945@gmail.com> (raw)
In-Reply-To: <1446310672.2757.219.camel@perches.com>
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];
next prev parent reply other threads:[~2015-10-31 17:14 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2015-10-31 18:43 ` Joe Perches
2015-10-31 18:45 ` Bogicevic Sasa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20151031171416.GA19945@gmail.com \
--to=brutallesale@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.