diff options
author | Douglas Thompson <dougthompson@xmission.com> | 2007-07-19 04:50:21 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-19 13:04:56 -0400 |
commit | 7391c6dcab3094610cb99bbd559beaa282582eac (patch) | |
tree | 29ec05cc8abdb9be8311ea797b29c9c5b9a99aea /drivers/edac/edac_device.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_device.c')
-rw-r--r-- | drivers/edac/edac_device.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/edac/edac_device.c b/drivers/edac/edac_device.c index 3ccadda3e723..d60f5df87af5 100644 --- a/drivers/edac/edac_device.c +++ b/drivers/edac/edac_device.c | |||
@@ -89,17 +89,14 @@ struct edac_device_ctl_info *edac_device_alloc_ctl_info( | |||
89 | dev_ctl = (struct edac_device_ctl_info *)NULL; | 89 | dev_ctl = (struct edac_device_ctl_info *)NULL; |
90 | 90 | ||
91 | /* Calc the 'end' offset past the ctl_info structure */ | 91 | /* Calc the 'end' offset past the ctl_info structure */ |
92 | dev_inst = (struct edac_device_instance *) | 92 | dev_inst = edac_align_ptr(&dev_ctl[1], sizeof(*dev_inst)); |
93 | edac_align_ptr(&dev_ctl[1], sizeof(*dev_inst)); | ||
94 | 93 | ||
95 | /* Calc the 'end' offset past the instance array */ | 94 | /* Calc the 'end' offset past the instance array */ |
96 | dev_blk = (struct edac_device_block *) | 95 | dev_blk = edac_align_ptr(&dev_inst[nr_instances], sizeof(*dev_blk)); |
97 | edac_align_ptr(&dev_inst[nr_instances], sizeof(*dev_blk)); | ||
98 | 96 | ||
99 | /* Calc the 'end' offset past the dev_blk array */ | 97 | /* Calc the 'end' offset past the dev_blk array */ |
100 | count = nr_instances * nr_blocks; | 98 | count = nr_instances * nr_blocks; |
101 | dev_attrib = (struct edac_attrib *) | 99 | dev_attrib = edac_align_ptr(&dev_blk[count], sizeof(*dev_attrib)); |
102 | edac_align_ptr(&dev_blk[count], sizeof(*dev_attrib)); | ||
103 | 100 | ||
104 | /* Check for case of NO attributes specified */ | 101 | /* Check for case of NO attributes specified */ |
105 | if (nr_attribs > 0) | 102 | if (nr_attribs > 0) |