Staging: slicoss: Remove explicit arch dependencies
authorDenis Kirjanov <dkirjanov@kernel.org>
Wed, 4 Aug 2010 19:24:08 +0000 (19:24 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 31 Aug 2010 18:52:28 +0000 (11:52 -0700)
Remove explicit arch dependencies

Signed-off-by: Denis Kirjanov <dkirjanov@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/slicoss/slic.h
drivers/staging/slicoss/slicoss.c

index beab400805af89cff386584ad23fdabb6f60a5fe..ebdcc6f91fdc1b771914278d6fcc84d46614217c 100644 (file)
@@ -515,14 +515,16 @@ struct adapter {
     (largestat) += ((newstat) - (oldstat));                              \
 }
 
-#if defined(CONFIG_X86_64) || defined(CONFIG_IA64)
+#if BITS_PER_LONG == 64
 #define   SLIC_GET_ADDR_LOW(_addr)  (u32)((u64)(_addr) & \
        0x00000000FFFFFFFF)
 #define   SLIC_GET_ADDR_HIGH(_addr)  (u32)(((u64)(_addr) >> 32) & \
        0x00000000FFFFFFFF)
-#else
-#define   SLIC_GET_ADDR_LOW(_addr)   (u32)_addr
+#elif BITS_PER_LONG == 32
+#define   SLIC_GET_ADDR_LOW(_addr)   (u32)(_addr)
 #define   SLIC_GET_ADDR_HIGH(_addr)  (u32)0
+#else
+#error BITS_PER_LONG must be 32 or 64
 #endif
 
 #define FLUSH          true
index f8c4b127e83a7456cd297e8bf77214e50212f1c4..58ff1233270ca6f0e02eb026b32be6794022f47c 100644 (file)
@@ -1099,19 +1099,17 @@ static void slic_link_upr_complete(struct adapter *adapter, u32 isr)
                struct slic_shmem *pshmem;
 
                pshmem = (struct slic_shmem *)adapter->phys_shmem;
-#if defined(CONFIG_X86_64)
+#if BITS_PER_LONG == 64
                slic_upr_queue_request(adapter,
                                       SLIC_UPR_RLSR,
                                       SLIC_GET_ADDR_LOW(&pshmem->linkstatus),
                                       SLIC_GET_ADDR_HIGH(&pshmem->linkstatus),
                                       0, 0);
-#elif defined(CONFIG_X86)
+#else
                slic_upr_queue_request(adapter,
                                       SLIC_UPR_RLSR,
                                       (u32) &pshmem->linkstatus,
                                       SLIC_GET_ADDR_HIGH(pshmem), 0, 0);
-#else
-               Stop Compilation;
 #endif
                return;
        }
@@ -1327,7 +1325,7 @@ static ushort slic_eeprom_cksum(char *m, int len)
        s_util.s = 0;
 
        w = (u16 *)m;
-#ifdef CONFIG_X86_64
+#if BITS_PER_LONG == 64
        w_int = (u32) ((ulong) w & 0x00000000FFFFFFFF);
 #else
        w_int = (u32) (w);
@@ -1439,11 +1437,15 @@ static int slic_rspqueue_init(struct adapter *adapter)
                        slic_rspqueue_free(adapter);
                        return -ENOMEM;
                }
+               /* FIXME:
+                * do we really need this assertions (4K PAGE_SIZE aligned addr)? */
+#if 0
 #ifndef CONFIG_X86_64
                ASSERT(((u32) rspq->vaddr[i] & 0xFFFFF000) ==
                       (u32) rspq->vaddr[i]);
                ASSERT(((u32) rspq->paddr[i] & 0xFFFFF000) ==
                       (u32) rspq->paddr[i]);
+#endif
 #endif
                memset(rspq->vaddr[i], 0, PAGE_SIZE);
 
@@ -1473,13 +1475,13 @@ static struct slic_rspbuf *slic_rspqueue_getnext(struct adapter *adapter)
                return NULL;
 
        buf = rspq->rspbuf;
-#ifndef CONFIG_X86_64
+#if BITS_PER_LONG == 32
        ASSERT((buf->status & 0xFFFFFFE0) == 0);
 #endif
        ASSERT(buf->hosthandle);
        if (++rspq->offset < SLIC_RSPQ_BUFSINPAGE) {
                rspq->rspbuf++;
-#ifndef CONFIG_X86_64
+#if BITS_PER_LONG == 32
                ASSERT(((u32) rspq->rspbuf & 0xFFFFFFE0) ==
                       (u32) rspq->rspbuf);
 #endif
@@ -1492,12 +1494,12 @@ static struct slic_rspbuf *slic_rspqueue_getnext(struct adapter *adapter)
                rspq->offset = 0;
                rspq->rspbuf = (struct slic_rspbuf *)
                                                rspq->vaddr[rspq->pageindex];
-#ifndef CONFIG_X86_64
+#if BITS_PER_LONG == 32
                ASSERT(((u32) rspq->rspbuf & 0xFFFFF000) ==
                       (u32) rspq->rspbuf);
 #endif
        }
-#ifndef CONFIG_X86_64
+#if BITS_PER_LONG == 32
        ASSERT(((u32) buf & 0xFFFFFFE0) == (u32) buf);
 #endif
        return buf;
@@ -1538,7 +1540,7 @@ static u32 *slic_cmdqmem_addpage(struct adapter *adapter)
                                        &cmdqmem->dma_pages[cmdqmem->pagecnt]);
        if (!pageaddr)
                return NULL;
-#ifndef CONFIG_X86_64
+#if BITS_PER_LONG == 32
        ASSERT(((u32) pageaddr & 0xFFFFF000) == (u32) pageaddr);
 #endif
        cmdqmem->pages[cmdqmem->pagecnt] = pageaddr;
@@ -1650,7 +1652,7 @@ static int slic_cmdq_init(struct adapter *adapter)
        adapter->slic_handle_ix = 1;
        for (i = 0; i < SLIC_CMDQ_INITPAGES; i++) {
                pageaddr = slic_cmdqmem_addpage(adapter);
-#ifndef CONFIG_X86_64
+#if BITS_PER_LONG == 32
                ASSERT(((u32) pageaddr & 0xFFFFF000) == (u32) pageaddr);
 #endif
                if (!pageaddr) {
@@ -2447,18 +2449,16 @@ static void slic_link_event_handler(struct adapter *adapter)
 
        pshmem = (struct slic_shmem *)adapter->phys_shmem;
 
-#if defined(CONFIG_X86_64)
+#if BITS_PER_LONG == 64
        status = slic_upr_request(adapter,
                                  SLIC_UPR_RLSR,
                                  SLIC_GET_ADDR_LOW(&pshmem->linkstatus),
                                  SLIC_GET_ADDR_HIGH(&pshmem->linkstatus),
                                  0, 0);
-#elif defined(CONFIG_X86)
+#else
        status = slic_upr_request(adapter, SLIC_UPR_RLSR,
                (u32) &pshmem->linkstatus,      /* no 4GB wrap guaranteed */
                                  0, 0, 0);
-#else
-       Stop compilation;
 #endif
        ASSERT(status == 0);
 }
@@ -2575,14 +2575,12 @@ static void slic_xmit_build_request(struct adapter *adapter,
        ihcmd->u.slic_buffers.bufs[0].paddrl = SLIC_GET_ADDR_LOW(phys_addr);
        ihcmd->u.slic_buffers.bufs[0].paddrh = SLIC_GET_ADDR_HIGH(phys_addr);
        ihcmd->u.slic_buffers.bufs[0].length = skb->len;
-#if defined(CONFIG_X86_64)
+#if BITS_PER_LONG == 64
        hcmd->cmdsize = (u32) ((((u64)&ihcmd->u.slic_buffers.bufs[1] -
                                     (u64) hcmd) + 31) >> 5);
-#elif defined(CONFIG_X86)
+#else
        hcmd->cmdsize = ((((u32) &ihcmd->u.slic_buffers.bufs[1] -
                           (u32) hcmd) + 31) >> 5);
-#else
-       Stop Compilation;
 #endif
 }
 
@@ -3078,16 +3076,14 @@ static int slic_if_init(struct adapter *adapter)
                spin_lock_irqsave(&adapter->bit64reglock.lock,
                                        adapter->bit64reglock.flags);
 
-#if defined(CONFIG_X86_64)
+#if BITS_PER_LONG == 64
                slic_reg32_write(&slic_regs->slic_addr_upper,
                                 SLIC_GET_ADDR_HIGH(&pshmem->isr), DONT_FLUSH);
                slic_reg32_write(&slic_regs->slic_isp,
                                 SLIC_GET_ADDR_LOW(&pshmem->isr), FLUSH);
-#elif defined(CONFIG_X86)
+#else
                slic_reg32_write(&slic_regs->slic_addr_upper, 0, DONT_FLUSH);
                slic_reg32_write(&slic_regs->slic_isp, (u32)&pshmem->isr, FLUSH);
-#else
-               Stop Compilations
 #endif
                spin_unlock_irqrestore(&adapter->bit64reglock.lock,
                                        adapter->bit64reglock.flags);