>>> On 4/10/2010 at 09:10 AM, Shao Miller <[email protected]> wrote: 
> Good day Bruce,
> 
> In regards to the patch you provided for three NIC drivers:
> 
> Could you possibly attach the patch to an e-mail?  I'd like to track 
> your submission in the support.etherboot.org tracking system (unless 
> you'd enjoy joining and tracking it yourself).  I'd like to attach the 
> patch to the task created there.
> 
> Also, for your ns83820 and tulip patches, I notice that ns->cur_rx is no 
> longer incremented...  I just wanted to confirm that you believe this is 
> the right thing to do.
> 
> Thank you for your time,
> 
> - Shao Miller

Shao,

Attached.
The increment happens with the "+ 1". The code was just a classic mistake, 
relying upon undefined compiler behavior.

Bruce

In building gpxe for openSUSE Factory (part of kvm package), there were a few 
problems identified by the compiler.  This patch addresses them.

v2 - fix operator precedence mistake! (Thanks for the feedback Stefan H.)

Signed-off-by: Bruce Rogers <[email protected]>

diff --git a/src/drivers/net/ath5k/ath5k_qcu.c 
b/src/drivers/net/ath5k/ath5k_qcu.c
index a674b85..cb25029 100644
--- a/src/drivers/net/ath5k/ath5k_qcu.c
+++ b/src/drivers/net/ath5k/ath5k_qcu.c
@@ -268,7 +268,7 @@ int ath5k_hw_reset_tx_queue(struct ath5k_hw *ah)
                }
 
                if (tq->tqi_ready_time &&
-               (tq->tqi_type != AR5K_TX_QUEUE_ID_CAB))
+               (tq->tqi_type != AR5K_TX_QUEUE_CAB))
                        ath5k_hw_reg_write(ah, AR5K_REG_SM(tq->tqi_ready_time,
                                AR5K_QCU_RDYTIMECFG_INTVAL) |
                                AR5K_QCU_RDYTIMECFG_ENABLE,
diff --git a/src/drivers/net/ns83820.c b/src/drivers/net/ns83820.c
index 44d875f..680f844 100644
--- a/src/drivers/net/ns83820.c
+++ b/src/drivers/net/ns83820.c
@@ -687,7 +687,7 @@ static int ns83820_poll(struct nic *nic, int retrieve)
        //                      rx_ring[entry].link = 0;
        rx_ring[entry].cmdsts = cpu_to_le32(CMDSTS_OWN);
 
-       ns->cur_rx = ++ns->cur_rx % NR_RX_DESC;
+       ns->cur_rx = (ns->cur_rx + 1) % NR_RX_DESC;
 
        if (ns->cur_rx == 0)    /* We have wrapped the ring */
          kick_rx();
diff --git a/src/drivers/net/tulip.c b/src/drivers/net/tulip.c
index e08e0d8..0fe80a8 100644
--- a/src/drivers/net/tulip.c
+++ b/src/drivers/net/tulip.c
@@ -1171,7 +1171,7 @@ static int tulip_poll(struct nic *nic, int retrieve)
     if (rx_ring[tp->cur_rx].status & 0x00008000) {
        /* return the descriptor and buffer to receive ring */
         rx_ring[tp->cur_rx].status = 0x80000000;
-       tp->cur_rx = (++tp->cur_rx) % RX_RING_SIZE;
+       tp->cur_rx = (tp->cur_rx + 1) % RX_RING_SIZE;
         return 0;
     }
 
@@ -1180,7 +1180,7 @@ static int tulip_poll(struct nic *nic, int retrieve)
 
     /* return the descriptor and buffer to receive ring */
     rx_ring[tp->cur_rx].status = 0x80000000;
-    tp->cur_rx = (++tp->cur_rx) % RX_RING_SIZE;
+    tp->cur_rx = (tp->cur_rx + 1) % RX_RING_SIZE;
 
     return 1;
 }
_______________________________________________
gPXE-devel mailing list
[email protected]
http://etherboot.org/mailman/listinfo/gpxe-devel

Reply via email to