Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

docs: kdoc: avoid error_count overflows

The glibc library limits the return code to 8 bits. We need to
stick to this limit when using sys.exit(error_count).

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Cc: stable@vger.kernel.org
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Message-ID: <233d1674db99ed8feb405a2f781de350f0fba0ac.1768823489.git.mchehab+huawei@kernel.org>

authored by

Mauro Carvalho Chehab and committed by
Jonathan Corbet
802774d8 292eca31

+19 -7
+19 -7
scripts/kernel-doc.py
··· 116 116 117 117 sys.path.insert(0, os.path.join(SRC_DIR, LIB_DIR)) 118 118 119 + WERROR_RETURN_CODE = 3 120 + 119 121 DESC = """ 120 122 Read C language source or header FILEs, extract embedded documentation comments, 121 123 and print formatted documentation to standard output. ··· 178 176 return logging.Formatter.format(self, record) 179 177 180 178 def main(): 181 - """Main program""" 179 + """ 180 + Main program. 181 + 182 + By default, the return value is: 183 + 184 + - 0: success or Python version is not compatible with 185 + kernel-doc. If -Werror is not used, it will also 186 + return 0 if there are issues at kernel-doc markups; 187 + 188 + - 1: an abnormal condition happened; 189 + 190 + - 2: argparse issued an error; 191 + 192 + - 3: -Werror is used, and one or more unfiltered parse warnings happened. 193 + """ 182 194 183 195 parser = argparse.ArgumentParser(formatter_class=argparse.RawTextHelpFormatter, 184 196 description=DESC) ··· 339 323 340 324 if args.werror: 341 325 print("%s warnings as errors" % error_count) # pylint: disable=C0209 342 - sys.exit(error_count) 326 + sys.exit(WERROR_RETURN_CODE) 343 327 344 328 if args.verbose: 345 329 print("%s errors" % error_count) # pylint: disable=C0209 346 330 347 - if args.none: 348 - sys.exit(0) 349 - 350 - sys.exit(error_count) 351 - 331 + sys.exit(0) 352 332 353 333 # Call main method 354 334 if __name__ == "__main__":