lkml.org 
[lkml]   [2023]   [Jul]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v3] riscv: entry: set a0 = -ENOSYS only when syscall != -1
Date
Andreas Schwab <schwab@suse.de> writes:

> On Jul 19 2023, Celeste Liu wrote:
>
>> @@ -308,7 +312,7 @@ asmlinkage __visible __trap_section void do_trap_ecall_u(struct pt_regs *regs)
>>
>> if (syscall < NR_syscalls)
>> syscall_handler(regs, syscall);
>> - else
>> + else if ((long)syscall != -1L)
>
> You can also use syscall != -1UL or even syscall != -1.

The former is indeed better for the eyes! :-) The latter will get a
-Wsign-compare warning, no?


Björn

\
 
 \ /
  Last update: 2023-07-19 18:29    [W:0.114 / U:1.528 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site