Skip to content

Commit afdccde

Browse files
kcudniklguohan
authored andcommitted
Force notification functions to end in the same way (#463)
1 parent b816443 commit afdccde

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

inc/saiswitch.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1188,9 +1188,9 @@ typedef enum _sai_switch_attr_t
11881188
/**
11891189
* @brief Set Switch shutdown notification callback function passed to the adapter.
11901190
*
1191-
* Use sai_switch_shutdown_request_fn as notification function.
1191+
* Use sai_switch_shutdown_request_notification_fn as notification function.
11921192
*
1193-
* @type sai_pointer_t sai_switch_shutdown_request_fn
1193+
* @type sai_pointer_t sai_switch_shutdown_request_notification_fn
11941194
* @flags CREATE_AND_SET
11951195
* @default NULL
11961196
*/
@@ -1399,7 +1399,7 @@ typedef enum _sai_switch_attr_t
13991399
*
14001400
* @param[in] switch_id Switch Id
14011401
*/
1402-
typedef void (*sai_switch_shutdown_request_fn)(
1402+
typedef void (*sai_switch_shutdown_request_notification_fn)(
14031403
_In_ sai_object_id_t switch_id);
14041404

14051405
/**

meta/parse.pl

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,8 +290,15 @@ sub ProcessTagType
290290
return $val;
291291
}
292292

293-
if ($val =~/^sai_pointer_t sai_\w+_fn$/)
293+
if ($val =~/^sai_pointer_t (sai_\w+_fn)$/)
294294
{
295+
my $pointerfn = $1;
296+
297+
if (not $pointerfn =~ /^sai_\w+_(callback|notification)_fn$/)
298+
{
299+
LogWarning "function name $pointerfn should be in format sai_\\w+_(callback|notification)_fn";
300+
}
301+
295302
return $val;
296303
}
297304

0 commit comments

Comments
 (0)