mirror of
https://review.coreboot.org/flashrom.git
synced 2025-04-27 23:22:37 +02:00
Fix for gcc 4.4 strict aliasing rules
Corresponding to flashrom svn r714. Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
This commit is contained in:
parent
34eae34922
commit
95e892b9d3
@ -133,7 +133,7 @@ static int fd_msr = -1;
|
||||
|
||||
msr_t rdmsr(int addr)
|
||||
{
|
||||
uint8_t buf[8];
|
||||
uint32_t buf[2];
|
||||
msr_t msr = { 0xffffffff, 0xffffffff };
|
||||
|
||||
if (lseek(fd_msr, (off_t) addr, SEEK_SET) == -1) {
|
||||
@ -143,8 +143,8 @@ msr_t rdmsr(int addr)
|
||||
}
|
||||
|
||||
if (read(fd_msr, buf, 8) == 8) {
|
||||
msr.lo = *(uint32_t *)buf;
|
||||
msr.hi = *(uint32_t *)(buf + 4);
|
||||
msr.lo = buf[0];
|
||||
msr.hi = buf[1];
|
||||
|
||||
return msr;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user