* [PATCH] x86/fpu/xstate: Use sizeof() instead of a constant
@ 2021-01-22 7:19 Yejune Deng
0 siblings, 0 replies; only message in thread
From: Yejune Deng @ 2021-01-22 7:19 UTC (permalink / raw)
To: tglx, mingo, bp, x86, hpa, dave.hansen, yu-cheng.yu, fenghua.yu,
tony.luck, kan.liang, viro, kevinb
Cc: linux-kernel, yejune.deng
In fpstate_sanitize_xstate(), use sizeof() instead of a constant,
at the same time, remove & and [0].
Signed-off-by: Yejune Deng <yejune.deng@gmail.com>
---
arch/x86/kernel/fpu/xstate.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/x86/kernel/fpu/xstate.c b/arch/x86/kernel/fpu/xstate.c
index 5d8047441a0a..683749b80ae2 100644
--- a/arch/x86/kernel/fpu/xstate.c
+++ b/arch/x86/kernel/fpu/xstate.c
@@ -167,14 +167,14 @@ void fpstate_sanitize_xstate(struct fpu *fpu)
fx->fop = 0;
fx->rip = 0;
fx->rdp = 0;
- memset(&fx->st_space[0], 0, 128);
+ memset(fx->st_space, 0, sizeof(fx->st_space));
}
/*
* SSE is in init state
*/
if (!(xfeatures & XFEATURE_MASK_SSE))
- memset(&fx->xmm_space[0], 0, 256);
+ memset(fx->xmm_space, 0, sizeof(fx->xmm_space));
/*
* First two features are FPU and SSE, which above we handled
--
2.29.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2021-01-22 7:20 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-22 7:19 [PATCH] x86/fpu/xstate: Use sizeof() instead of a constant Yejune Deng
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).