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

[Coverity CID :208197] Pointless string comparison in tests/drivers/gpio/gpio_basic_api/src/main.c #22652

Closed
zephyrbot opened this issue Feb 9, 2020 · 2 comments
Assignees
Labels
bug The issue is a bug, or the PR is fixing a bug Coverity A Coverity detected issue or its fix priority: low Low impact/importance bug

Comments

@zephyrbot
Copy link
Collaborator

Static code scan issues found in file:

https://github.com/zephyrproject-rtos/zephyr/tree/e089906b339aad4cd1b6589a3b6ce94782d93f54/tests/drivers/gpio/gpio_basic_api/src/main.c#L27

Category: Incorrect expression
Function: board_setup
Component: Tests
CID: 208197

Details:

21     #endif
22    
23     static void board_setup(void)
24     {
25     #ifdef DT_INST_0_TEST_GPIO_BASIC_API
26         /* PIN_IN and PIN_OUT must be on same controller. */
>>>     CID 208197:  Incorrect expression  (CONSTANT_EXPRESSION_RESULT)
>>>     "strcmp("GPIO_A2", "GPIO_A2")" is always 0 because ""GPIO_A2"" is compared against itself.
27         if (strcmp(DT_INST_0_TEST_GPIO_BASIC_API_OUT_GPIOS_CONTROLLER,
28                DT_INST_0_TEST_GPIO_BASIC_API_IN_GPIOS_CONTROLLER) != 0) {
29             printk("FATAL: output controller %s != input controller %s\n",
30                    DT_INST_0_TEST_GPIO_BASIC_API_OUT_GPIOS_CONTROLLER,
31                    DT_INST_0_TEST_GPIO_BASIC_API_IN_GPIOS_CONTROLLER);
32             k_panic();

Please fix or provide comments in coverity using the link:

https://scan9.coverity.com/reports.htm#v32951/p12996.

Note: This issue was created automatically. Priority was set based on classification
of the file affected and the impact field in coverity. Assignees were set using the CODEOWNERS file.

@zephyrbot zephyrbot added bug The issue is a bug, or the PR is fixing a bug Coverity A Coverity detected issue or its fix priority: low Low impact/importance bug labels Feb 9, 2020
@pabigot
Copy link
Collaborator

pabigot commented Feb 9, 2020

Coverity needs to be told to ignore this. I don't have authority to tell it.

@pabigot
Copy link
Collaborator

pabigot commented Feb 11, 2020

Marked false-positive, ignore in coverity.

@pabigot pabigot closed this as completed Feb 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue is a bug, or the PR is fixing a bug Coverity A Coverity detected issue or its fix priority: low Low impact/importance bug
Projects
None yet
Development

No branches or pull requests

3 participants