Lines Matching full:r

32 doc_start = KernRe(r'^/\*\*\s*$', cache=False)
34 doc_end = KernRe(r'\*/', cache=False)
35 doc_com = KernRe(r'\s*\*\s*', cache=False)
36 doc_com_body = KernRe(r'\s*\* ?', cache=False)
37 doc_decl = doc_com + KernRe(r'(\w+)', cache=False)
49 KernRe(r'\s*(@[.\w]+|@\.\.\.|' + known_section_names + r')\s*:([^:].*)?$',
52 doc_content = doc_com_body + KernRe(r'(.*)', cache=False)
53 doc_inline_start = KernRe(r'^\s*/\*\*\s*$', cache=False)
54 doc_inline_sect = KernRe(r'\s*\*\s*(@\s*[\w][\w\.]*\s*):(.*)', cache=False)
55 doc_inline_end = KernRe(r'^\s*\*/\s*$', cache=False)
56 doc_inline_oneline = KernRe(r'^\s*/\*\*\s*(@[\w\s]+):\s*(.*)\s*\*/\s*$', cache=False)
58 export_symbol = KernRe(r'^\s*EXPORT_SYMBOL(_GPL)?\s*\(\s*(\w+)\s*\)\s*', cache=False)
59 export_symbol_ns = KernRe(r'^\s*EXPORT_SYMBOL_NS(_GPL)?\s*\(\s*(\w+)\s*,\s*"\S+"\)\s*', cache=False)
61 type_param = KernRe(r"@(\w*((\.\w+)|(->\w+))*(\.\.\.)?)", cache=False)
66 doc_block = doc_com + KernRe(r'DOC:\s*(.*)?', cache=False)
67 doc_begin_data = KernRe(r"^\s*\*?\s*(struct|union|enum|typedef)\b\s*(\w*)", cache = False)
69 r"(?:\w+\s*\*\s*)?" + # type (not captured)
70 r'(?:define\s+)?' + # possible "define" (not captured)
71 r'(\w+)\s*(?:\(\w*\))?\s*' + # name and optional "(...)"
72 r'(?:[-:].*)?$', # description (not captured)
79 struct_args_pattern = r'([^,)]+)'
83 (KernRe(r"__attribute__\s*\(\([a-z0-9,_\*\s\(\)]*\)\)", flags=re.I | re.S, cache=False), ' '),
84 (KernRe(r'\s*__aligned\s*\([^;]*\)', re.S), ' '),
85 (KernRe(r'\s*__counted_by\s*\([^;]*\)', re.S), ' '),
86 (KernRe(r'\s*__counted_by_(le|be)\s*\([^;]*\)', re.S), ' '),
87 (KernRe(r'\s*__packed\s*', re.S), ' '),
88 (KernRe(r'\s*CRYPTO_MINALIGN_ATTR', re.S), ' '),
89 (KernRe(r'\s*__private', re.S), ' '),
90 (KernRe(r'\s*__rcu', re.S), ' '),
91 (KernRe(r'\s*____cacheline_aligned_in_smp', re.S), ' '),
92 (KernRe(r'\s*____cacheline_aligned', re.S), ' '),
93 (KernRe(r'\s*__cacheline_group_(begin|end)\([^\)]+\);'), ''),
128 (KernRe(r'\bstruct_group\s*\(([^,]*,)', re.S), r'STRUCT_GROUP('),
129 (KernRe(r'\bstruct_group_attr\s*\(([^,]*,){2}', re.S), r'STRUCT_GROUP('),
130 (KernRe(r'\bstruct_group_tagged\s*\(([^,]*),([^,]*),', re.S), r'struct \1 \2; STRUCT_GROUP('),
131 (KernRe(r'\b__struct_group\s*\(([^,]*,){3}', re.S), r'STRUCT_GROUP('),
140 (KernRe(r'__ETHTOOL_DECLARE_LINK_MODE_MASK\s*\(([^\)]+)\)', re.S),
141 r'DECLARE_BITMAP(\1, __ETHTOOL_LINK_MODE_MASK_NBITS)'),
142 (KernRe(r'DECLARE_PHY_INTERFACE_MASK\s*\(([^\)]+)\)', re.S),
143 r'DECLARE_BITMAP(\1, PHY_INTERFACE_MODE_MAX)'),
144 (KernRe(r'DECLARE_BITMAP\s*\(' + struct_args_pattern + r',\s*' + struct_args_pattern + r'\)',
145 re.S), r'unsigned long \1[BITS_TO_LONGS(\2)]'),
146 (KernRe(r'DECLARE_HASHTABLE\s*\(' + struct_args_pattern + r',\s*' + struct_args_pattern + r'\)',
147 re.S), r'unsigned long \1[1 << ((\2) - 1)]'),
148 (KernRe(r'DECLARE_KFIFO\s*\(' + struct_args_pattern + r',\s*' + struct_args_pattern +
149 r',\s*' + struct_args_pattern + r'\)', re.S), r'\2 *\1'),
150 (KernRe(r'DECLARE_KFIFO_PTR\s*\(' + struct_args_pattern + r',\s*' +
151 struct_args_pattern + r'\)', re.S), r'\2 *\1'),
152 (KernRe(r'(?:__)?DECLARE_FLEX_ARRAY\s*\(' + struct_args_pattern + r',\s*' +
153 struct_args_pattern + r'\)', re.S), r'\1 \2[]'),
154 (KernRe(r'DEFINE_DMA_UNMAP_ADDR\s*\(' + struct_args_pattern + r'\)', re.S), r'dma_addr_t \1'),
155 (KernRe(r'DEFINE_DMA_UNMAP_LEN\s*\(' + struct_args_pattern + r'\)', re.S), r'__u32 \1'),
163 (re.compile(r'\bSTRUCT_GROUP\('), r'\1'),
170 (KernRe(r"^static +"), ""),
171 (KernRe(r"^extern +"), ""),
172 (KernRe(r"^asmlinkage +"), ""),
173 (KernRe(r"^inline +"), ""),
174 (KernRe(r"^__inline__ +"), ""),
175 (KernRe(r"^__inline +"), ""),
176 (KernRe(r"^__always_inline +"), ""),
177 (KernRe(r"^noinline +"), ""),
178 (KernRe(r"^__FORTIFY_INLINE +"), ""),
179 (KernRe(r"__init +"), ""),
180 (KernRe(r"__init_or_module +"), ""),
181 (KernRe(r"__deprecated +"), ""),
182 (KernRe(r"__flatten +"), ""),
183 (KernRe(r"__meminit +"), ""),
184 (KernRe(r"__must_check +"), ""),
185 (KernRe(r"__weak +"), ""),
186 (KernRe(r"__sched +"), ""),
187 (KernRe(r"_noprof"), ""),
188 (KernRe(r"__always_unused *"), ""),
189 (KernRe(r"__printf\s*\(\s*\d*\s*,\s*\d*\s*\) +"), ""),
190 (KernRe(r"__(?:re)?alloc_size\s*\(\s*\d+\s*(?:,\s*\d+\s*)?\) +"), ""),
191 (KernRe(r"__diagnose_as\s*\(\s*\S+\s*(?:,\s*\d+\s*)*\) +"), ""),
192 (KernRe(r"DECL_BUCKET_PARAMS\s*\(\s*(\S+)\s*,\s*(\S+)\s*\)"), r"\1, \2"),
193 (KernRe(r"__attribute_const__ +"), ""),
194 (KernRe(r"__attribute__\s*\(\((?:[\w\s]+(?:\([^)]*\))?\s*,?)+\)\)\s+"), ""),
208 multi_space = KernRe(r'\s\s+')
220 text = KernRe(r'/\*\s*private:.*?/\*\s*public:.*?\*/', flags=re.S).sub('', text)
221 text = KernRe(r'/\*\s*private:.*', flags=re.S).sub('', text)
225 return KernRe(r'\s*/\*.*?\*/\s*', flags=re.S).sub('', text).strip()
480 param = KernRe(r'[\[\)].*').sub('', param, count=1)
527 org_arg = KernRe(r'\s\s+').sub(' ', org_arg)
538 arg_expr = KernRe(r'(\([^\),]+),')
540 args = arg_expr.sub(r"\1#", args)
544 arg = KernRe(r'\sPOS0?\s').sub(' ', arg)
548 arg = KernRe(r'\s+').sub(' ', arg, count=1)
561 elif KernRe(r'\(.+\)\s*\(').search(arg):
563 r = KernRe(r'[^\(]+\(\*?\s*' # Everything up to "(*"
564 r'([\w\[\].]*)' # Capture the name and possible [array]
565 r'\s*\)') # Make sure the trailing ")" is there
566 if r.match(arg):
567 param = r.group(1)
577 elif KernRe(r'\(.+\)\s*\[').search(arg):
578 r = KernRe(r'[^\(]+\(\s*\*\s*' # Up to "(" and maybe "*"
579 r'([\w.]*?)' # The actual pointer name
580 r'\s*(\[\s*\w+\s*\]\s*)*\)') # The [array portion]
581 if r.match(arg):
582 param = r.group(1)
593 arg = KernRe(r'\s*:\s*').sub(":", arg)
594 arg = KernRe(r'\s*\[').sub('[', arg)
595 args = KernRe(r'\s*,\s*').split(arg)
596 args[0] = re.sub(r'(\*+)\s*', r' \1', args[0])
602 r = KernRe(r'^([^[\]]*\s+)(.*)$')
603 if r.match(args[0]):
604 args[0] = r.group(2)
605 dtype = r.group(1)
610 bitfield_re = KernRe(r'(.*?):(\w+)')
616 r = KernRe(r'^(\*+)\s*(.*)')
617 if r.match(param):
618 self.push_parameter(ln, decl_type, r.group(2),
619 f"{dtype} {r.group(1)}",
659 if not return_type or KernRe(r'void\s*\w*\s*$').search(return_type):
670 type_pattern = r'(struct|union)'
678 definition_body = r'\{(.*)\}\s*' + "(?:" + '|'.join(qualifiers) + ")?"
680 r = KernRe(type_pattern + r'\s+(\w+)\s*' + definition_body)
681 if r.search(proto):
682 return (r.group(1), r.group(2), r.group(3))
684 r = KernRe(r'typedef\s+' + type_pattern + r'\s*' + definition_body + r'\s*(\w+)\s*;')
685 if r.search(proto):
686 return (r.group(1), r.group(3), r.group(2))
704 struct_members = KernRe(r'(struct|union)' # 0: declaration type
705 r'([^\{\};]+)' # 1: possible name
706 r'(\{)'
707 r'([^\{\}]*)' # 3: Contents of declaration
708 r'(\})'
709 r'([^\{\};]*)(;)') # 5: Remaining stuff after declaration
725 s_id = KernRe(r'[:\[].*').sub('', s_id)
726 s_id = KernRe(r'^\s*\**(\S+)\s*').sub(r'\1', s_id)
735 r = KernRe(r'^([^\(]+\(\*?\s*)([\w.]*)(\s*\).*)')
736 if r.match(arg):
737 dtype, name, extra = r.group(1), r.group(2), r.group(3)
751 arg = KernRe(r':\s*\d+\s*').sub('', arg)
752 arg = KernRe(r'\[.*\]').sub('', arg)
753 arg = KernRe(r'\s*,\s*').sub(',', arg)
757 r = KernRe(r'(.*)\s+([\S+,]+)')
758 if r.search(arg):
759 for name in r.group(2).split(','):
760 name = KernRe(r'^\s*\**(\S+)\s*').sub(r'\1', name)
763 newmember += f"{r.group(1)} {name}; "
765 newmember += f"{r.group(1)} {s_id}.{name}; "
788 declaration = KernRe(r'([\{;])').sub(r'\1\n', declaration)
789 declaration = KernRe(r'\}\s+;').sub('};', declaration)
793 r = KernRe(r'(enum\s+\{[^\}]+),([^\n])')
794 while r.search(declaration):
795 declaration = r.sub(r'\1,\n\2', declaration)
804 clause = KernRe(r'\s+').sub(' ', clause.strip(), count=1)
847 members = re.sub(r'(\{[^\{\}]*\})', '', members)
866 proto = KernRe(r'#\s*((define|ifdef|if)\s+|endif)[^;]*;', flags=re.S).sub('', proto)
870 r = KernRe(r'typedef\s+enum\s*\{(.*)\}\s*(\w*)\s*;')
871 if r.search(proto):
872 declaration_name = r.group(2)
873 members = trim_private_members(r.group(1))
878 r = KernRe(r'enum\s+(\w*)\s*\{(.*)\}')
879 if r.match(proto):
880 declaration_name = r.group(1)
881 members = trim_private_members(r.group(2))
908 members = KernRe(r'\([^;)]*\)').sub('', members)
912 arg = KernRe(r'^\s*(\w+).*').sub(r'\1', arg)
960 new_proto = KernRe(r"^#\s*define\s+").sub("", prototype)
969 r = KernRe(r'^(\w+)\s+')
970 if r.search(prototype):
972 declaration_name = r.group(1)
992 name = r'\w+'
993 type1 = r'(?:[\w\s]+)?'
994 type2 = r'(?:[\w\s]+\*+)+'
1001 proto_args = r'\(([^\(]*|.*)\)'
1014 r = KernRe(p)
1015 if r.match(prototype):
1016 return_type = r.group(1)
1017 declaration_name = r.group(2)
1018 args = r.group(3)
1053 typedef_type = r'typedef((?:\s+[\w*]+\b){0,7}\s+(?:\w+\b|\*+))\s*'
1054 typedef_ident = r'\*?\s*(\w\S+)\s*'
1055 typedef_args = r'\s*\((.*)\);'
1057 typedef1 = KernRe(typedef_type + r'\(' + typedef_ident + r'\)' + typedef_args)
1061 for r in [typedef1, typedef2]:
1062 if not r.match(proto):
1065 return_type = r.group(1).strip()
1066 declaration_name = r.group(2)
1067 args = r.group(3)
1084 r = KernRe(r'typedef.*\s+(\w+)\s*;')
1085 if r.match(proto):
1086 declaration_name = r.group(1)
1197 r = KernRe("[-:](.*)")
1198 if r.search(line):
1199 self.entry.declaration_purpose = trim_whitespace(r.group(1))
1266 r = KernRe(r'\s*\*\s*[a-zA-Z_0-9:.]+\*/')
1267 if r.match(line):
1315 if KernRe(r"\s*\*\s*$").match(line):
1336 r = KernRe(r'^(\s+)')
1337 if r.match(cont):
1338 self.entry.leading_space = len(r.group(1))
1405 proto = re.sub(r'[\r\n]+', ' ', proto)
1412 proto = KernRe(r'SYSCALL_DEFINE.*\(').sub('long sys_', proto)
1414 r = KernRe(r'long\s+(sys_.*?),')
1415 if r.search(proto):
1418 proto = KernRe(r'\)').sub('(void)', proto, count=1)
1445 r = KernRe(r'TRACE_EVENT\((.*?),')
1446 if r.search(proto):
1447 tracepointname = r.group(1)
1449 r = KernRe(r'DEFINE_SINGLE_EVENT\((.*?),')
1450 if r.search(proto):
1451 tracepointname = r.group(1)
1453 r = KernRe(r'DEFINE_EVENT\((.*?),(.*?),')
1454 if r.search(proto):
1455 tracepointname = r.group(2)
1460 r = KernRe(r'TP_PROTO\((.*?)\)')
1461 if r.search(proto):
1462 tracepointargs = r.group(1)
1477 line = KernRe(r"//.*$", re.S).sub('', line)
1481 if KernRe(r'\s*#\s*define').match(line):
1484 r = KernRe(r'([^\{]*)')
1485 if r.match(line):
1486 self.entry.prototype += r.group(1) + " "
1490 if '{' in line or ';' in line or KernRe(r'\s*#\s*define').match(line):
1492 self.entry.prototype = KernRe(r'/\*.*\*/').sub('', self.entry.prototype).strip()
1499 r = KernRe(r'^(\S+\s+)\(\s*\*(\S+)\)')
1500 self.entry.prototype = r.sub(r'\1\2', self.entry.prototype)
1508 r = KernRe(r'TRACE_EVENT|DEFINE_EVENT|DEFINE_SINGLE_EVENT')
1509 if r.search(self.entry.prototype):
1522 line = KernRe(r"//.*$", re.S).sub('', line).strip()
1533 r = KernRe(r'(.*?)([{};])')
1534 for chunk in r.split(line):
1591 with open(self.fname, "r", encoding="utf8",
1633 with open(self.fname, "r", encoding="utf8",