diff options
author | Aniruddha Kanhere <60444055+AniruddhaKanhere@users.noreply.github.com> | 2020-08-31 12:55:38 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-31 12:55:38 -0700 |
commit | 18d238ad5cc21ec53008cd21c62c2c10414db3c2 (patch) | |
tree | 5148160f90f9063389ea028f9d17b54dac6513ae | |
parent | e2ab0923517d81883d28bf714f014e01b70a2b5e (diff) | |
download | freertos-git-18d238ad5cc21ec53008cd21c62c2c10414db3c2.tar.gz |
Address a few MISRA 2.2 violations in FreeRTOS_IP.c (#230)
* Make changes for MISRA rule 2.2
* Add comments to explain changes
* Fix a typo
* Actually fix a typo
I missed a spot in the previous commit.
-rw-r--r-- | FreeRTOS-Plus/Source/FreeRTOS-Plus-TCP/FreeRTOS_IP.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/FreeRTOS-Plus/Source/FreeRTOS-Plus-TCP/FreeRTOS_IP.c b/FreeRTOS-Plus/Source/FreeRTOS-Plus-TCP/FreeRTOS_IP.c index 5dff8ef4a..007880473 100644 --- a/FreeRTOS-Plus/Source/FreeRTOS-Plus-TCP/FreeRTOS_IP.c +++ b/FreeRTOS-Plus/Source/FreeRTOS-Plus-TCP/FreeRTOS_IP.c @@ -2105,6 +2105,11 @@ uint8_t ucProtocol; if( xResult != pdPASS ) { FreeRTOS_printf( ( "xCheckSizeFields: location %ld\n", xLocation ) ); + + /* If FreeRTOS_printf is not defined, not using xLocation will be a violation of MISRA + * rule 2.2 as the value assigned to xLocation will not be used. The below statement uses + * the variable without modifying the logic of the source. */ + ( void ) xLocation; } return xResult; @@ -2379,6 +2384,11 @@ BaseType_t location = 0; ( usChecksum == ipINVALID_LENGTH ) ) { FreeRTOS_printf( ( "CRC error: %04x location %ld\n", usChecksum, location ) ); + + /* If FreeRTOS_printf is not defined, not using 'location' will be a violation of MISRA + * rule 2.2 as the value assigned to 'location' will not be used. The below statement uses + * the variable without modifying the logic of the source. */ + ( void ) location; } return usChecksum; |