Skip to content

Commit

Permalink
[meta] Force non space before equal sign and remove zero initializers (
Browse files Browse the repository at this point in the history
  • Loading branch information
kcudnik committed Sep 2, 2021
1 parent bc86680 commit 170aeb9
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 13 deletions.
4 changes: 2 additions & 2 deletions inc/saibfd.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
typedef enum _sai_bfd_session_type_t
{
/** Demand Active Mode */
SAI_BFD_SESSION_TYPE_DEMAND_ACTIVE = 0,
SAI_BFD_SESSION_TYPE_DEMAND_ACTIVE,

/** Demand Passive Mode */
SAI_BFD_SESSION_TYPE_DEMAND_PASSIVE,
Expand All @@ -58,7 +58,7 @@ typedef enum _sai_bfd_session_type_t
typedef enum _sai_bfd_session_offload_type_t
{
/** No Offload: No offload supported */
SAI_BFD_SESSION_OFFLOAD_TYPE_NONE = 0,
SAI_BFD_SESSION_OFFLOAD_TYPE_NONE,

/** Full Offload: both session establishment and sustenance */
SAI_BFD_SESSION_OFFLOAD_TYPE_FULL,
Expand Down
2 changes: 1 addition & 1 deletion inc/saiipmcgroup.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ typedef enum _sai_ipmc_group_member_attr_t
SAI_IPMC_GROUP_MEMBER_ATTR_END,

/** Custom range base value */
SAI_IPMC_GROUP_MEMBER_ATTR_CUSTOM_RANGE_START = 0x10000000,
SAI_IPMC_GROUP_MEMBER_ATTR_CUSTOM_RANGE_START = 0x10000000,

/** End of custom range base */
SAI_IPMC_GROUP_MEMBER_ATTR_CUSTOM_RANGE_END
Expand Down
2 changes: 1 addition & 1 deletion inc/saiisolationgroup.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ typedef enum _sai_isolation_group_member_attr_t
SAI_ISOLATION_GROUP_MEMBER_ATTR_END,

/** Custom range base value */
SAI_ISOLATION_GROUP_MEMBER_ATTR_CUSTOM_RANGE_START = 0x10000000,
SAI_ISOLATION_GROUP_MEMBER_ATTR_CUSTOM_RANGE_START = 0x10000000,

/** End of custom range base */
SAI_ISOLATION_GROUP_MEMBER_ATTR_CUSTOM_RANGE_END
Expand Down
2 changes: 1 addition & 1 deletion inc/sail2mcgroup.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ typedef enum _sai_l2mc_group_member_attr_t
SAI_L2MC_GROUP_MEMBER_ATTR_END,

/** Custom range base value */
SAI_L2MC_GROUP_MEMBER_ATTR_CUSTOM_RANGE_START = 0x10000000,
SAI_L2MC_GROUP_MEMBER_ATTR_CUSTOM_RANGE_START = 0x10000000,

/** End of custom range base */
SAI_L2MC_GROUP_MEMBER_ATTR_CUSTOM_RANGE_END
Expand Down
2 changes: 1 addition & 1 deletion inc/saimirror.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
typedef enum _sai_mirror_session_type_t
{
/** Local SPAN */
SAI_MIRROR_SESSION_TYPE_LOCAL = 0,
SAI_MIRROR_SESSION_TYPE_LOCAL,

/** Remote SPAN */
SAI_MIRROR_SESSION_TYPE_REMOTE,
Expand Down
4 changes: 2 additions & 2 deletions inc/sainat.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ typedef enum _sai_nat_entry_attr_t
* @flags CREATE_AND_SET
* @default SAI_NAT_TYPE_NONE
*/
SAI_NAT_ENTRY_ATTR_NAT_TYPE = SAI_NAT_ENTRY_ATTR_START,
SAI_NAT_ENTRY_ATTR_NAT_TYPE = SAI_NAT_ENTRY_ATTR_START,

/**
* @brief Replace source IPv4 address in packet.
Expand Down Expand Up @@ -493,7 +493,7 @@ typedef enum _sai_nat_zone_counter_attr_t
* @flags CREATE_AND_SET
* @default SAI_NAT_TYPE_NONE
*/
SAI_NAT_ZONE_COUNTER_ATTR_NAT_TYPE = SAI_NAT_ZONE_COUNTER_ATTR_START,
SAI_NAT_ZONE_COUNTER_ATTR_NAT_TYPE = SAI_NAT_ZONE_COUNTER_ATTR_START,

/**
* @brief NAT Zone ID
Expand Down
2 changes: 1 addition & 1 deletion inc/sainexthopgroup.h
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ typedef enum _sai_next_hop_group_member_attr_t
SAI_NEXT_HOP_GROUP_MEMBER_ATTR_END,

/** Custom range base value */
SAI_NEXT_HOP_GROUP_MEMBER_ATTR_CUSTOM_RANGE_START = 0x10000000,
SAI_NEXT_HOP_GROUP_MEMBER_ATTR_CUSTOM_RANGE_START = 0x10000000,

/** End of custom range base */
SAI_NEXT_HOP_GROUP_MEMBER_ATTR_CUSTOM_RANGE_END
Expand Down
2 changes: 1 addition & 1 deletion inc/sairpfgroup.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ typedef enum _sai_rpf_group_member_attr_t
SAI_RPF_GROUP_MEMBER_ATTR_END,

/** Custom range base value */
SAI_RPF_GROUP_MEMBER_ATTR_CUSTOM_RANGE_START = 0x10000000,
SAI_RPF_GROUP_MEMBER_ATTR_CUSTOM_RANGE_START = 0x10000000,

/** End of custom range base */
SAI_RPF_GROUP_MEMBER_ATTR_CUSTOM_RANGE_END
Expand Down
6 changes: 3 additions & 3 deletions inc/saitam.h
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ typedef enum _sai_tam_event_threshold_unit_t
/**
* @brief Event threshold unit nanosecond
*/
SAI_TAM_EVENT_THRESHOLD_UNIT_NANOSEC = 0,
SAI_TAM_EVENT_THRESHOLD_UNIT_NANOSEC,

/**
* @brief Event threshold unit micro second
Expand Down Expand Up @@ -1168,7 +1168,7 @@ typedef enum _sai_tam_report_type_t
typedef enum _sai_tam_report_mode_t
{
/** Report all events */
SAI_TAM_REPORT_MODE_ALL = 0,
SAI_TAM_REPORT_MODE_ALL,

/** Report in a bulk mode */
SAI_TAM_REPORT_MODE_BULK,
Expand Down Expand Up @@ -1331,7 +1331,7 @@ typedef enum _sai_tam_reporting_unit_t
/**
* @brief Report Unit second
*/
SAI_TAM_REPORTING_UNIT_SEC = 0,
SAI_TAM_REPORTING_UNIT_SEC,

/**
* @brief Report unit minute
Expand Down
5 changes: 5 additions & 0 deletions meta/style.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1037,6 +1037,11 @@ sub CheckHeadersStyle
}
}

if ($line =~ /SAI_\w+ \s+=\s+(0x|S)/)
{
LogWarning "too many spaces before '=' $header:$n: $line"
}

if ($line =~ /__/ and not $line =~ /^#.+__SAI\w*_H_|VA_ARGS|BOOL_DEFINED/)
{
LogWarning "double underscore detected: $header $n: $line";
Expand Down

0 comments on commit 170aeb9

Please sign in to comment.