ftpd: Simplify console_fs_error logic
All checks were successful
Build system / Check kernel codestyle (pull_request) Successful in 26s
Build system / Build (pull_request) Successful in 10m19s

This commit is contained in:
2026-03-03 23:43:40 +05:00
parent 2893749afb
commit e72e908c1a

View File

@@ -337,6 +337,7 @@ align 4
fs_err_table:
dd str_fs_error2 ; 2
dd str_fs_error3 ; 3
dd str_fs_error ; 4
dd str_fs_error5 ; 5
dd str_fs_error6 ; 6
dd str_fs_error7 ; 7
@@ -347,23 +348,19 @@ fs_err_table:
dd str_fs_error12 ; 12
console_fs_error:
cmp eax, 2
jb .out_of_range
cmp eax, 12
ja .out_of_range
cmp eax, 4
ja .after4
sub eax, 2
jmp .index_ok
.after4:
sub eax, 3
.index_ok:
mov edx, [fs_err_table + eax*4]
invoke con_write_asciiz, edx
ret
mov edx, 4 ; Unknown filesystem error
.out_of_range:
invoke con_write_asciiz, str_fs_error
cmp eax, 2
jb .print_err
cmp eax, 12
ja .print_err
mov edx, eax
.print_err:
sub edx, 2
mov edx, [fs_err_table + edx*4]
invoke con_write_asciiz, edx
ret
;------------------------------------------------