Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1dad939ddbbd8d64e1edc7799df00a9e591b4197
Commit:     1dad939ddbbd8d64e1edc7799df00a9e591b4197
Parent:     b5254eee7994ba0a44ba7386cb66c2ce2f30fcc6
Author:     trem <[EMAIL PROTECTED]>
AuthorDate: Tue Oct 2 14:04:38 2007 -0700
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Wed Oct 10 16:54:28 2007 -0700

    ipg.c doesn't compile with with CONFIG_HIGHMEM64G
    
    I've tried to compile 2.6.23-rc8-mm2, but it fails on ipg.c with the
    error : ERROR: "__udivdi3" [drivers/net/ipg.ko] undefined!
    
    I've instigated a bit, and I've found this code in ipg.c :
    
    static void ipg_nic_txfree(struct net_device *dev)
    {
           struct ipg_nic_private *sp = netdev_priv(dev);
           void __iomem *ioaddr = sp->ioaddr;
           const unsigned int curr = ipg_r32(TFD_LIST_PTR_0) -
                   (sp->txd_map / sizeof(struct ipg_tx)) - 1;
           unsigned int released, pending;
    
    sp->txd_map is an u64
    because :
        dma_addr_t txd_map;
    
    And in asm-i386/types.h, I see :
    #ifdef CONFIG_HIGHMEM64G
    typedef u64 dma_addr_t;
    #else
    typedef u32 dma_addr_t;
    #endif
    I my config, I use CONFIG_HIGHMEM64G
    
    sizeof(struct ipg_tx) is an u32
    So the div failed on i386 because of u64 / u32.
    
    [EMAIL PROTECTED]: cleanups]
    Cc: Sorbica Shieh <[EMAIL PROTECTED]>
    Cc: Jesse Huang <[EMAIL PROTECTED]>
    Cc: Jeff Garzik <[EMAIL PROTECTED]>
    Cc: "David S. Miller" <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]>
---
 drivers/net/ipg.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ipg.c b/drivers/net/ipg.c
index dfdc96f..59898ce 100644
--- a/drivers/net/ipg.c
+++ b/drivers/net/ipg.c
@@ -25,6 +25,8 @@
 #include <linux/mii.h>
 #include <linux/mutex.h>
 
+#include <asm/div64.h>
+
 #define IPG_RX_RING_BYTES      (sizeof(struct ipg_rx) * IPG_RFDLIST_LENGTH)
 #define IPG_TX_RING_BYTES      (sizeof(struct ipg_tx) * IPG_TFDLIST_LENGTH)
 #define IPG_RESET_MASK \
@@ -836,10 +838,14 @@ static void ipg_nic_txfree(struct net_device *dev)
 {
        struct ipg_nic_private *sp = netdev_priv(dev);
        void __iomem *ioaddr = sp->ioaddr;
-       const unsigned int curr = ipg_r32(TFD_LIST_PTR_0) -
-               (sp->txd_map / sizeof(struct ipg_tx)) - 1;
+       unsigned int curr;
+       u64 txd_map;
        unsigned int released, pending;
 
+       txd_map = (u64)sp->txd_map;
+       curr = ipg_r32(TFD_LIST_PTR_0) -
+               do_div(txd_map, sizeof(struct ipg_tx)) - 1;
+
        IPG_DEBUG_MSG("_nic_txfree\n");
 
        pending = sp->tx_current - sp->tx_dirty;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to