mirror of
https://github.com/koverstreet/bcachefs-tools.git
synced 2025-01-22 00:04:31 +03:00
raid/cpu: Use memcpy() instead of type punning
The vendor may not be suitably aligned for uint32_t *. Signed-off-by: Tavian Barnes <tavianator@tavianator.com>
This commit is contained in:
parent
8b06995115
commit
53d7722563
@ -57,9 +57,9 @@ static inline void raid_cpu_info(char *vendor, unsigned *family, unsigned *model
|
||||
|
||||
raid_cpuid(0, 0, reg);
|
||||
|
||||
((uint32_t*)vendor)[0] = reg[1];
|
||||
((uint32_t*)vendor)[1] = reg[3];
|
||||
((uint32_t*)vendor)[2] = reg[2];
|
||||
memcpy(vendor, ®[1], 4);
|
||||
memcpy(vendor + 4, ®[3], 4);
|
||||
memcpy(vendor + 8, ®[2], 4);
|
||||
vendor[12] = 0;
|
||||
|
||||
raid_cpuid(1, 0, reg);
|
||||
|
Loading…
Reference in New Issue
Block a user