Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up drivers header files 2 #1

Closed
wants to merge 27 commits into from

Conversation

hugueskamba
Copy link
Owner

Description

DO NOT REVIEW!

Pull request type

[ ] Fix
[ ] Refactor
[ ] Target update
[ ] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

Reviewers

Release Notes

Only implementations that make outside calls have been moved so
the third party header file inclusion could be moved to the source file.
Also include the platform header file explicitly in the header file.
Also explicitly add headers where they are used
@hugueskamba hugueskamba changed the base branch from master to clean-up-drivers-header-files June 21, 2019 23:24
@hugueskamba hugueskamba force-pushed the clean-up-drivers-header-files-2 branch from a554507 to c006646 Compare June 21, 2019 23:29
@hugueskamba hugueskamba changed the base branch from clean-up-drivers-header-files to master June 22, 2019 00:00
* Revert coding style changes
* Leave/put one-line method in header files as inline
* Use range for copyright notice year for modified existing files
@hugueskamba hugueskamba force-pushed the clean-up-drivers-header-files-2 branch from c006646 to 24a3972 Compare June 22, 2019 00:05
@hugueskamba hugueskamba deleted the clean-up-drivers-header-files-2 branch June 24, 2019 06:47
hugueskamba pushed a commit that referenced this pull request Jun 25, 2019
hugueskamba pushed a commit that referenced this pull request Jun 25, 2019
Fix LWIP warning issues found by Coverity scan

lwip_dns.c in function: dns_add_interface_server
CID 1399051 (#1 of 1): Buffer not null terminated (BUFFER_SIZE_WARNING)10. buffer_size_warning: Calling strncpy with a maximum size argument of 6 bytes on destination array new_interface_server->interface_name of size 6 bytes might leave the destination string unterminated.
line 434 strncpy(new_interface_server->interface_name, interface_name, INTERFACE_NAME_MAX_SIZE);

lwip_ip4_frag.c in function: ip_reass_free_complete_datagram

CID 1373164 (#1 of 1): Dereference after null check (FORWARD_NULL)7. var_deref_model: Passing null pointer prev to ip_reass_dequeue_datagram, which dereferences it. [show details]
line 209 ip_reass_dequeue_datagram(ipr, prev);

lwip_ip4_frag.c in function: ip_reass

CID 1373163 (#1-2 of 2): Dereference after null check (FORWARD_NULL)38. var_deref_model: Passing null pointer ipr_prev to ip_reass_dequeue_datagram, which dereferences it. [show details]
line 663 ip_reass_dequeue_datagram(ipr, ipr_prev);

lwip_api_msg.c in function: lwip_netconn_do_connected

CID 1373162 (#1 of 1): Explicit null dereferenced (FORWARD_NULL)10. var_deref_model: Passing null pointer op_completed_sem to sys_sem_signal, which dereferences it. [show details]
line 1336 sys_sem_signal(op_completed_sem);
hugueskamba pushed a commit that referenced this pull request Jun 25, 2019
hugueskamba pushed a commit that referenced this pull request Jun 26, 2019
* Moved source files and internal headers to internal/
* Added doxygen commands
hugueskamba pushed a commit that referenced this pull request Jul 3, 2019
* Moved source files and internal headers to internal/
* Added doxygen commands
hugueskamba pushed a commit that referenced this pull request Dec 20, 2019
Update CMSIS-pack info for STM32G-family
hugueskamba pushed a commit that referenced this pull request Feb 5, 2020
Signed-off-by: PARKJIHOON <jh6186.park@samsung.com>
hugueskamba pushed a commit that referenced this pull request Oct 21, 2020
hugueskamba pushed a commit that referenced this pull request Nov 30, 2021
Many test stub functions are meant to return a value, but weren't. Clang
would generate a warning for each instance where we weren't returning
anything in a function that was meant to return a value.

    warning: non-void function does not return a value [-Wreturn-type]

For a specific example, my_radio::time_on_air() is supposed to return a
uint32_t, but wasn't returning anything. We'll return a zero instead of
relying on undefined behavior.

Without this, clang 11.0.1 was generating a virtual function
implementation with a `ud2` instruction to abort at run-time, causing
some execution of some unit tests to abort.

    Running main() from gmock_main.cc
    [==========] Running 10 tests from 1 test suite.
    [----------] Global test environment set-up.
    [----------] 10 tests from Test_LoRaPHYUS915
    [ RUN      ] Test_LoRaPHYUS915.constructor
    [       OK ] Test_LoRaPHYUS915.constructor (0 ms)
    [ RUN      ] Test_LoRaPHYUS915.restore_default_channels
    [       OK ] Test_LoRaPHYUS915.restore_default_channels (0 ms)
    [ RUN      ] Test_LoRaPHYUS915.rx_config
    [       OK ] Test_LoRaPHYUS915.rx_config (0 ms)
    [ RUN      ] Test_LoRaPHYUS915.tx_config
    Process 35669 stopped
    * thread #1, name = 'lorawan-loraphy-', stop reason = signal SIGILL: privileged instruction
        frame #0: 0x0000000000276f73 lorawan-loraphy-us915-unittest`my_radio::time_on_air(this=0x0000000800c2b048, modem=MODEM_LORA, pkt_len='\0') at Test_LoRaPHYUS915.cpp:90:5
       87       };
       88
       89       virtual uint32_t time_on_air(radio_modems_t modem, uint8_t pkt_len)
    -> 90       {
       91       };
       92
       93       virtual bool perform_carrier_sense(radio_modems_t modem,
    (lldb) disassemble --pc
    lorawan-loraphy-us915-unittest`my_radio::time_on_air:
    ->  0x276f73 <+67>: ud2
        0x276f75:       int3
        0x276f76:       int3
        0x276f77:       int3
    (lldb)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant