]> Projects (at) Tadryanom (dot) Me - AdrOS.git/commit
fix: resolve all sparse static analysis warnings
authorTulio A M Mendes <[email protected]>
Mon, 6 Apr 2026 23:37:35 +0000 (20:37 -0300)
committerTulio A M Mendes <[email protected]>
Mon, 6 Apr 2026 23:37:35 +0000 (20:37 -0300)
commitc202fdf4c64c186e9bfa3676f1a0e095635829ed
treeb4c3012a557c69da4b0c3d8ea63cbb0d959fecf2
parentfac5d10340df24a0cf17d170d71dddf1a00f509b
fix: resolve all sparse static analysis warnings

- Replace plain integer 0 with NULL for pointer assignments, returns,
  and comparisons across 24 source files (kernel, drivers, HAL, arch, net)
- Add missing <stddef.h> includes for NULL in keyboard.c and uart.c
- Make file-local symbols static in idt.c (idt, idtp, interrupt_handlers,
  idt_set_gate, pic_remap, print_reg) and scheduler.c (ready_queue_tail)
- Add missing extern/prototype declarations to headers:
  idt.h (isr_handler), syscall.h (syscall_handler),
  process.h (ready_queue_head, sched_lock, sched_set_init_pid,
  sched_assign_pid1, sched_ap_init), net.h (net_dhcp_start),
  percpu.h (_percpu_gs_lut, percpu_get_ptr), smp.h (ap_sched_go,
  ap_entry), arch_syscall.h (x86_sysenter_set_kernel_stack,
  sysenter_init_ap), hal/usermode.h (x86_usermode_test_start),
  hal/cpu.h (g_smap_enabled), ata_pio.h (ata_register_devfs),
  boot_info.h (kernel_main)
- Add forward declarations for compiler ABI symbols in utils.c
- Include own headers in source files so sparse sees declarations
- Add lwIP/net include paths to SPARSE_FLAGS in Makefile

Verified: make check (0 warnings), make test-host (116/116 pass),
make test (102/103 pass, 1 pre-existing timeout)
42 files changed:
Makefile
include/arch/x86/idt.h
include/arch/x86/percpu.h
include/arch/x86/smp.h
include/arch_syscall.h
include/ata_pio.h
include/hal/cpu.h
include/hal/usermode.h
include/kernel/boot_info.h
include/net.h
include/process.h
include/syscall.h
src/arch/x86/idt.c
src/arch/x86/ioapic.c
src/arch/x86/lapic.c
src/arch/x86/sysenter_init.c
src/arch/x86/usermode.c
src/drivers/ata_pio.c
src/drivers/e1000.c
src/drivers/initrd.c
src/drivers/pci.c
src/drivers/vga_console.c
src/hal/x86/ata_pio.c
src/hal/x86/cpu_features.c
src/hal/x86/keyboard.c
src/hal/x86/pci.c
src/hal/x86/timer.c
src/hal/x86/uart.c
src/kernel/devfs.c
src/kernel/diskfs.c
src/kernel/kconsole.c
src/kernel/overlayfs.c
src/kernel/persistfs.c
src/kernel/pty.c
src/kernel/scheduler.c
src/kernel/sync.c
src/kernel/syscall.c
src/kernel/tmpfs.c
src/kernel/utils.c
src/kernel/vdso.c
src/net/dns.c
src/net/e1000_netif.c