Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1260058 > unrolled thread
| Started by | Bogicevic Sasa <brutallesale@gmail.com> |
|---|---|
| First post | 2015-10-31 23:10 +0100 |
| Last post | 2015-11-01 01:00 +0100 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH] drivers:staging:gdm72xx Fix increment in a loop Bogicevic Sasa <brutallesale@gmail.com> - 2015-10-31 23:10 +0100
Re: [PATCH] drivers:staging:gdm72xx Fix increment in a loop Greg KH <gregkh@linuxfoundation.org> - 2015-11-01 01:00 +0100
| From | Bogicevic Sasa <brutallesale@gmail.com> |
|---|---|
| Date | 2015-10-31 23:10 +0100 |
| Subject | [PATCH] drivers:staging:gdm72xx Fix increment in a loop |
| Message-ID | <qpMvw-8rH-5@gated-at.bofh.it> |
This fixes increment of pos int to be more readable Lines qcb->csr[index].srcport_lo = ((buf[pos++]<<8)&0xff00); qcb->csr[index].srcport_lo += buf[pos++]; become qcb->csr[index].srcport_lo = get_unaligned_le16(&buf[pos]); pos += 2; Signed-off-by: Bogicevic Sasa <brutallesale@gmail.com> --- drivers/staging/gdm72xx/gdm_qos.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/staging/gdm72xx/gdm_qos.c b/drivers/staging/gdm72xx/gdm_qos.c index 44d04bd..132789c 100644 --- a/drivers/staging/gdm72xx/gdm_qos.c +++ b/drivers/staging/gdm72xx/gdm_qos.c @@ -406,14 +406,14 @@ void gdm_recv_qos_hci_packet(void *nic_ptr, u8 *buf, int size) qcb->csr[index].ipdst_addr[1] = buf[pos++]; qcb->csr[index].ipdst_addr[2] = buf[pos++]; qcb->csr[index].ipdst_addr[3] = buf[pos++]; - 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); - qcb->csr[index].dstport_hi += buf[pos++]; + qcb->csr[index].srcport_lo = get_unaligned_le16(&buf[pos]); + pos += 2; + qcb->csr[index].srcport_hi = get_unaligned_le16(&buf[pos]); + pos += 2; + qcb->csr[index].dstport_lo = get_unaligned_le16(&buf[pos]); + pos += 2; + qcb->csr[index].dstport_hi = get_unaligned_le16(&buf[pos]); + pos += 2; qcb->qos_limit_size = 254 / qcb->qos_list_cnt; spin_unlock_irqrestore(&qcb->qos_lock, flags); -- 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]
| From | Greg KH <gregkh@linuxfoundation.org> |
|---|---|
| Date | 2015-11-01 01:00 +0100 |
| Message-ID | <qpOdY-QP-5@gated-at.bofh.it> |
| In reply to | #1260058 |
On Sat, Oct 31, 2015 at 11:03:00PM +0100, Bogicevic Sasa wrote: > This fixes increment of pos int to be more readable > Lines qcb->csr[index].srcport_lo = ((buf[pos++]<<8)&0xff00); > qcb->csr[index].srcport_lo += buf[pos++]; > become > qcb->csr[index].srcport_lo = get_unaligned_le16(&buf[pos]); > pos += 2; > > Signed-off-by: Bogicevic Sasa <brutallesale@gmail.com> > --- > drivers/staging/gdm72xx/gdm_qos.c | 16 ++++++++-------- > 1 file changed, 8 insertions(+), 8 deletions(-) I'm totally confused, please resend all of these patches, numbered in order, so I have a chance to know how to apply them. Also please always cc: the proper mailing lists for staging patches (hint, not lkml). thanks, greg k-h -- 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