Lines Matching refs:r

29 doc_start = KernRe(r'^/\*\*\s*$', cache=False)
31 doc_end = KernRe(r'\*/', cache=False)
32 doc_com = KernRe(r'\s*\*\s*', cache=False)
33 doc_com_body = KernRe(r'\s*\* ?', cache=False)
34 doc_decl = doc_com + KernRe(r'(\w+)', cache=False)
46 KernRe(r'\s*(@[.\w]+|@\.\.\.|' + known_section_names + r')\s*:([^:].*)?$',
49 doc_content = doc_com_body + KernRe(r'(.*)', cache=False)
50 doc_inline_start = KernRe(r'^\s*/\*\*\s*$', cache=False)
51 doc_inline_sect = KernRe(r'\s*\*\s*(@\s*[\w][\w\.]*\s*):(.*)', cache=False)
52 doc_inline_end = KernRe(r'^\s*\*/\s*$', cache=False)
53 doc_inline_oneline = KernRe(r'^\s*/\*\*\s*(@\s*[\w][\w\.]*\s*):\s*(.*)\s*\*/\s*$', cache=False)
55 export_symbol = KernRe(r'^\s*EXPORT_SYMBOL(_GPL)?\s*\(\s*(\w+)\s*\)\s*', cache=False)
56 export_symbol_ns = KernRe(r'^\s*EXPORT_SYMBOL_NS(_GPL)?\s*\(\s*(\w+)\s*,\s*"\S+"\)\s*', cache=False)
58 type_param = KernRe(r"@(\w*((\.\w+)|(->\w+))*(\.\.\.)?)", cache=False)
63 doc_block = doc_com + KernRe(r'DOC:\s*(.*)?', cache=False)
64 doc_begin_data = KernRe(r"^\s*\*?\s*(struct|union|enum|typedef|var)\b\s*(\w*)", cache = False)
66 r"(?:\w+\s*\*\s*)?" + # type (not captured)
67 r'(?:define\s+)?' + # possible "define" (not captured)
68 r'(\w+)\s*(?:\(\w*\))?\s*' + # name and optional "(...)"
69 r'(?:[-:].*)?$', # description (not captured)
76 struct_args_pattern = r'([^,)]+)'
80 (KernRe(r"__attribute__\s*\(\([a-z0-9,_\*\s\(\)]*\)\)", flags=re.I | re.S, cache=False), ' '),
81 (KernRe(r'\s*__aligned\s*\([^;]*\)', re.S), ' '),
82 (KernRe(r'\s*__counted_by\s*\([^;]*\)', re.S), ' '),
83 (KernRe(r'\s*__counted_by_(le|be)\s*\([^;]*\)', re.S), ' '),
84 (KernRe(r'\s*__packed\s*', re.S), ' '),
85 (KernRe(r'\s*CRYPTO_MINALIGN_ATTR', re.S), ' '),
86 (KernRe(r'\s*__private', re.S), ' '),
87 (KernRe(r'\s*__rcu', re.S), ' '),
88 (KernRe(r'\s*____cacheline_aligned_in_smp', re.S), ' '),
89 (KernRe(r'\s*____cacheline_aligned', re.S), ' '),
90 (KernRe(r'\s*__cacheline_group_(begin|end)\([^\)]+\);'), ''),
125 (KernRe(r'\bstruct_group\s*\(([^,]*,)', re.S), r'STRUCT_GROUP('),
126 (KernRe(r'\bstruct_group_attr\s*\(([^,]*,){2}', re.S), r'STRUCT_GROUP('),
127 (KernRe(r'\bstruct_group_tagged\s*\(([^,]*),([^,]*),', re.S), r'struct \1 \2; STRUCT_GROUP('),
128 (KernRe(r'\b__struct_group\s*\(([^,]*,){3}', re.S), r'STRUCT_GROUP('),
137 (KernRe(r'__ETHTOOL_DECLARE_LINK_MODE_MASK\s*\(([^\)]+)\)', re.S),
138 r'DECLARE_BITMAP(\1, __ETHTOOL_LINK_MODE_MASK_NBITS)'),
139 (KernRe(r'DECLARE_PHY_INTERFACE_MASK\s*\(([^\)]+)\)', re.S),
140 r'DECLARE_BITMAP(\1, PHY_INTERFACE_MODE_MAX)'),
141 (KernRe(r'DECLARE_BITMAP\s*\(' + struct_args_pattern + r',\s*' + struct_args_pattern + r'\)',
142 re.S), r'unsigned long \1[BITS_TO_LONGS(\2)]'),
143 (KernRe(r'DECLARE_HASHTABLE\s*\(' + struct_args_pattern + r',\s*' + struct_args_pattern + r'\)',
144 re.S), r'unsigned long \1[1 << ((\2) - 1)]'),
145 (KernRe(r'DECLARE_KFIFO\s*\(' + struct_args_pattern + r',\s*' + struct_args_pattern +
146 r',\s*' + struct_args_pattern + r'\)', re.S), r'\2 *\1'),
147 (KernRe(r'DECLARE_KFIFO_PTR\s*\(' + struct_args_pattern + r',\s*' +
148 struct_args_pattern + r'\)', re.S), r'\2 *\1'),
149 (KernRe(r'(?:__)?DECLARE_FLEX_ARRAY\s*\(' + struct_args_pattern + r',\s*' +
150 struct_args_pattern + r'\)', re.S), r'\1 \2[]'),
151 (KernRe(r'DEFINE_DMA_UNMAP_ADDR\s*\(' + struct_args_pattern + r'\)', re.S), r'dma_addr_t \1'),
152 (KernRe(r'DEFINE_DMA_UNMAP_LEN\s*\(' + struct_args_pattern + r'\)', re.S), r'__u32 \1'),
160 (re.compile(r'\bSTRUCT_GROUP\('), r'\1'),
167 (KernRe(r"^static +"), ""),
168 (KernRe(r"^extern +"), ""),
169 (KernRe(r"^asmlinkage +"), ""),
170 (KernRe(r"^inline +"), ""),
171 (KernRe(r"^__inline__ +"), ""),
172 (KernRe(r"^__inline +"), ""),
173 (KernRe(r"^__always_inline +"), ""),
174 (KernRe(r"^noinline +"), ""),
175 (KernRe(r"^__FORTIFY_INLINE +"), ""),
176 (KernRe(r"__init +"), ""),
177 (KernRe(r"__init_or_module +"), ""),
178 (KernRe(r"__exit +"), ""),
179 (KernRe(r"__deprecated +"), ""),
180 (KernRe(r"__flatten +"), ""),
181 (KernRe(r"__meminit +"), ""),
182 (KernRe(r"__must_check +"), ""),
183 (KernRe(r"__weak +"), ""),
184 (KernRe(r"__sched +"), ""),
185 (KernRe(r"_noprof"), ""),
186 (KernRe(r"__always_unused *"), ""),
187 (KernRe(r"__printf\s*\(\s*\d*\s*,\s*\d*\s*\) +"), ""),
188 (KernRe(r"__(?:re)?alloc_size\s*\(\s*\d+\s*(?:,\s*\d+\s*)?\) +"), ""),
189 (KernRe(r"__diagnose_as\s*\(\s*\S+\s*(?:,\s*\d+\s*)*\) +"), ""),
190 (KernRe(r"DECL_BUCKET_PARAMS\s*\(\s*(\S+)\s*,\s*(\S+)\s*\)"), r"\1, \2"),
191 (KernRe(r"__attribute_const__ +"), ""),
192 (KernRe(r"__attribute__\s*\(\((?:[\w\s]+(?:\([^)]*\))?\s*,?)+\)\)\s+"), ""),
207 multi_space = KernRe(r'\s\s+')
221 text = KernRe(r'/\*\s*private:.*?/\*\s*public:.*?\*/', flags=re.S).sub('', text)
222 text = KernRe(r'/\*\s*private:.*', flags=re.S).sub('', text)
226 return KernRe(r'\s*/\*.*?\*/\s*', flags=re.S).sub('', text).strip()
508 param = KernRe(r'[\[\)].*').sub('', param, count=1)
555 org_arg = KernRe(r'\s\s+').sub(' ', org_arg)
566 arg_expr = KernRe(r'(\([^\),]+),')
568 args = arg_expr.sub(r"\1#", args)
572 arg = KernRe(r'\sPOS0?\s').sub(' ', arg)
576 arg = KernRe(r'\s+').sub(' ', arg, count=1)
589 elif KernRe(r'\(.+\)\s*\(').search(arg):
591 r = KernRe(r'[^\(]+\(\*?\s*' # Everything up to "(*"
592 r'([\w\[\].]*)' # Capture the name and possible [array]
593 r'\s*\)') # Make sure the trailing ")" is there
594 if r.match(arg):
595 param = r.group(1)
605 elif KernRe(r'\(.+\)\s*\[').search(arg):
606 r = KernRe(r'[^\(]+\(\s*\*\s*' # Up to "(" and maybe "*"
607 r'([\w.]*?)' # The actual pointer name
608 r'\s*(\[\s*\w+\s*\]\s*)*\)') # The [array portion]
609 if r.match(arg):
610 param = r.group(1)
621 arg = KernRe(r'\s*:\s*').sub(":", arg)
622 arg = KernRe(r'\s*\[').sub('[', arg)
623 args = KernRe(r'\s*,\s*').split(arg)
624 args[0] = re.sub(r'(\*+)\s*', r' \1', args[0])
630 r = KernRe(r'^([^[\]]*\s+)(.*)$')
631 if r.match(args[0]):
632 args[0] = r.group(2)
633 dtype = r.group(1)
638 bitfield_re = KernRe(r'(.*?):(\w+)')
644 r = KernRe(r'^(\*+)\s*(.*)')
645 if r.match(param):
646 self.push_parameter(ln, decl_type, r.group(2),
687 if not return_type or KernRe(r'void\s*\w*\s*$').search(return_type):
700 type_pattern = r'(struct|union)'
708 definition_body = r'\{(.*)\}\s*' + "(?:" + '|'.join(qualifiers) + ")?"
710 r = KernRe(type_pattern + r'\s+(\w+)\s*' + definition_body)
711 if r.search(proto):
712 return (r.group(1), r.group(2), r.group(3))
714 r = KernRe(r'typedef\s+' + type_pattern + r'\s*' + definition_body + r'\s*(\w+)\s*;')
715 if r.search(proto):
716 return (r.group(1), r.group(3), r.group(2))
739 struct_members = KernRe(r'(struct|union)' # 0: declaration type
740 r'([^\{\};]+)' # 1: possible name
741 r'(\{)'
742 r'([^\{\}]*)' # 3: Contents of declaration
743 r'(\})'
744 r'([^\{\};]*)(;)') # 5: Remaining stuff after declaration
760 s_id = KernRe(r'[:\[].*').sub('', s_id)
761 s_id = KernRe(r'^\s*\**(\S+)\s*').sub(r'\1', s_id)
770 r = KernRe(r'^([^\(]+\(\*?\s*)([\w.]*)(\s*\).*)')
771 if r.match(arg):
772 dtype, name, extra = r.group(1), r.group(2), r.group(3)
786 arg = KernRe(r':\s*\d+\s*').sub('', arg)
787 arg = KernRe(r'\[.*\]').sub('', arg)
788 arg = KernRe(r'\s*,\s*').sub(',', arg)
792 r = KernRe(r'(.*)\s+([\S+,]+)')
793 if r.search(arg):
794 for name in r.group(2).split(','):
795 name = KernRe(r'^\s*\**(\S+)\s*').sub(r'\1', name)
824 declaration = KernRe(r'([\{;])').sub(r'\1\n', declaration)
825 declaration = KernRe(r'\}\s+;').sub('};', declaration)
829 r = KernRe(r'(enum\s+\{[^\}]+),([^\n])')
830 while r.search(declaration):
831 declaration = r.sub(r'\1,\n\2', declaration)
840 clause = KernRe(r'\s+').sub(' ', clause.strip(), count=1)
883 members = re.sub(r'(\{[^\{\}]*\})', '', members)
902 proto = KernRe(r'#\s*((define|ifdef|if)\s+|endif)[^;]*;', flags=re.S).sub('', proto)
906 r = KernRe(r'typedef\s+enum\s*\{(.*)\}\s*(\w*)\s*;')
907 if r.search(proto):
908 declaration_name = r.group(2)
909 members = trim_private_members(r.group(1))
914 r = KernRe(r'enum\s+(\w*)\s*\{(.*)\}')
915 if r.match(proto):
916 declaration_name = r.group(1)
917 members = trim_private_members(r.group(2))
944 members = KernRe(r'\([^;)]*\)').sub('', members)
948 arg = KernRe(r'^\s*(\w+).*').sub(r'\1', arg)
976 (KernRe(r"__read_mostly"), ""),
977 (KernRe(r"__ro_after_init"), ""),
978 (KernRe(r"(?://.*)$"), ""),
979 (KernRe(r"(?:/\*.*\*/)"), ""),
980 (KernRe(r";$"), ""),
981 (KernRe(r"=.*"), ""),
994 KernRe(r"DEFINE_[\w_]+\s*\(([\w_]+)\)"),
997 for r in macro_prefixes:
998 match = r.search(proto)
1007 for r, sub in sub_prefixes:
1008 proto = r.sub(sub, proto)
1018 r= KernRe(OPTIONAL_VAR_ATTR + r"\w.*\s+(?:\*+)?([\w_]+)\s*[\d\]\[]*\s*(=.*)?")
1019 if r.match(proto):
1021 declaration_name = r.group(1)
1023 default_val = r.group(2)
1025 r= KernRe(OPTIONAL_VAR_ATTR + r"(?:\w.*)?\s+(?:\*+)?(?:[\w_]+)\s*[\d\]\[]*\s*(=.*)?")
1026 if r.match(proto):
1027 default_val = r.group(1)
1073 new_proto = KernRe(r"^#\s*define\s+").sub("", prototype)
1082 r = KernRe(r'^(\w+)\s+')
1083 if r.search(prototype):
1085 declaration_name = r.group(1)
1105 name = r'\w+'
1106 type1 = r'(?:[\w\s]+)?'
1107 type2 = r'(?:[\w\s]+\*+)+'
1114 proto_args = r'\(([^\(]*|.*)\)'
1127 r = KernRe(p)
1128 if r.match(prototype):
1129 return_type = r.group(1)
1130 declaration_name = r.group(2)
1131 args = r.group(3)
1166 typedef_type = r'typedef((?:\s+[\w*]+\b){0,7}\s+(?:\w+\b|\*+))\s*'
1167 typedef_ident = r'\*?\s*(\w\S+)\s*'
1168 typedef_args = r'\s*\((.*)\);'
1170 typedef1 = KernRe(typedef_type + r'\(' + typedef_ident + r'\)' + typedef_args)
1174 for r in [typedef1, typedef2]:
1175 if not r.match(proto):
1178 return_type = r.group(1).strip()
1179 declaration_name = r.group(2)
1180 args = r.group(3)
1197 r = KernRe(r'typedef.*\s+(\w+)\s*;')
1198 if r.match(proto):
1199 declaration_name = r.group(1)
1310 r = KernRe("[-:](.*)")
1311 if r.search(line):
1312 self.entry.declaration_purpose = trim_whitespace(r.group(1))
1379 r = KernRe(r'\s*\*\s*[a-zA-Z_0-9:.]+\*/')
1380 if r.match(line):
1428 if KernRe(r"\s*\*\s*$").match(line):
1449 r = KernRe(r'^(\s+)')
1450 if r.match(cont):
1451 self.entry.leading_space = len(r.group(1))
1518 proto = re.sub(r'[\r\n]+', ' ', proto)
1525 proto = KernRe(r'SYSCALL_DEFINE.*\(').sub('long sys_', proto)
1527 r = KernRe(r'long\s+(sys_.*?),')
1528 if r.search(proto):
1531 proto = KernRe(r'\)').sub('(void)', proto, count=1)
1558 r = KernRe(r'TRACE_EVENT\((.*?),')
1559 if r.search(proto):
1560 tracepointname = r.group(1)
1562 r = KernRe(r'DEFINE_SINGLE_EVENT\((.*?),')
1563 if r.search(proto):
1564 tracepointname = r.group(1)
1566 r = KernRe(r'DEFINE_EVENT\((.*?),(.*?),')
1567 if r.search(proto):
1568 tracepointname = r.group(2)
1573 r = KernRe(r'TP_PROTO\((.*?)\)')
1574 if r.search(proto):
1575 tracepointargs = r.group(1)
1590 line = KernRe(r"//.*$", re.S).sub('', line)
1594 if KernRe(r'\s*#\s*define').match(line):
1597 r = KernRe(r'([^\{]*)')
1598 if r.match(line):
1599 self.entry.prototype += r.group(1) + " "
1603 if '{' in line or ';' in line or KernRe(r'\s*#\s*define').match(line):
1605 self.entry.prototype = KernRe(r'/\*.*\*/').sub('', self.entry.prototype).strip()
1612 r = KernRe(r'^(\S+\s+)\(\s*\*(\S+)\)')
1613 self.entry.prototype = r.sub(r'\1\2', self.entry.prototype)
1621 r = KernRe(r'TRACE_EVENT|DEFINE_EVENT|DEFINE_SINGLE_EVENT')
1622 if r.search(self.entry.prototype):
1637 line = KernRe(r"//.*$", re.S).sub('', line).strip()
1648 r = KernRe(r'(.*?)([{};])')
1649 for chunk in r.split(line):