tree-wide: use ALIGN_PTR()
This commit is contained in:
@@ -55,9 +55,9 @@ static inline void static_destruct(void) {
|
||||
if (!__start_SYSTEMD_STATIC_DESTRUCT)
|
||||
return;
|
||||
|
||||
d = ALIGN_TO_PTR(__start_SYSTEMD_STATIC_DESTRUCT, sizeof(void*));
|
||||
d = ALIGN_PTR(__start_SYSTEMD_STATIC_DESTRUCT);
|
||||
while (d < __stop_SYSTEMD_STATIC_DESTRUCT) {
|
||||
d->destroy(d->data);
|
||||
d = ALIGN_TO_PTR(d + 1, sizeof(void*));
|
||||
d = ALIGN_PTR(d + 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ static int bus_error_name_to_errno(const char *name) {
|
||||
}
|
||||
}
|
||||
|
||||
m = ALIGN_TO_PTR(__start_SYSTEMD_BUS_ERROR_MAP, sizeof(void*));
|
||||
m = ALIGN_PTR(__start_SYSTEMD_BUS_ERROR_MAP);
|
||||
while (m < __stop_SYSTEMD_BUS_ERROR_MAP) {
|
||||
/* For magic ELF error maps, the end marker might
|
||||
* appear in the middle of things, since multiple maps
|
||||
@@ -101,7 +101,7 @@ static int bus_error_name_to_errno(const char *name) {
|
||||
* boundary, which is the selected alignment for the
|
||||
* arrays. */
|
||||
if (m->code == BUS_ERROR_MAP_END_MARKER) {
|
||||
m = ALIGN_TO_PTR(m + 1, sizeof(void*));
|
||||
m = ALIGN_PTR(m + 1);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -131,11 +131,11 @@ static int dump_mapping_table(void) {
|
||||
const sd_bus_error_map *m;
|
||||
|
||||
printf("----- errno mappings ------\n");
|
||||
m = ALIGN_TO_PTR(__start_SYSTEMD_BUS_ERROR_MAP, sizeof(void*));
|
||||
m = ALIGN_PTR(__start_SYSTEMD_BUS_ERROR_MAP);
|
||||
while (m < __stop_SYSTEMD_BUS_ERROR_MAP) {
|
||||
|
||||
if (m->code == BUS_ERROR_MAP_END_MARKER) {
|
||||
m = ALIGN_TO_PTR(m + 1, sizeof(void*));
|
||||
m = ALIGN_PTR(m + 1);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -88,7 +88,7 @@ static inline int run_test_table(void) {
|
||||
if (!__start_SYSTEMD_TEST_TABLE)
|
||||
return r;
|
||||
|
||||
const TestFunc *t = ALIGN_TO_PTR(__start_SYSTEMD_TEST_TABLE, sizeof(TestFunc*));
|
||||
const TestFunc *t = ALIGN_PTR(__start_SYSTEMD_TEST_TABLE);
|
||||
while (t < __stop_SYSTEMD_TEST_TABLE) {
|
||||
|
||||
if (t->sd_booted && sd_booted() <= 0) {
|
||||
@@ -106,7 +106,7 @@ static inline int run_test_table(void) {
|
||||
t->f.void_func();
|
||||
}
|
||||
|
||||
t = ALIGN_TO_PTR(t + 1, sizeof(TestFunc*));
|
||||
t = ALIGN_PTR(t + 1);
|
||||
}
|
||||
|
||||
return r;
|
||||
|
||||
Reference in New Issue
Block a user