note->n_descsz = cpu_to_le32(descsz);
note->n_type = cpu_to_le32(NT_PRSTATUS);
buf = (char *)note;
- buf += ((sizeof(Elf64_Nhdr) + 3) / 4) * 4;
+ buf += ROUND_UP(sizeof(Elf64_Nhdr), 4);
memcpy(buf, name, name_size);
- buf += ((name_size + 3) / 4) * 4;
+ buf += ROUND_UP(name_size, 4);
memcpy(buf + 32, &id, 4); /* pr_pid */
buf += descsz - sizeof(x86_64_user_regs_struct)-sizeof(target_ulong);
memcpy(buf, ®s, sizeof(x86_64_user_regs_struct));
note->n_descsz = cpu_to_le32(descsz);
note->n_type = cpu_to_le32(NT_PRSTATUS);
buf = (char *)note;
- buf += ((sizeof(Elf64_Nhdr) + 3) / 4) * 4;
+ buf += ROUND_UP(sizeof(Elf64_Nhdr), 4);
memcpy(buf, name, name_size);
- buf += ((name_size + 3) / 4) * 4;
+ buf += ROUND_UP(name_size, 4);
memcpy(buf, &prstatus, sizeof(prstatus));
ret = f(note, note_size, opaque);
note->n_descsz = cpu_to_le32(descsz);
note->n_type = cpu_to_le32(NT_PRSTATUS);
buf = (char *)note;
- buf += ((sizeof(Elf32_Nhdr) + 3) / 4) * 4;
+ buf += ROUND_UP(sizeof(Elf32_Nhdr), 4);
memcpy(buf, name, name_size);
- buf += ((name_size + 3) / 4) * 4;
+ buf += ROUND_UP(name_size, 4);
memcpy(buf, &prstatus, sizeof(prstatus));
ret = f(note, note_size, opaque);
note64->n_type = 0;
}
buf = note;
- buf += ((note_head_size + 3) / 4) * 4;
+ buf += ROUND_UP(note_head_size, 4);
memcpy(buf, name, name_size);
- buf += ((name_size + 3) / 4) * 4;
+ buf += ROUND_UP(name_size, 4);
memcpy(buf, &state, sizeof(state));
ret = f(note, note_size, opaque);