Skip to content

Commit f5ecc5f

Browse files
authored
Fix MISRA violations Rule 1.1 for forward declaration (#1004)
* Fix MISRA things for forward declaration * Formatting * Fix return structure of prvAllowIPPacketIPv4 and comments.
1 parent 4c6c8ab commit f5ecc5f

File tree

6 files changed

+19
-19
lines changed

6 files changed

+19
-19
lines changed

source/FreeRTOS_IP.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,7 @@ TaskHandle_t FreeRTOS_GetIPTaskHandle( void )
637637
*
638638
* @param pxEndPoint The end-point which goes up.
639639
*/
640-
void vIPNetworkUpCalls( NetworkEndPoint_t * pxEndPoint )
640+
void vIPNetworkUpCalls( struct xNetworkEndPoint * pxEndPoint )
641641
{
642642
pxEndPoint->bits.bEndPointUp = pdTRUE_UNSIGNED;
643643

source/FreeRTOS_IP_Utils.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -816,7 +816,7 @@ BaseType_t xIsCallingFromIPTask( void )
816816
/* More details at: https://github.com/FreeRTOS/FreeRTOS-Plus-TCP/blob/main/MISRA.md#rule-89 */
817817
/* coverity[misra_c_2012_rule_8_9_violation] */
818818
/* coverity[single_use] */
819-
void prvProcessNetworkDownEvent( NetworkInterface_t * pxInterface )
819+
void prvProcessNetworkDownEvent( struct xNetworkInterface * pxInterface )
820820
{
821821
NetworkEndPoint_t * pxEndPoint;
822822

source/FreeRTOS_IPv4.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -219,9 +219,9 @@ BaseType_t xIsIPv4Multicast( uint32_t ulIPAddress )
219219
*
220220
* @return Whether the packet should be processed or dropped.
221221
*/
222-
eFrameProcessingResult_t prvAllowIPPacketIPv4( const IPPacket_t * const pxIPPacket,
223-
const NetworkBufferDescriptor_t * const pxNetworkBuffer,
224-
UBaseType_t uxHeaderLength )
222+
enum eFrameProcessingResult prvAllowIPPacketIPv4( const struct xIP_PACKET * const pxIPPacket,
223+
const struct xNETWORK_BUFFER * const pxNetworkBuffer,
224+
UBaseType_t uxHeaderLength )
225225
{
226226
eFrameProcessingResult_t eReturn = eProcessBuffer;
227227

@@ -417,7 +417,7 @@ eFrameProcessingResult_t prvAllowIPPacketIPv4( const IPPacket_t * const pxIPPack
417417
*
418418
* @return Either 'eProcessBuffer' or 'eReleaseBuffer'
419419
*/
420-
eFrameProcessingResult_t prvCheckIP4HeaderOptions( NetworkBufferDescriptor_t * const pxNetworkBuffer )
420+
enum eFrameProcessingResult prvCheckIP4HeaderOptions( struct xNETWORK_BUFFER * const pxNetworkBuffer )
421421
{
422422
eFrameProcessingResult_t eReturn = eProcessBuffer;
423423

source/include/FreeRTOS_IP_Private.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@
5757
#define ipFOREVER() 1
5858
#endif
5959

60-
/* Forward declaration of 'NetworkEndPoint_t'. */
61-
typedef struct xNetworkEndPoint NetworkEndPoint_t;
60+
/* Forward declaration. */
61+
struct xNetworkEndPoint;
6262

6363
typedef enum eFrameProcessingResult
6464
{
@@ -889,7 +889,7 @@ BaseType_t xIsCallingFromIPTask( void );
889889
#endif /* ipconfigSUPPORT_SELECT_FUNCTION */
890890

891891
/* Send the network-up event and start the ARP timer. */
892-
void vIPNetworkUpCalls( NetworkEndPoint_t * pxEndPoint );
892+
void vIPNetworkUpCalls( struct xNetworkEndPoint * pxEndPoint );
893893

894894
/* *INDENT-OFF* */
895895
#ifdef __cplusplus

source/include/FreeRTOS_IP_Utils.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@
6565
#endif
6666
/* *INDENT-ON* */
6767

68-
/* Forward declaration of 'NetworkInterface_t'. */
69-
typedef struct xNetworkInterface NetworkInterface_t;
68+
/* Forward declaration. */
69+
struct xNetworkInterface;
7070

7171
#if ( ipconfigUSE_DHCP != 0 )
7272

@@ -101,7 +101,7 @@ void vPreCheckConfigs( void );
101101
* @brief Called to create a network connection when the stack is first
102102
* started, or when the network connection is lost.
103103
*/
104-
void prvProcessNetworkDownEvent( NetworkInterface_t * pxInterface );
104+
void prvProcessNetworkDownEvent( struct xNetworkInterface * pxInterface );
105105

106106
/* *INDENT-OFF* */
107107
#ifdef __cplusplus

source/include/FreeRTOS_IPv4.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@
4343
/* *INDENT-ON* */
4444

4545
/* Forward declarations. */
46-
typedef struct xNETWORK_BUFFER NetworkBufferDescriptor_t;
47-
typedef enum eFrameProcessingResult eFrameProcessingResult_t;
48-
typedef struct xIP_PACKET IPPacket_t;
46+
struct xNETWORK_BUFFER;
47+
enum eFrameProcessingResult;
48+
struct xIP_PACKET;
4949

5050
#define ipSIZE_OF_IPv4_HEADER 20U
5151
#define ipSIZE_OF_IPv4_ADDRESS 4U
@@ -89,12 +89,12 @@ uint32_t FreeRTOS_GetIPAddress( void );
8989
BaseType_t xIsIPv4Multicast( uint32_t ulIPAddress );
9090

9191
/* The function 'prvAllowIPPacket()' checks if a packets should be processed. */
92-
eFrameProcessingResult_t prvAllowIPPacketIPv4( const IPPacket_t * const pxIPPacket,
93-
const NetworkBufferDescriptor_t * const pxNetworkBuffer,
94-
UBaseType_t uxHeaderLength );
92+
enum eFrameProcessingResult prvAllowIPPacketIPv4( const struct xIP_PACKET * const pxIPPacket,
93+
const struct xNETWORK_BUFFER * const pxNetworkBuffer,
94+
UBaseType_t uxHeaderLength );
9595

9696
/* Check if the IP-header is carrying options. */
97-
eFrameProcessingResult_t prvCheckIP4HeaderOptions( NetworkBufferDescriptor_t * const pxNetworkBuffer );
97+
enum eFrameProcessingResult prvCheckIP4HeaderOptions( struct xNETWORK_BUFFER * const pxNetworkBuffer );
9898

9999

100100
/* *INDENT-OFF* */

0 commit comments

Comments
 (0)