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 26FC92F6586 for ; Sun, 1 Mar 2026 01:51:16 +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=1772329876; cv=none; b=BqiGEqSqKSI/TcL9BQ1ABVTsCYWleiUyCq5/1o75iesQlh4x8M64+MBjVZVgbvuwiJApo6SgkIAA9vcjA/IK1tbhWooFM0UzQkp1kxIIP994EIcznRoE8OxUB2/QBmjwR3MW5aFT2cKNxaFDXEg3+qyUKvnOQ84sKDO+ISsschI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772329876; c=relaxed/simple; bh=kIXkmKCw1vmR/lex8t/mSoO9BlRrmI0Oh6TjiVokUqU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=IwLALSdizhaK9YZgbqHHBAGA2VlhZthqNMKMPBnE9LkPpugvSU8pI3GkjQwEqTENPOWPFoQay7m5x0AEx43Jx1L/HbSJK1+XBszGMYpY/OqyJ+IKXqSVEMfnX1TawReTDkQEsm2FYRGfl7TE1d2yxPbZs46/NhfTyCq1H5d+jRU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=oBIa+S5W; 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="oBIa+S5W" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9E985C19421; Sun, 1 Mar 2026 01:51:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1772329876; bh=kIXkmKCw1vmR/lex8t/mSoO9BlRrmI0Oh6TjiVokUqU=; h=From:To:Cc:Subject:Date:From; b=oBIa+S5W7jQQDZk1y70oJYZnsVSS5boGpiYIfJTgnX1BCXP2Mauf1N72jFxizmc/X 5M3Gvjw3Qisqtsr4TMt/zrIyekXOedueaHCuxRwkTF/F6nHVfEMti6xrPxsDahk5qz 2yyvr9Dy9MyPcMjWR5cymSzOIaKsnPLr9I4NSgQx65TCA3NtwtB1c5CpP9O8ICPo+u 6x58E/vH8YPPQoVRj5n9soua6eTEdqhdOfw+AAZhSpRInwmWuNg10RjvHKgLIzgAha QKyfuwljBMGf76dpt1jmJ4XfKLKuSn+dbeicgCN2nnRa8ysZKScKfSMG9Wlg4GXE+1 IHb9V0WxvzcwQ== 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 5.15-stable tree Date: Sat, 28 Feb 2026 20:51:14 -0500 Message-ID: <20260301015114.1717496-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 5.15-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