aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/edac/edac_mc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/edac/edac_mc.c')
-rw-r--r--drivers/edac/edac_mc.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c
index 219e861eb3f9..856860314789 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)
85 * If 'size' is a constant, the compiler will optimize this whole function 85 * If 'size' is a constant, the compiler will optimize this whole function
86 * down to either a no-op or the addition of a constant to the value of 'ptr'. 86 * down to either a no-op or the addition of a constant to the value of 'ptr'.
87 */ 87 */
88char *edac_align_ptr(void *ptr, unsigned size) 88void *edac_align_ptr(void *ptr, unsigned size)
89{ 89{
90 unsigned align, r; 90 unsigned align, r;
91 91
@@ -109,7 +109,7 @@ char *edac_align_ptr(void *ptr, unsigned size)
109 if (r == 0) 109 if (r == 0)
110 return (char *)ptr; 110 return (char *)ptr;
111 111
112 return (char *)(((unsigned long)ptr) + align - r); 112 return (void *)(((unsigned long)ptr) + align - r);
113} 113}
114 114
115/** 115/**
@@ -144,9 +144,8 @@ struct mem_ctl_info *edac_mc_alloc(unsigned sz_pvt, unsigned nr_csrows,
144 * hardcode everything into a single struct. 144 * hardcode everything into a single struct.
145 */ 145 */
146 mci = (struct mem_ctl_info *)0; 146 mci = (struct mem_ctl_info *)0;
147 csi = (struct csrow_info *)edac_align_ptr(&mci[1], sizeof(*csi)); 147 csi = edac_align_ptr(&mci[1], sizeof(*csi));
148 chi = (struct channel_info *) 148 chi = edac_align_ptr(&csi[nr_csrows], sizeof(*chi));
149 edac_align_ptr(&csi[nr_csrows], sizeof(*chi));
150 pvt = edac_align_ptr(&chi[nr_chans * nr_csrows], sz_pvt); 149 pvt = edac_align_ptr(&chi[nr_chans * nr_csrows], sz_pvt);
151 size = ((unsigned long)pvt) + sz_pvt; 150 size = ((unsigned long)pvt) + sz_pvt;
152 151