From: Michael Tokarev <mjt@tls.msk.ru>
To: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Cc: edgar.iglesias@xilinx.com,
Peter Maydell <peter.maydell@linaro.org>,
qemu-devel <qemu-devel@nongnu.org>,
Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [Qemu-devel] [net, v1, 1/4] net: cadence_gem: Fix Tx descriptor update
Date: Sat, 24 May 2014 10:48:04 +0400 [thread overview]
Message-ID: <538040A4.5030602@msgid.tls.msk.ru> (raw)
In-Reply-To: <53803E4E.8010108@msgid.tls.msk.ru>
24.05.2014 10:38, Michael Tokarev wrote:
> [...]
> if (tx_desc_get_last(desc)) {
> + unsigned desc_first[2];
> +
> /* Modify the 1st descriptor of this packet to be owned by
> * the processor.
> */
> cpu_physical_memory_read(s->tx_desc_addr,
> - (uint8_t *)&desc[0], sizeof(desc));
> - tx_desc_set_used(desc);
> + (uint8_t *)&desc_first[0], sizeof(desc));
> + tx_desc_set_used(desc_first);
> cpu_physical_memory_write(s->tx_desc_addr,
> - (uint8_t *)&desc[0], sizeof(desc));
> + (uint8_t *)&desc_first[0], sizeof(desc));
> /* Advance the hardare current descriptor past this packet */
>
> This is quite fun.
>
> Can we, please,
>
> a) s/unsigned/uint8_t/ in the variable declaration,
> and remove the useless casts and "readdressing" everywhere?
Um, no, this is ofcourse wrong - tx_desc_set_used() expects unsigned.
Still it's possible to remove "readdressing", instead of
(uint8_t *)&desc[0]
use
(uint8_t *)desc
The second point stands.. ;)
> and, more interesting,
>
> b) s/sizeof(desc)/sizeof(desc_first)/g
> ? :)
>
> Thanks,
>
> /mjt
>
next prev parent reply other threads:[~2014-05-24 6:48 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-07 9:15 [Qemu-devel] [PATCH net v1 0/4] Cadence GEM patches Peter Crosthwaite
2014-05-07 9:16 ` [Qemu-devel] [PATCH net v1 1/4] net: cadence_gem: Fix Tx descriptor update Peter Crosthwaite
2014-05-24 6:38 ` [Qemu-devel] [net, v1, " Michael Tokarev
2014-05-24 6:48 ` Michael Tokarev [this message]
2014-05-07 9:16 ` [Qemu-devel] [PATCH net v1 2/4] net: cadence_gem: Add Tx descriptor fetch printf Peter Crosthwaite
2014-05-07 9:17 ` [Qemu-devel] [PATCH net v1 3/4] net: cadence_gem: Fix top comment Peter Crosthwaite
2014-05-07 9:18 ` [Qemu-devel] [PATCH net v1 4/4] net: cadence_gem: Comment spelling sweep Peter Crosthwaite
2014-05-14 13:17 ` [Qemu-devel] [PATCH net v1 0/4] Cadence GEM patches Peter Crosthwaite
2014-05-23 23:06 ` [Qemu-trivial] " Peter Crosthwaite
2014-05-23 23:06 ` [Qemu-devel] " Peter Crosthwaite
2014-05-24 7:17 ` [Qemu-trivial] " Michael Tokarev
2014-05-24 7:17 ` [Qemu-devel] " Michael Tokarev
2014-05-26 7:44 ` [Qemu-trivial] [Qemu-devel] " Peter Crosthwaite
2014-05-26 7:44 ` [Qemu-devel] [Qemu-trivial] " Peter Crosthwaite
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=538040A4.5030602@msgid.tls.msk.ru \
--to=mjt@tls.msk.ru \
--cc=edgar.iglesias@xilinx.com \
--cc=peter.crosthwaite@xilinx.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/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.