From patchwork Tue Sep 20 12:22:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 12982059 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4FBD3ECAAD8 for ; Tue, 20 Sep 2022 12:23:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DDCD0940009; Tue, 20 Sep 2022 08:23:14 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D8CAD940007; Tue, 20 Sep 2022 08:23:14 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C5649940009; Tue, 20 Sep 2022 08:23:14 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id B5A52940007 for ; Tue, 20 Sep 2022 08:23:14 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 8CB611A05FA for ; Tue, 20 Sep 2022 12:23:14 +0000 (UTC) X-FDA: 79932378708.22.036AB58 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf21.hostedemail.com (Postfix) with ESMTP id 236741C001E for ; Tue, 20 Sep 2022 12:23:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663676592; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=Elnu7bpANXPrM1PE7lHq91CUKuXWmTGmVUjcxfcQtwA=; b=Yha5upSm8KhzpymrKOLh3qlGbcv6vP/+TKv5TFqpJGQyU4Q0hcHE3Vv8Voy8dyj8mjG9Wh BC6t5EXTuWQREGhbeaCv0Eh6Z1jS5DkC0o+6yru2v/0uoKIesXsTK8Hh2PWZ8xGg+iUHCH RDCpe2uv4SyUEx7AM6c2DGriW3bSs00= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-632-w7ie62AuMA2p2FaXb2QrxA-1; Tue, 20 Sep 2022 08:23:09 -0400 X-MC-Unique: w7ie62AuMA2p2FaXb2QrxA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C4924862FE0; Tue, 20 Sep 2022 12:23:08 +0000 (UTC) Received: from t480s.redhat.com (unknown [10.39.195.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id 016C9C15BBC; Tue, 20 Sep 2022 12:23:03 +0000 (UTC) From: David Hildenbrand To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, linux-doc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, David Hildenbrand , Linus Torvalds , Andrew Morton , Ingo Molnar , David Laight , Jonathan Corbet , Andy Whitcroft , Joe Perches , Dwaipayan Ray , Lukas Bulwahn , Baoquan He , Vivek Goyal , Dave Young , Jani Nikula , Michael Ellerman , Nicholas Piggin , Christophe Leroy Subject: [PATCH v1 0/3] coding-style.rst: document BUG() and WARN() rules Date: Tue, 20 Sep 2022 14:22:59 +0200 Message-Id: <20220920122302.99195-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1663676593; a=rsa-sha256; cv=none; b=Ocor/piA3bvQaJ3ifSUo6ihrI7uwrMyBYI4jchCkdPVXmSruDc7q1dso17SEfQs4EU6hjE FbQSIgDHu5BH25MqKa2rjQBiWC4XxvnEEiWLZmiR7fy7102F2OqtVYvTYQN1Y7jDWVFrbr Ymo2n7PPILGlyGeFsZvNfnxFdMxwib0= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Yha5upSm; spf=pass (imf21.hostedemail.com: domain of david@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1663676593; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=Elnu7bpANXPrM1PE7lHq91CUKuXWmTGmVUjcxfcQtwA=; b=p6CHb7BGrAeKyXhgFxi/t1aQ1CP5cLO+lH0ERiBCYNYcdeZwnSPMvqH1Be4bbBlv8/0oHK R6/lk+a//6qkzjSLEud6/H1ML+n1E0AyYUJgAPizEdqUPG7AdhBzEEaRX0IN8Kf+pXIXgu pVpWXMST9AYfjXJSrvnN0jLDIN/CIGs= X-Rspamd-Server: rspam06 X-Rspam-User: X-Stat-Signature: kgb3r4urdxwwk67pxp6t3fe7nf9q3yud X-Rspamd-Queue-Id: 236741C001E Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Yha5upSm; spf=pass (imf21.hostedemail.com: domain of david@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-HE-Tag: 1663676592-990228 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: As it seems to be rather unclear if/when to use BUG(), BUG_ON(), VM_BUG_ON(), WARN_ON_ONCE(), ... let's try to document the result of a recent discussion. Details can be found in patch #1. RFC -> v1: * "coding-style.rst: document BUG() and WARN() rules ("do not crash the kernel")" -> Rephrase/extend according to John -> Add some details regarding the use of panic() * powerpc/prom_init: drop PROM_BUG() -> Added * "checkpatch: warn on usage of VM_BUG_ON() and other BUG variants" -> Warn on more variants Cc: Linus Torvalds Cc: Andrew Morton Cc: Ingo Molnar Cc: David Laight Cc: Jonathan Corbet Cc: Andy Whitcroft Cc: Joe Perches Cc: Dwaipayan Ray Cc: Lukas Bulwahn Cc: Baoquan He Cc: Vivek Goyal Cc: Dave Young Cc: Jani Nikula Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Christophe Leroy David Hildenbrand (3): coding-style.rst: document BUG() and WARN() rules ("do not crash the kernel") powerpc/prom_init: drop PROM_BUG() checkpatch: warn on usage of VM_BUG_ON() and other BUG variants Documentation/process/coding-style.rst | 61 ++++++++++++++++++++++++++ arch/powerpc/kernel/prom_init.c | 6 --- scripts/checkpatch.pl | 6 +-- 3 files changed, 64 insertions(+), 9 deletions(-)