Commit 4dfb7cbe authored by Salyzyn, Mark's avatar Salyzyn, Mark Committed by James Bottomley

[SCSI] aacraid: resolve compiler warnings using ptrdiff_t

Unsigned long is not always the same size as a pointer, namely on 32 bit
systems with 64 bit address space. Ptrdiff_t is the same size as a
pointer in all configurations. By using ptrdiff_t we can mitigate the
warning messages on these configurations. There should be no side
effects of this patch.
Signed-off-by: default avatarMark Salyzyn <aacraid@adaptec.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent 10c9a017
...@@ -391,10 +391,8 @@ static int close_getadapter_fib(struct aac_dev * dev, void __user *arg) ...@@ -391,10 +391,8 @@ static int close_getadapter_fib(struct aac_dev * dev, void __user *arg)
/* /*
* Extract the fibctx from the input parameters * Extract the fibctx from the input parameters
*/ */
if (fibctx->unique == (u32)(unsigned long)arg) { if (fibctx->unique == (u32)(ptrdiff_t)arg) /* We found a winner */
/* We found a winner */
break; break;
}
entry = entry->next; entry = entry->next;
fibctx = NULL; fibctx = NULL;
} }
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* based on the old aacraid driver that is.. * based on the old aacraid driver that is..
* Adaptec aacraid device driver for Linux. * Adaptec aacraid device driver for Linux.
* *
* Copyright (c) 2000 Adaptec, Inc. (aacraid@adaptec.com) * Copyright (c) 2000-2007 Adaptec, Inc. (aacraid@adaptec.com)
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
...@@ -110,7 +110,7 @@ static int aac_alloc_comm(struct aac_dev *dev, void **commaddr, unsigned long co ...@@ -110,7 +110,7 @@ static int aac_alloc_comm(struct aac_dev *dev, void **commaddr, unsigned long co
/* /*
* Align the beginning of Headers to commalign * Align the beginning of Headers to commalign
*/ */
align = (commalign - ((unsigned long)(base) & (commalign - 1))); align = (commalign - ((ptrdiff_t)(base) & (commalign - 1)));
base = base + align; base = base + align;
phys = phys + align; phys = phys + align;
/* /*
......
...@@ -256,7 +256,8 @@ unsigned int aac_intr_normal(struct aac_dev * dev, u32 Index) ...@@ -256,7 +256,8 @@ unsigned int aac_intr_normal(struct aac_dev * dev, u32 Index)
return 1; return 1;
} }
memset(hw_fib, 0, sizeof(struct hw_fib)); memset(hw_fib, 0, sizeof(struct hw_fib));
memcpy(hw_fib, (struct hw_fib *)(((unsigned long)(dev->regs.sa)) + (index & ~0x00000002L)), sizeof(struct hw_fib)); memcpy(hw_fib, (struct hw_fib *)(((ptrdiff_t)(dev->regs.sa)) +
(index & ~0x00000002L)), sizeof(struct hw_fib));
memset(fib, 0, sizeof(struct fib)); memset(fib, 0, sizeof(struct fib));
INIT_LIST_HEAD(&fib->fiblink); INIT_LIST_HEAD(&fib->fiblink);
fib->type = FSAFS_NTC_FIB_CONTEXT; fib->type = FSAFS_NTC_FIB_CONTEXT;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment