s390/vdso: use union tod_clock

Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
This commit is contained in:
Heiko Carstens 2021-02-08 16:16:28 +01:00 коммит произвёл Vasily Gorbik
Родитель f8d8977a3d
Коммит 169ceac429
1 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -8,12 +8,12 @@
int __s390_vdso_getcpu(unsigned *cpu, unsigned *node, struct getcpu_cache *unused) int __s390_vdso_getcpu(unsigned *cpu, unsigned *node, struct getcpu_cache *unused)
{ {
__u16 todval[8]; union tod_clock clk;
/* CPU number is stored in the programmable field of the TOD clock */ /* CPU number is stored in the programmable field of the TOD clock */
get_tod_clock_ext((char *)todval); store_tod_clock_ext(&clk);
if (cpu) if (cpu)
*cpu = todval[7]; *cpu = clk.pf;
/* NUMA node is always zero */ /* NUMA node is always zero */
if (node) if (node)
*node = 0; *node = 0;