From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 57B05277C9D for ; Sun, 1 Mar 2026 01:42:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772329369; cv=none; b=nDscYdSQyw8Wq/nqf4lqOm6RUwDL5g5QY9V/1OtYl1DfnIZZn2czoJZ4wZkGBZYFAOMdt039P1gdYzGXYrqzBLYeCqWRCXZWrF+6ixvdtYOr5zEn/fkXz2+OFcH2iwvjWy+i/ma+v52cvrQNjyDeWUwz0XbwPqiUQxK+q6QUSsA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772329369; c=relaxed/simple; bh=s4rNiclUNmdBsqbzf8Jb/J+swG6NmA6JGoeomNWISrk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=PwC69O7+WvUvNUWL1GGdlqVPbJ4cej5N8NXZAEq9Qfs1DlEgtvJgGCxTZ3HNMi8CIlaa8LUJd2taxXVNKyhaHroqj5GXEnFd6JpN+vnsiaHa6bsJwb2KNgf2nxcl25d312znEdj5Q5uJmOd6/wgxvnhIvwps4jR+50Wx+Wpat+U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=OPc7elm3; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="OPc7elm3" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D090EC19421; Sun, 1 Mar 2026 01:42:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1772329369; bh=s4rNiclUNmdBsqbzf8Jb/J+swG6NmA6JGoeomNWISrk=; h=From:To:Cc:Subject:Date:From; b=OPc7elm3O+unV4SDchdjSq8r0fmPAEb+1i5wqu9VZdnB8tsyxwIIlD84pUCX9Ok+T a8TGwnuHwq/kZBeTho7CdSXpvh/6Wt3p4l3IQvKx7nkFyBIY/u3xt2HD/RQt87TL5Y mrfODQaG0ADJS8qOPf91q3bwPekwiALvL2DJlp1sojRqVoPgah/cDmn5Sh++VMLqVs 7plN8O2p30zH4vXkgCuxHOJ7yyNwkYiAwFsmWSPabKAArywnVgAhm+n7/LWiLXYazX MUxObvAQucI9UggkFnt59d7s4W3vyeK+0jCrM2PiEnKhYjseQcs7CaIOi04GohsYaL 4/A7ffiUqMekA== From: Sasha Levin To: stable@vger.kernel.org, mchehab+huawei@kernel.org Cc: Jonathan Corbet Subject: FAILED: Patch "docs: kdoc: avoid error_count overflows" failed to apply to 6.1-stable tree Date: Sat, 28 Feb 2026 20:42:47 -0500 Message-ID: <20260301014247.1704731-1-sashal@kernel.org> X-Mailer: git-send-email 2.51.0 Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Hint: ignore X-stable: review Content-Transfer-Encoding: 8bit The patch below does not apply to the 6.1-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . Thanks, Sasha ------------------ original commit in Linus's tree ------------------ >From 802774d8539fa73487190ec45438777a3c38d424 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Mon, 19 Jan 2026 13:04:57 +0100 Subject: [PATCH] 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 Cc: stable@vger.kernel.org Signed-off-by: Jonathan Corbet Message-ID: <233d1674db99ed8feb405a2f781de350f0fba0ac.1768823489.git.mchehab+huawei@kernel.org> --- scripts/kernel-doc.py | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/scripts/kernel-doc.py b/scripts/kernel-doc.py index 7a1eaf986bcd4..1ebb16b9bb087 100755 --- a/scripts/kernel-doc.py +++ b/scripts/kernel-doc.py @@ -116,6 +116,8 @@ SRC_DIR = os.path.dirname(os.path.realpath(__file__)) sys.path.insert(0, os.path.join(SRC_DIR, LIB_DIR)) +WERROR_RETURN_CODE = 3 + DESC = """ Read C language source or header FILEs, extract embedded documentation comments, and print formatted documentation to standard output. @@ -176,7 +178,21 @@ class MsgFormatter(logging.Formatter): return logging.Formatter.format(self, record) def main(): - """Main program""" + """ + Main program. + + By default, the return value is: + + - 0: success or Python version is not compatible with + kernel-doc. If -Werror is not used, it will also + return 0 if there are issues at kernel-doc markups; + + - 1: an abnormal condition happened; + + - 2: argparse issued an error; + + - 3: -Werror is used, and one or more unfiltered parse warnings happened. + """ parser = argparse.ArgumentParser(formatter_class=argparse.RawTextHelpFormatter, description=DESC) @@ -323,16 +339,12 @@ def main(): if args.werror: print("%s warnings as errors" % error_count) # pylint: disable=C0209 - sys.exit(error_count) + sys.exit(WERROR_RETURN_CODE) if args.verbose: print("%s errors" % error_count) # pylint: disable=C0209 - if args.none: - sys.exit(0) - - sys.exit(error_count) - + sys.exit(0) # Call main method if __name__ == "__main__": -- 2.51.0