Skip to content

Commit 59cac9d

Browse files
Neogulmanpassingbybp3tk0v
authored andcommitted
selftests/x86: Clean up sysret_rip coding style
Tidy up sysret_rip style (cast spacing, main(void), const placement). No functional change intended. Signed-off-by: UYeol Jo <jouyeol8739@gmail.com> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Link: https://patch.msgid.link/20260111210126.74752-1-jouyeol8739@gmail.com
1 parent b81db37 commit 59cac9d

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

tools/testing/selftests/x86/sysret_rip.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
void test_syscall_ins(void);
3232
extern const char test_page[];
3333

34-
static void const *current_test_page_addr = test_page;
34+
static const void *current_test_page_addr = test_page;
3535

3636
/* State used by our signal handlers. */
3737
static gregset_t initial_regs;
@@ -40,7 +40,7 @@ static volatile unsigned long rip;
4040

4141
static void sigsegv_for_sigreturn_test(int sig, siginfo_t *info, void *ctx_void)
4242
{
43-
ucontext_t *ctx = (ucontext_t*)ctx_void;
43+
ucontext_t *ctx = (ucontext_t *)ctx_void;
4444

4545
if (rip != ctx->uc_mcontext.gregs[REG_RIP]) {
4646
printf("[FAIL]\tRequested RIP=0x%lx but got RIP=0x%lx\n",
@@ -56,7 +56,7 @@ static void sigsegv_for_sigreturn_test(int sig, siginfo_t *info, void *ctx_void)
5656

5757
static void sigusr1(int sig, siginfo_t *info, void *ctx_void)
5858
{
59-
ucontext_t *ctx = (ucontext_t*)ctx_void;
59+
ucontext_t *ctx = (ucontext_t *)ctx_void;
6060

6161
memcpy(&initial_regs, &ctx->uc_mcontext.gregs, sizeof(gregset_t));
6262

@@ -69,8 +69,6 @@ static void sigusr1(int sig, siginfo_t *info, void *ctx_void)
6969
ctx->uc_mcontext.gregs[REG_R11]);
7070

7171
sethandler(SIGSEGV, sigsegv_for_sigreturn_test, SA_RESETHAND);
72-
73-
return;
7472
}
7573

7674
static void test_sigreturn_to(unsigned long ip)
@@ -84,7 +82,7 @@ static jmp_buf jmpbuf;
8482

8583
static void sigsegv_for_fallthrough(int sig, siginfo_t *info, void *ctx_void)
8684
{
87-
ucontext_t *ctx = (ucontext_t*)ctx_void;
85+
ucontext_t *ctx = (ucontext_t *)ctx_void;
8886

8987
if (rip != ctx->uc_mcontext.gregs[REG_RIP]) {
9088
printf("[FAIL]\tExpected SIGSEGV at 0x%lx but got RIP=0x%lx\n",
@@ -130,7 +128,7 @@ static void test_syscall_fallthrough_to(unsigned long ip)
130128
printf("[OK]\tWe survived\n");
131129
}
132130

133-
int main()
131+
int main(void)
134132
{
135133
/*
136134
* When the kernel returns from a slow-path syscall, it will

0 commit comments

Comments
 (0)