Repository navigation
drivers/serial: do not build serial drivers when CONFIG_SERIAL is disabled - #21047
Conversation
|
|
@Swatantra-66 please fix: |
7c2fa45 to
91cfde8
Compare
|
Fixed. In configurations where CONFIG_SERIAL is disabled (such as stm32ldiscovery/chrono), CONFIG_FS_UIO is not defined while serial.c is still built. Guarded uart_readv, uart_writev, and related write helpers in drivers/serial/serial.c with CONFIG_FS_UIO |
jerpelea
left a comment
There was a problem hiding this comment.
This patch looks like an AI Assisted one and I can not see the disclosure according the community guidelines
Please clarify!
91cfde8 to
e054d4a
Compare
|
@jerpelea AI assistance was used during the investigation. I have updated the commit message to include the Assisted-by Google Gemini disclosure tag in accordance with the Apache NuttX community guidelines |
e054d4a to
ffa003a
Compare
ffa003a to
fdc4724
Compare
|
Re-indented drivers/serial/CMakeLists.txt to pass cmake-format |
…abled Previously, drivers/serial/Make.defs and CMakeLists.txt unconditionally compiled serial.c and serial_io.c, even when CONFIG_SERIAL was disabled. This caused unnecessary compilation and errors when CONFIG_SERIAL (which selects CONFIG_FS_UIO) was disabled. This change wraps serial driver compilation in drivers/serial/Make.defs and drivers/serial/CMakeLists.txt under CONFIG_SERIAL. Assisted-by: Google Gemini Signed-off-by: Swatantra Yadav <[email protected]>
fdc4724 to
bee6c06
Compare
Summary
Follow-up to #20820 (
fs/vfs: Add FS_UIO to option out vector I/O).In #20820,
CONFIG_FS_UIOwas made a hidden option selected byCONFIG_SERIAL. However, in configurations whereCONFIG_SERIALis disabled (e.g.nucleo-f303re:can,stm32f4discovery:lwl,qemu-intel64:earlyfb),drivers/serial/Make.defsanddrivers/serial/CMakeLists.txtwere still unconditionally compilingserial.candserial_io.c.As pointed out by @xiaoxiang781216,
serial.*should not be built whenCONFIG_SERIALis disabled.This PR:
drivers/serial/Make.defsunderifeq ($(CONFIG_SERIAL),y).drivers/serial/CMakeLists.txtunderif(CONFIG_SERIAL).(Note: We originally considered guarding
readv/writevinsidestruct file_operationsandstruct mountpt_operations, but dropped it because positional initializers across multiple filesystems would shift callbacks whenCONFIG_FS_UIOis disabled).Impact
serial.*whenCONFIG_SERIALis disabled, saving build time and flash.Testing
./tools/checkpatch.sh -c HEAD(0 errors, 0 warnings)./tools/configure.sh nucleo-f303re:can(verified configuration without serial builds cleanly)./tools/configure.sh sim:nsh(verified configuration with serial enabled)