Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2512931pxb; Fri, 17 Sep 2021 11:25:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw8yK66UOHyTsaMFbGCUsrQnLDvQhp+1UtmUxn+DAJdn0Gsz5FQ3pvmttAbxvRjSTm5dqXJ X-Received: by 2002:a02:3b1b:: with SMTP id c27mr9763483jaa.103.1631903140637; Fri, 17 Sep 2021 11:25:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631903140; cv=none; d=google.com; s=arc-20160816; b=xyzSo1R8tu69uLn8HKGA0WhMExdFrUWhCQhdj2QmEsiBwjOPyFUTsVYrGvnyt6ktO8 N3Gt4mKuPvgO5xfdf1mWkOJuGSK5brZRFbPavelvR/u8dNjmkPDgXypq2j9cdUGa3yDm SDWpoOu3w6lziD7/dIBOvoXkY8nMOzfDy2o+XxAiOAYGwmyGZFrdTCSL12LecdpLvo+Y QJDPCaThwSW7zenP7DUTW543QujoMXNLpJuPVRSR6vmwdSxyt/OiyiTeNAfLbZCDA9F3 D8xF/qwFCLyiuOGi7JZskPLJ77yKYiHUkv5NMC5zCb6zax/a4PACwowWn8TzquW5DUG4 zZbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=BALrngyLohinwTd6UGWDU0YYIg7HJpZLXZVlrE0q2aE=; b=JXXfpL8EjEdYqGlKcCv90CneKbvQGBjMl3UikTBD/JegsPfiyfT8JGza+4sxRrAayk nmhBA3SpSB4z+TuFMUtdmrkGmQdqUcxYSIO/GncbthN9rEFqMLqHTyjJe5USn1COKMWd tsx8Uwrm4IeGmQQk0rjCIPqt+LD821UgphGA3UXAer5UdUQxbYmQSKsffzBhuUymG9Jn iNLcjUoID5MhomRYIZev4lXamnFtPIu5AEBPdq1BS28xgsBvo3Q2k7Kfe303vS5wB2tv 8oeNKTnoIqmu49Dil+b9WNSjqxCIy/XXbVKLQ5CYFnGkkdF0T5u9u0Zy1vOtvwuk2pNu R+ag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=SP6oLp6m; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m62si5611193ioa.15.2021.09.17.11.25.28; Fri, 17 Sep 2021 11:25:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=SP6oLp6m; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242207AbhIQKRe (ORCPT + 99 others); Fri, 17 Sep 2021 06:17:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34526 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242138AbhIQKRd (ORCPT ); Fri, 17 Sep 2021 06:17:33 -0400 Received: from mail-pf1-x431.google.com (mail-pf1-x431.google.com [IPv6:2607:f8b0:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0A1DEC061574; Fri, 17 Sep 2021 03:16:12 -0700 (PDT) Received: by mail-pf1-x431.google.com with SMTP id 203so916510pfy.13; Fri, 17 Sep 2021 03:16:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=BALrngyLohinwTd6UGWDU0YYIg7HJpZLXZVlrE0q2aE=; b=SP6oLp6m+1mMV4KznWY5Uly4XE+0jFnlyIl11iHolBLBskFB/Bk+0Ni7DB8AZvZ1aF PEfN3URwo1XOLOHM02mBwLDXtEav2FUAsTmfT7cDMEuSiLVY+XyzEDFGOBcVL1IMZkAj yOTsCvTiTFRucgn63mJlr9A9BX4KyMSa4DwWx+L6dk8gcxTbZc6giA3UljkTXTP/+K0C LCwwQE126Gdmp7h/0EXbc2lPEuxDD2yxmevaodNhlgcE3TW9X8SBhwbBBtA6mZ4aE7yS zPZrW1IRbD3YsU4971TiiOgLIRN5LRvbZFoCk/xAJhNK2VYLHfGgMZGL+bOj+rZXb1b7 6jOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=BALrngyLohinwTd6UGWDU0YYIg7HJpZLXZVlrE0q2aE=; b=6YkWMtFG5vwF6otfzX7WZpSEfPSCREswfomToKHaMu6U54yBkJ3+lKuqsczG0MXAt3 FfCDOxuBuShz5nUlWQ6D0V3ougLbk6lkyC/CDXwbOo5aAYCZMj3xEU3A8b0vrj6ZsBkb Czd2eSdp8uCBUhgEsdWnT2o/ePko30uNl8jxdFQ5EcP7HkTct0hAbAxKt5W9LRZhxOV/ sO/W+Fn5a8xWD6keE1s5KF0Sz+cwnA5DgOlLP9hlQYLoRrvaGpjfioMnqPpuwSDcXRqr ltdn6Xf3Ntjcmanjb1fZnLjlRN3wXoPsxrfo4zndiQfpUlTWz/Od757h7jeIYgnEAo5A Dsog== X-Gm-Message-State: AOAM533ZTdZhgZw8tDLwlpx11m8Kot/Vth3/45oexuQkoGYnRJQMFwpr SiA6IEppkrnCy3D4/KfkmKNM1EyxcT9jwA== X-Received: by 2002:a05:6a00:d60:b0:43d:f987:66be with SMTP id n32-20020a056a000d6000b0043df98766bemr9845570pfv.37.1631873771373; Fri, 17 Sep 2021 03:16:11 -0700 (PDT) Received: from localhost.localdomain ([2405:201:6005:10e3:be44:5d8a:6628:bf13]) by smtp.googlemail.com with ESMTPSA id x128sm4388080pfd.203.2021.09.17.03.15.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Sep 2021 03:16:10 -0700 (PDT) From: Utkarsh Verma To: Dwaipayan Ray Cc: Lukas Bulwahn , Joe Perches , Jonathan Corbet , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Utkarsh Verma Subject: [PATCH] Documentation: checkpatch: Document some more message types Date: Fri, 17 Sep 2021 15:45:07 +0530 Message-Id: <20210917101507.8380-1-utkarshverma294@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Added and documented 4 new message types: - INCLUDE_LINUX - INDENTED_LABEL - IF_0 - IF_1 Signed-off-by: Utkarsh Verma --- Documentation/dev-tools/checkpatch.rst | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/Documentation/dev-tools/checkpatch.rst b/Documentation/dev-tools/checkpatch.rst index f0956e9ea2d8..ea343a7a5b46 100644 --- a/Documentation/dev-tools/checkpatch.rst +++ b/Documentation/dev-tools/checkpatch.rst @@ -435,6 +435,11 @@ API usage **EXPORT_SYMBOL** EXPORT_SYMBOL should immediately follow the symbol to be exported. + **INCLUDE_LINUX** + Whenever asm/file.h is included and linux/file.h exists, a + conversion can be made when linux/file.h includes asm/file.h. + However this is not always the case (See signal.h). + **IN_ATOMIC** in_atomic() is not for driver use so any such use is reported as an ERROR. Also in_atomic() is often used to determine if sleeping is permitted, @@ -661,6 +666,10 @@ Indentation and Line Breaks See: https://lore.kernel.org/lkml/1328311239.21255.24.camel@joe2Laptop/ + **INDENTED_LABEL** + goto labels either should not have any indentation or only a single + space indentation. + **SWITCH_CASE_INDENT_LEVEL** switch should be at the same indent as case. Example:: @@ -790,6 +799,19 @@ Macros, Attributes and Symbols **DO_WHILE_MACRO_WITH_TRAILING_SEMICOLON** do {} while(0) macros should not have a trailing semicolon. + **IF_0** + The code enclosed within #if 0 and #endif is not executed and is used + for temporarily removing the segments of code with the intention of + using it in the future, much like comments. But comments cannot be + nested, so #if 0 is preferred. But if the code inside #if 0 and #endif + doesn't seem to be anymore required then remove it. + + **IF_1** + The code enclosed within #if 1 and #endif is always executed, so the + #if 1 and #endif statements are redundant, thus remove it. + It is only useful for debugging purposes, it can quickly disable the + code enclosed within itself by changing #if 1 to #if 0 + **INIT_ATTRIBUTE** Const init definitions should use __initconst instead of __initdata. -- 2.25.1