diff options
Diffstat (limited to 'scripts/bpf_helpers_doc.py')
| -rwxr-xr-x | scripts/bpf_helpers_doc.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/bpf_helpers_doc.py b/scripts/bpf_helpers_doc.py index 5010a4d5bfba..894cc58c1a03 100755 --- a/scripts/bpf_helpers_doc.py +++ b/scripts/bpf_helpers_doc.py | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | #!/usr/bin/python3 | 1 | #!/usr/bin/python3 |
| 2 | # SPDX-License-Identifier: GPL-2.0-only | 2 | # SPDX-License-Identifier: GPL-2.0-only |
| 3 | # | 3 | # |
| 4 | # Copyright (C) 2018 Netronome Systems, Inc. | 4 | # Copyright (C) 2018-2019 Netronome Systems, Inc. |
| 5 | 5 | ||
| 6 | # In case user attempts to run with Python 2. | 6 | # In case user attempts to run with Python 2. |
| 7 | from __future__ import print_function | 7 | from __future__ import print_function |
| @@ -39,7 +39,7 @@ class Helper(object): | |||
| 39 | Break down helper function protocol into smaller chunks: return type, | 39 | Break down helper function protocol into smaller chunks: return type, |
| 40 | name, distincts arguments. | 40 | name, distincts arguments. |
| 41 | """ | 41 | """ |
| 42 | arg_re = re.compile('((const )?(struct )?(\w+|...))( (\**)(\w+))?$') | 42 | arg_re = re.compile('((\w+ )*?(\w+|...))( (\**)(\w+))?$') |
| 43 | res = {} | 43 | res = {} |
| 44 | proto_re = re.compile('(.+) (\**)(\w+)\(((([^,]+)(, )?){1,5})\)$') | 44 | proto_re = re.compile('(.+) (\**)(\w+)\(((([^,]+)(, )?){1,5})\)$') |
| 45 | 45 | ||
| @@ -54,8 +54,8 @@ class Helper(object): | |||
| 54 | capture = arg_re.match(a) | 54 | capture = arg_re.match(a) |
| 55 | res['args'].append({ | 55 | res['args'].append({ |
| 56 | 'type' : capture.group(1), | 56 | 'type' : capture.group(1), |
| 57 | 'star' : capture.group(6), | 57 | 'star' : capture.group(5), |
| 58 | 'name' : capture.group(7) | 58 | 'name' : capture.group(6) |
| 59 | }) | 59 | }) |
| 60 | 60 | ||
| 61 | return res | 61 | return res |
