diff options
author | Douglas Thompson <dougthompson@xmission.com> | 2007-07-19 01:50:21 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-19 10:04:56 -0700 |
commit | 7391c6dcab3094610cb99bbd559beaa282582eac (patch) | |
tree | 29ec05cc8abdb9be8311ea797b29c9c5b9a99aea /drivers/edac/edac_mc.c | |
parent | 52490c8d07680a7ecc3c1a70a16841455d37e96a (diff) |
drivers/edac: mod edac_align_ptr function
Refactor the edac_align_ptr() function to reduce the noise of casting the
aligned pointer to the various types of data objects and modified its callers
to its new signature
Signed-off-by: Douglas Thompson <dougthompson@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/edac/edac_mc.c')
-rw-r--r-- | drivers/edac/edac_mc.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c index 219e861eb3f..85686031478 100644 --- a/drivers/edac/edac_mc.c +++ b/drivers/edac/edac_mc.c @@ -85,7 +85,7 @@ static void edac_mc_dump_mci(struct mem_ctl_info *mci) * If 'size' is a constant, the compiler will optimize this whole function * down to either a no-op or the addition of a constant to the value of 'ptr'. */ -char *edac_align_ptr(void *ptr, unsigned size) +void *edac_align_ptr(void *ptr, unsigned size) { unsigned align, r; @@ -109,7 +109,7 @@ char *edac_align_ptr(void *ptr, unsigned size) if (r == 0) return (char *)ptr; - return (char *)(((unsigned long)ptr) + align - r); + return (void *)(((unsigned long)ptr) + align - r); } /** @@ -144,9 +144,8 @@ struct mem_ctl_info *edac_mc_alloc(unsigned sz_pvt, unsigned nr_csrows, * hardcode everything into a single struct. */ mci = (struct mem_ctl_info *)0; - csi = (struct csrow_info *)edac_align_ptr(&mci[1], sizeof(*csi)); - chi = (struct channel_info *) - edac_align_ptr(&csi[nr_csrows], sizeof(*chi)); + csi = edac_align_ptr(&mci[1], sizeof(*csi)); + chi = edac_align_ptr(&csi[nr_csrows], sizeof(*chi)); pvt = edac_align_ptr(&chi[nr_chans * nr_csrows], sz_pvt); size = ((unsigned long)pvt) + sz_pvt; |