qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] rtl8139: fix clang reporting unused assignment of VLAN tagging data
@ 2010-01-13 22:53 Igor V. Kovalenko
  2010-01-15  7:08 ` [Qemu-devel] " Paolo Bonzini
  2010-01-19 22:38 ` [Qemu-devel] " Anthony Liguori
  0 siblings, 2 replies; 4+ messages in thread
From: Igor V. Kovalenko @ 2010-01-13 22:53 UTC (permalink / raw)
  To: qemu-devel

From: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>

Currently we do not implement VLAN tagging for rtl8139(C+),
still data is read from ring buffer headers.

- augment unused assignment with TODO item
- cast txdw1 to void for now

Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>
---
 hw/rtl8139.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/hw/rtl8139.c b/hw/rtl8139.c
index 1f4f585..f04dd54 100644
--- a/hw/rtl8139.c
+++ b/hw/rtl8139.c
@@ -1909,6 +1909,7 @@ static int rtl8139_cplus_transmit_one(RTL8139State *s)
 
     cpu_physical_memory_read(cplus_tx_ring_desc,    (uint8_t *)&val, 4);
     txdw0 = le32_to_cpu(val);
+    /* TODO: implement VLAN tagging support, VLAN tag data is read to txdw1 */
     cpu_physical_memory_read(cplus_tx_ring_desc+4,  (uint8_t *)&val, 4);
     txdw1 = le32_to_cpu(val);
     cpu_physical_memory_read(cplus_tx_ring_desc+8,  (uint8_t *)&val, 4);
@@ -1920,6 +1921,9 @@ static int rtl8139_cplus_transmit_one(RTL8139State *s)
            descriptor,
            txdw0, txdw1, txbufLO, txbufHI));
 
+    /* TODO: the following discard cast should clean clang analyzer output */
+    (void)txdw1;
+
 /* w0 ownership flag */
 #define CP_TX_OWN (1<<31)
 /* w0 end of ring flag */
@@ -2045,6 +2049,7 @@ static int rtl8139_cplus_transmit_one(RTL8139State *s)
     /* update ring data */
     val = cpu_to_le32(txdw0);
     cpu_physical_memory_write(cplus_tx_ring_desc,    (uint8_t *)&val, 4);
+    /* TODO: implement VLAN tagging support, VLAN tag data is read to txdw1 */
 //    val = cpu_to_le32(txdw1);
 //    cpu_physical_memory_write(cplus_tx_ring_desc+4,  &val, 4);
 

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

* [Qemu-devel] Re: [PATCH] rtl8139: fix clang reporting unused assignment of VLAN tagging data
  2010-01-13 22:53 [Qemu-devel] [PATCH] rtl8139: fix clang reporting unused assignment of VLAN tagging data Igor V. Kovalenko
@ 2010-01-15  7:08 ` Paolo Bonzini
  2010-01-17  8:13   ` Simon Horman
  2010-01-19 22:38 ` [Qemu-devel] " Anthony Liguori
  1 sibling, 1 reply; 4+ messages in thread
From: Paolo Bonzini @ 2010-01-15  7:08 UTC (permalink / raw)
  To: Igor V. Kovalenko; +Cc: qemu-devel


> diff --git a/hw/rtl8139.c b/hw/rtl8139.c
> index 1f4f585..f04dd54 100644
> --- a/hw/rtl8139.c
> +++ b/hw/rtl8139.c
> @@ -1909,6 +1909,7 @@ static int rtl8139_cplus_transmit_one(RTL8139State *s)
>
>       cpu_physical_memory_read(cplus_tx_ring_desc,    (uint8_t *)&val, 4);
>       txdw0 = le32_to_cpu(val);
> +    /* TODO: implement VLAN tagging support, VLAN tag data is read to txdw1 */
>       cpu_physical_memory_read(cplus_tx_ring_desc+4,  (uint8_t *)&val, 4);
>       txdw1 = le32_to_cpu(val);
>       cpu_physical_memory_read(cplus_tx_ring_desc+8,  (uint8_t *)&val, 4);
> @@ -1920,6 +1921,9 @@ static int rtl8139_cplus_transmit_one(RTL8139State *s)
>              descriptor,
>              txdw0, txdw1, txbufLO, txbufHI));
>
> +    /* TODO: the following discard cast should clean clang analyzer output */
> +    (void)txdw1;

I don't like this, why not comment it out like here:

> +    /* TODO: implement VLAN tagging support, VLAN tag data is read to txdw1 */
>   //    val = cpu_to_le32(txdw1);
>   //    cpu_physical_memory_write(cplus_tx_ring_desc+4,&val, 4);

(and maybe change this one as well to #if 0...#endif, I don't know).

Paolo

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

* Re: [Qemu-devel] Re: [PATCH] rtl8139: fix clang reporting unused assignment of VLAN tagging data
  2010-01-15  7:08 ` [Qemu-devel] " Paolo Bonzini
@ 2010-01-17  8:13   ` Simon Horman
  0 siblings, 0 replies; 4+ messages in thread
From: Simon Horman @ 2010-01-17  8:13 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: qemu-devel

On Fri, Jan 15, 2010 at 08:08:53AM +0100, Paolo Bonzini wrote:
> 
> >diff --git a/hw/rtl8139.c b/hw/rtl8139.c
> >index 1f4f585..f04dd54 100644
> >--- a/hw/rtl8139.c
> >+++ b/hw/rtl8139.c
> >@@ -1909,6 +1909,7 @@ static int rtl8139_cplus_transmit_one(RTL8139State *s)
> >
> >      cpu_physical_memory_read(cplus_tx_ring_desc,    (uint8_t *)&val, 4);
> >      txdw0 = le32_to_cpu(val);
> >+    /* TODO: implement VLAN tagging support, VLAN tag data is read to txdw1 */
> >      cpu_physical_memory_read(cplus_tx_ring_desc+4,  (uint8_t *)&val, 4);
> >      txdw1 = le32_to_cpu(val);
> >      cpu_physical_memory_read(cplus_tx_ring_desc+8,  (uint8_t *)&val, 4);
> >@@ -1920,6 +1921,9 @@ static int rtl8139_cplus_transmit_one(RTL8139State *s)
> >             descriptor,
> >             txdw0, txdw1, txbufLO, txbufHI));
> >
> >+    /* TODO: the following discard cast should clean clang analyzer output */
> >+    (void)txdw1;
> 
> I don't like this, why not comment it out like here:
> 
> >+    /* TODO: implement VLAN tagging support, VLAN tag data is read to txdw1 */
> >  //    val = cpu_to_le32(txdw1);
> >  //    cpu_physical_memory_write(cplus_tx_ring_desc+4,&val, 4);
> 
> (and maybe change this one as well to #if 0...#endif, I don't know).

Personally I'd rather that all of this was removed
until the feature is implemented.

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

* Re: [Qemu-devel] [PATCH] rtl8139: fix clang reporting unused assignment of VLAN tagging data
  2010-01-13 22:53 [Qemu-devel] [PATCH] rtl8139: fix clang reporting unused assignment of VLAN tagging data Igor V. Kovalenko
  2010-01-15  7:08 ` [Qemu-devel] " Paolo Bonzini
@ 2010-01-19 22:38 ` Anthony Liguori
  1 sibling, 0 replies; 4+ messages in thread
From: Anthony Liguori @ 2010-01-19 22:38 UTC (permalink / raw)
  To: Igor V. Kovalenko; +Cc: qemu-devel

On 01/13/2010 04:53 PM, Igor V. Kovalenko wrote:
> From: Igor V. Kovalenko<igor.v.kovalenko@gmail.com>
>
> Currently we do not implement VLAN tagging for rtl8139(C+),
> still data is read from ring buffer headers.
>
> - augment unused assignment with TODO item
> - cast txdw1 to void for now
>
> Signed-off-by: Igor V. Kovalenko<igor.v.kovalenko@gmail.com>
>    

Applied.  Thanks.

Regards,

Anthony Liguori
> ---
>   hw/rtl8139.c |    5 +++++
>   1 files changed, 5 insertions(+), 0 deletions(-)
>
> diff --git a/hw/rtl8139.c b/hw/rtl8139.c
> index 1f4f585..f04dd54 100644
> --- a/hw/rtl8139.c
> +++ b/hw/rtl8139.c
> @@ -1909,6 +1909,7 @@ static int rtl8139_cplus_transmit_one(RTL8139State *s)
>
>       cpu_physical_memory_read(cplus_tx_ring_desc,    (uint8_t *)&val, 4);
>       txdw0 = le32_to_cpu(val);
> +    /* TODO: implement VLAN tagging support, VLAN tag data is read to txdw1 */
>       cpu_physical_memory_read(cplus_tx_ring_desc+4,  (uint8_t *)&val, 4);
>       txdw1 = le32_to_cpu(val);
>       cpu_physical_memory_read(cplus_tx_ring_desc+8,  (uint8_t *)&val, 4);
> @@ -1920,6 +1921,9 @@ static int rtl8139_cplus_transmit_one(RTL8139State *s)
>              descriptor,
>              txdw0, txdw1, txbufLO, txbufHI));
>
> +    /* TODO: the following discard cast should clean clang analyzer output */
> +    (void)txdw1;
> +
>   /* w0 ownership flag */
>   #define CP_TX_OWN (1<<31)
>   /* w0 end of ring flag */
> @@ -2045,6 +2049,7 @@ static int rtl8139_cplus_transmit_one(RTL8139State *s)
>       /* update ring data */
>       val = cpu_to_le32(txdw0);
>       cpu_physical_memory_write(cplus_tx_ring_desc,    (uint8_t *)&val, 4);
> +    /* TODO: implement VLAN tagging support, VLAN tag data is read to txdw1 */
>   //    val = cpu_to_le32(txdw1);
>   //    cpu_physical_memory_write(cplus_tx_ring_desc+4,&val, 4);
>
>
>
>
>
>    

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

end of thread, other threads:[~2010-01-19 22:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-13 22:53 [Qemu-devel] [PATCH] rtl8139: fix clang reporting unused assignment of VLAN tagging data Igor V. Kovalenko
2010-01-15  7:08 ` [Qemu-devel] " Paolo Bonzini
2010-01-17  8:13   ` Simon Horman
2010-01-19 22:38 ` [Qemu-devel] " Anthony Liguori

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