CV-Bowen opened a new pull request, #21089:
URL: https://github.com/apache/nuttx/pull/21089
## Summary
Coverity reports HIS_RETURN (more than one return statement) on most
functions in drivers/rptun/rptun.c. This reworks them to return once at
the end. No functional change:
- the role checks in rptun_init_carveout(), rptun_uninit_carveout() and
rptun_update_vring_da() move to their caller in rptun_create_device()
- rptun_create_devices() cleans up in the failing branch instead of at
a shared label, so every error path still removes the devices it
created
- rptun_initialize() still registers the panic notifier and adds the
instance to the list when the remote is not auto-started
The rptun_store_* loader callbacks are left as they are.
## Impact
None. No API, Kconfig or behavior change.
## Testing
Host: Ubuntu 22.04.5 LTS x86_64, QEMU version 10.2.1, sim: cc (Ubuntu
13.1.0-8ubuntu1~22.04) 13.1.0, qemu-armv8a: aarch64-none-elf-gcc (Arm GNU
Toolchain 12.2.Rel1 (Build arm-12.24)) 12.2.1 20221205
Both baseline configurations start the remote through rptun (sim_rptun
on sim, rptun_ivshmem on qemu-armv8a), which runs rptun_do_start(),
rptun_create_devices(), the carveout heap setup and the vring address
assignment touched here.
Baseline (`test.sh`, cases: baseline.yaml):
- host: Ubuntu 22.04.5 LTS x86_64, QEMU version 10.2.1, sim: cc (Ubuntu
13.1.0-8ubuntu1~22.04) 13.1.0, qemu-armv8a: aarch64-none-elf-gcc (Arm GNU
Toolchain 12.2.Rel1 (Build arm-12.24)) 12.2.1 20221205
- tested: nuttx 85438199891 apps 0c56297b0
- qemu-armv8a built with test-only overlay: disabled LIBC_ENVPATH
BINFMT_CHECKEXEC
- sim:rpserver + sim:rpproxy: PASS
- [x] `uname -a` (server)
- [x] `rpmsg dump all` (server)
- [x] `rpmsg ping all 10 1024 3 0` (server)
- [x] `uname -a` (proxy)
- [x] `rpmsg ping all 10 1024 3 0` (proxy)
- [x] `mount -t rpmsgfs -o cpu=server,fs=/proc /sp` (proxy)
- [x] `cat /sp/version` (proxy)
- [x] `rpmsg dump all` (proxy)
- qemu-armv8a:rpserver + qemu-armv8a:rpproxy: PASS
- [x] `uname -a` (server)
- [x] `uname -a` (proxy)
- [x] `rpmsg dump all` (server)
- [x] `rpmsg ping all 10 1024 3 0` (server)
- [x] `rpmsg ping all 10 1024 3 0` (proxy)
- [x] `mount -t rpmsgfs -o cpu=server,fs=/proc /sp` (proxy)
- [x] `cat /sp/version` (proxy)
`rptun stop /dev/rptun/proxy` on sim:rpserver was also tried, to cover
the stop path. It asserts in rpmsg_virtio.c (get_tx_payload_buffer with
wait) both on master and with this PR, so it is a separate, existing
issue and is not used as a test here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]