Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f305f789bb96ee6e35e71f58324b72abb7bd0b13
Commit:     f305f789bb96ee6e35e71f58324b72abb7bd0b13
Parent:     66341fffd4e5e546906ebcfeb6f5cce8df802c17
Author:     Al Viro <[EMAIL PROTECTED]>
AuthorDate: Sat Dec 22 19:44:00 2007 +0000
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Mon Jan 28 15:10:31 2008 -0800

    annotate netxen
    
    Signed-off-by: Al Viro <[EMAIL PROTECTED]>
    Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]>
---
 drivers/net/netxen/netxen_nic.h      |    4 ++--
 drivers/net/netxen/netxen_nic_hw.c   |   26 +++++++++++++-------------
 drivers/net/netxen/netxen_nic_init.c |    7 ++++---
 drivers/net/netxen/netxen_nic_main.c |    2 +-
 4 files changed, 20 insertions(+), 19 deletions(-)

diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h
index 724f755..2bc5eaa 100644
--- a/drivers/net/netxen/netxen_nic.h
+++ b/drivers/net/netxen/netxen_nic.h
@@ -898,7 +898,7 @@ struct netxen_adapter {
        u32 curr_window;
 
        u32 cmd_producer;
-       u32 *cmd_consumer;
+       __le32 *cmd_consumer;
 
        u32 last_cmd_consumer;
        u32 max_tx_desc_count;
@@ -1195,7 +1195,7 @@ dma_watchdog_wakeup(struct netxen_adapter *adapter)
 
 
 int netxen_is_flash_supported(struct netxen_adapter *adapter);
-int netxen_get_flash_mac_addr(struct netxen_adapter *adapter, u64 mac[]);
+int netxen_get_flash_mac_addr(struct netxen_adapter *adapter, __le64 mac[]);
 extern void netxen_change_ringparam(struct netxen_adapter *adapter);
 extern int netxen_rom_fast_read(struct netxen_adapter *adapter, int addr,
                                int *valp);
diff --git a/drivers/net/netxen/netxen_nic_hw.c 
b/drivers/net/netxen/netxen_nic_hw.c
index a88c51f..0135570 100644
--- a/drivers/net/netxen/netxen_nic_hw.c
+++ b/drivers/net/netxen/netxen_nic_hw.c
@@ -419,7 +419,7 @@ int netxen_nic_hw_resources(struct netxen_adapter *adapter)
        adapter->ctx_desc->cmd_consumer_offset =
            cpu_to_le64(adapter->ctx_desc_phys_addr +
                        sizeof(struct netxen_ring_ctx));
-       adapter->cmd_consumer = (uint32_t *) (((char *)addr) +
+       adapter->cmd_consumer = (__le32 *) (((char *)addr) +
                                              sizeof(struct netxen_ring_ctx));
 
        addr = netxen_alloc(adapter->ahw.pdev,
@@ -586,35 +586,35 @@ int netxen_is_flash_supported(struct netxen_adapter 
*adapter)
 }
 
 static int netxen_get_flash_block(struct netxen_adapter *adapter, int base,
-                                 int size, u32 * buf)
+                                 int size, __le32 * buf)
 {
        int i, addr;
-       u32 *ptr32;
+       __le32 *ptr32;
+       u32 v;
 
        addr = base;
        ptr32 = buf;
        for (i = 0; i < size / sizeof(u32); i++) {
-               if (netxen_rom_fast_read(adapter, addr, ptr32) == -1)
+               if (netxen_rom_fast_read(adapter, addr, &v) == -1)
                        return -1;
-               *ptr32 = cpu_to_le32(*ptr32);
+               *ptr32 = cpu_to_le32(v);
                ptr32++;
                addr += sizeof(u32);
        }
        if ((char *)buf + size > (char *)ptr32) {
-               u32 local;
-
-               if (netxen_rom_fast_read(adapter, addr, &local) == -1)
+               __le32 local;
+               if (netxen_rom_fast_read(adapter, addr, &v) == -1)
                        return -1;
-               local = cpu_to_le32(local);
+               local = cpu_to_le32(v);
                memcpy(ptr32, &local, (char *)buf + size - (char *)ptr32);
        }
 
        return 0;
 }
 
-int netxen_get_flash_mac_addr(struct netxen_adapter *adapter, u64 mac[])
+int netxen_get_flash_mac_addr(struct netxen_adapter *adapter, __le64 mac[])
 {
-       u32 *pmac = (u32 *) & mac[0];
+       __le32 *pmac = (__le32 *) & mac[0];
 
        if (netxen_get_flash_block(adapter,
                                   NETXEN_USER_START +
@@ -623,7 +623,7 @@ int netxen_get_flash_mac_addr(struct netxen_adapter 
*adapter, u64 mac[])
                                   FLASH_NUM_PORTS * sizeof(u64), pmac) == -1) {
                return -1;
        }
-       if (*mac == ~0ULL) {
+       if (*mac == cpu_to_le64(~0ULL)) {
                if (netxen_get_flash_block(adapter,
                                           NETXEN_USER_START_OLD +
                                           offsetof(struct netxen_user_old_info,
@@ -631,7 +631,7 @@ int netxen_get_flash_mac_addr(struct netxen_adapter 
*adapter, u64 mac[])
                                           FLASH_NUM_PORTS * sizeof(u64),
                                           pmac) == -1)
                        return -1;
-               if (*mac == ~0ULL)
+               if (*mac == cpu_to_le64(~0ULL))
                        return -1;
        }
        return 0;
diff --git a/drivers/net/netxen/netxen_nic_init.c 
b/drivers/net/netxen/netxen_nic_init.c
index 74685a1..9e38bcb 100644
--- a/drivers/net/netxen/netxen_nic_init.c
+++ b/drivers/net/netxen/netxen_nic_init.c
@@ -438,10 +438,11 @@ static int do_rom_fast_read_words(struct netxen_adapter 
*adapter, int addr,
        int ret = 0;
 
        for (addridx = addr; addridx < (addr + size); addridx += 4) {
-               ret = do_rom_fast_read(adapter, addridx, (int *)bytes);
+               int v;
+               ret = do_rom_fast_read(adapter, addridx, &v);
                if (ret != 0)
                        break;
-               *(int *)bytes = cpu_to_le32(*(int *)bytes);
+               *(__le32 *)bytes = cpu_to_le32(v);
                bytes += 4;
        }
 
@@ -501,7 +502,7 @@ static int do_rom_fast_write_words(struct netxen_adapter 
*adapter,
                int timeout = 0;
                int data;
 
-               data = le32_to_cpu((*(u32*)bytes));
+               data = le32_to_cpu((*(__le32*)bytes));
                ret = do_rom_fast_write(adapter, addridx, data);
                if (ret < 0)
                        return ret;
diff --git a/drivers/net/netxen/netxen_nic_main.c 
b/drivers/net/netxen/netxen_nic_main.c
index 2341b89..9737eae 100644
--- a/drivers/net/netxen/netxen_nic_main.c
+++ b/drivers/net/netxen/netxen_nic_main.c
@@ -277,7 +277,7 @@ netxen_nic_probe(struct pci_dev *pdev, const struct 
pci_device_id *ent)
        struct netxen_recv_context *recv_ctx = NULL;
        struct netxen_rcv_desc_ctx *rcv_desc = NULL;
        struct netxen_cmd_buffer *cmd_buf_arr = NULL;
-       u64 mac_addr[FLASH_NUM_PORTS + 1];
+       __le64 mac_addr[FLASH_NUM_PORTS + 1];
        int valid_mac = 0;
        u32 val;
        int pci_func_id = PCI_FUNC(pdev->devfn);
-
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