nuttx/include
pangzhen1 7b154402fb sched/irq: Consolidate IRQ bounds checking into IRQ_TO_NDX macro
Previously, IRQ bounds checking (irq >= 0 && irq < NR_IRQS) was duplicated
across multiple IRQ subsystem functions before calling IRQ_TO_NDX(). This
led to code duplication and inconsistency.

This patch consolidates all IRQ bounds checking into the IRQ_TO_NDX() macro
itself, which now returns -EINVAL for out-of-bounds IRQ numbers. This approach:

1. Eliminates duplicated bounds checking code
2. Ensures consistent error handling across all IRQ functions
3. Simplifies caller code - just check if IRQ_TO_NDX() returns negative
4. Makes the macro behavior more predictable and self-contained

Changes:
- Modified IRQ_TO_NDX() to check (irq < 0 || irq >= NR_IRQS) and return -EINVAL
- Removed redundant IRQ range checks in irq_attach(), irq_attach_thread(),
  irq_attach_wqueue(), and irqchain_detach()
- Simplified error handling to check ndx < 0 after IRQ_TO_NDX() call

This consolidation reduces code size and improves maintainability while
preserving all existing error checking functionality.

Signed-off-by: pangzhen1 <pangzhen1@xiaomi.com>
2026-01-28 13:35:30 +08:00
..
android
arpa
crypto crypto: support software key management based on MTD 2026-01-28 11:52:12 +08:00
cxx cxx/cstddef: expose 'max_align_t' 2025-12-09 18:03:10 +08:00
net net/ethernet: change struct ifreq to consistent with Linux 2025-12-27 20:34:17 +08:00
netinet netinet/in.h: Rename imr_interface to imr_address in struct ip_mreqn. 2026-01-16 09:42:12 +08:00
netpacket net/packet: add PACKET_<ADD|DROP>_MEMBERSHIP support 2025-12-25 10:01:43 +08:00
nuttx sched/irq: Consolidate IRQ bounds checking into IRQ_TO_NDX macro 2026-01-28 13:35:30 +08:00
ssp
sys syscall: add sched_note_event_ip syscall for instrumentation dump 2026-01-28 02:06:23 +08:00
.gitignore
aio.h
alloca.h
assert.h
byteswap.h
ctype.h
debug.h drivers/rptun: add rptun debug config macros and Kconfig 2026-01-19 14:18:27 +08:00
dirent.h
dlfcn.h
dsp.h
dspb16.h
elf.h arch:use ARCH_64BIT to mark arch is support 64bit 2025-12-18 22:05:12 +08:00
elf32.h
elf64.h
endian.h
err.h
errno.h
execinfo.h
fcntl.h libc: add creat function implementation 2026-01-16 01:38:20 +08:00
fixedmath.h
fnmatch.h
ftw.h
gcov.h gcov: Refactoring the implementation framework of gcov 2025-07-03 00:17:58 +08:00
getopt.h
glob.h
grp.h
hex2bin.h
iconv.h
ifaddrs.h
imx_container.h
inttypes.h inttype.h: add PRIuTM(time_t) to handle TIME64 & TIME32 print compatible 2025-12-01 10:07:49 +01:00
iso646.h
langinfo.h
libgen.h
libintl.h
limits.h limits: add _POSIX_PTHREAD_ constant for pthread management 2026-01-16 16:15:35 +08:00
locale.h style/FAR: remove FAR qualifier 2025-11-10 10:56:29 +01:00
lzf.h
malloc.h
mqueue.h
netdb.h
nl_types.h
nxflat.h
obstack.h
poll.h
pthread.h libc/pthread: Avoid compiler optimizations for once_control->done 2026-01-22 19:47:45 +08:00
pty.h
pwd.h
regex.h
resolv.h
sched.h
search.h LICENSE: update NuttX-PublicDomain SPDX identifier 2025-12-26 19:46:12 +08:00
semaphore.h sched/semaphore: add support to customize semaphore max allowed value 2025-09-04 09:48:34 +08:00
shadow.h
signal.h sched/timer: Fix MISRA Rule 10.4 2026-01-22 22:14:00 +08:00
spawn.h libc/spawn:support get/set priority 2026-01-26 21:01:01 +08:00
stdbool.h
stddef.h arm64_head.S: fix the asm code build error 2026-01-13 21:20:52 +08:00
stdint.h arm64_head.S: fix the asm code build error 2026-01-13 21:20:52 +08:00
stdio.h stdio.h: Update TMP_MAX definition to match Linux. 2026-01-14 17:28:30 -08:00
stdlib.h
stdnoreturn.h
string.h string:use builtin function to optimize libc function 2025-12-20 10:38:53 +08:00
strings.h libc: remove reference to non-existent readme 2025-10-11 17:07:51 -04:00
syscall.h
syslog.h drivers/syslog: Add RFC 5424 protocol support 2025-06-13 20:26:57 +08:00
termios.h include: modify for support socat, so need add some macro same as linux 2025-12-10 23:44:14 +08:00
threads.h
time.h
ulimit.h ulimit: add ulimit implementation 2026-01-16 10:03:53 +08:00
unistd.h fpathconf: add _POSIX_PRIO_IO defintion 2026-01-15 16:10:51 -03:00
utime.h
uuid.h
wait.h
wchar.h
wctype.h