Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp869413pxj; Fri, 21 May 2021 00:40:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJypsTPY8j8DaYPIIZpN+QzLn8mcigUEMP8q5tHbH3yspExiykY/yru23WRJCprusJPacGtJ X-Received: by 2002:a05:6402:2064:: with SMTP id bd4mr9420011edb.96.1621582808734; Fri, 21 May 2021 00:40:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621582808; cv=none; d=google.com; s=arc-20160816; b=YctjcRWje8nWVfvZM/gqSt2IatJ+migrV3mZZ41HgI9EA27YTTjdjlM8PiWdzwu+Fo 0d3jr+y9C3QAjViy+Pn/QAl/+fwVB67ZkvVZz3r73tZccSmZBcSuqGvwDYqoNKtu/feT xZAgWdAYu6WzBzMMzRcJWoxkcU5hX9bh6JFLuMPa/NmLQNd8i5fezecphJ9uOAEW7GE6 FY4RqzkhsdAlUShORtO6O7hC3YwiOl96drNbHpxmSwiuiYVAHAL2j/eL+ZKjD9X+JuVL XJIRew3TyrLABswrt22vfzC5p/fJs2fNTnksF92ewySNTq1tYxa0GGES91P+PRW+NQYT DNig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature:dkim-filter; bh=0XsqVNaBunY2oxqRx1tgHQyOQAW56aEQpUFm5jq+18M=; b=sNvVt8J3gA80V/1VZWv8RxHN+02+Sx0Mbeubp8rTaJFXe3uPAbuRE+lVtjPZbklm/x ugeH9248x3Ki7UBnUclXc+QeR6Ib3wnRyUv19hGDwqD0QLfkfrxFiHRK9G5Kyz94CGn2 eu0Vi1xCyPzTGFoWWlp7f3J9YHm7soiBPAZRXnOpw6V9uLWPBuJOVcYrrmtABq9pLT+X k7DZoXn8n5gl+1xrWELm+joGFPr6gUDoVwHH6bOOrwoRDap9oBQy58+FNW2pOhWOoP13 nRcSiNBUaCsNkvg4fcoNSX9yKjM075KyIeq6lCid0iRFl9ckr1oi0H9aDkWl/kS8Gh12 BVgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lwn.net header.s=20201203 header.b=ViSzjdDk; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g17si1927768edr.609.2021.05.21.00.39.44; Fri, 21 May 2021 00:40:08 -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=@lwn.net header.s=20201203 header.b=ViSzjdDk; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239099AbhETUOk (ORCPT + 99 others); Thu, 20 May 2021 16:14:40 -0400 Received: from ms.lwn.net ([45.79.88.28]:59484 "EHLO ms.lwn.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233675AbhETUOk (ORCPT ); Thu, 20 May 2021 16:14:40 -0400 Received: from localhost (unknown [IPv6:2601:281:8300:104d::5f6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ms.lwn.net (Postfix) with ESMTPSA id 56D88301; Thu, 20 May 2021 20:13:18 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 ms.lwn.net 56D88301 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lwn.net; s=20201203; t=1621541598; bh=0XsqVNaBunY2oxqRx1tgHQyOQAW56aEQpUFm5jq+18M=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=ViSzjdDkE7+0H5CgQerElyVF/Rzxj0DHIshcFb61xvLOu59B7VBC9bH8N9uXOoV2P Dvi8g+Pfsu/b2MEQW8MGim0yPNhGL2fRXCynhS4nvmB0WPP639WP/sVkCKw4+tp5GM wDVUozSNS4GVmY51+p1v6rDQQxqk12N0yyeZP0fr4zrWmxlUqtk1PrwLXId7gJQXmt fVXjNPddeWgntsd8kwcanIS+3EUXxUCRN30J2y8RW64eoM0o2p6B2l66CZ9cWOc9Lh 76khHj05Iydg/DTWh/kDu1iLnfB6aayuCE/FlVqLHYqz6SkWvD6FPGDdmYiTLawNJc uakVgLmf2875Q== From: Jonathan Corbet To: Dwaipayan Ray , mchehab@kernel.org Cc: linux-kernel@vger.kernel.org, lukas.bulwahn@gmail.com, linux-doc@vger.kernel.org, Dwaipayan Ray Subject: Re: [PATCH] docs: Add more message type documentations for checkpatch In-Reply-To: <20210515132348.19082-1-dwaipayanray1@gmail.com> References: <20210515132348.19082-1-dwaipayanray1@gmail.com> Date: Thu, 20 May 2021 14:13:17 -0600 Message-ID: <87k0ntnoyq.fsf@meer.lwn.net> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Dwaipayan Ray writes: > - Document a couple of more checkpatch message types. > - Add a blank line before all `See:` lines to improve the > rst output. > - Create a new subsection `Permissions` and move a few types > to it. > > Signed-off-by: Dwaipayan Ray > --- > Documentation/dev-tools/checkpatch.rst | 170 ++++++++++++++++++++++++- > 1 file changed, 163 insertions(+), 7 deletions(-) So this seems good, but I just notice something that has evidently escaped me until now... > diff --git a/Documentation/dev-tools/checkpatch.rst b/Documentation/dev-tools/checkpatch.rst > index 51fed1bd72ec..e409f27f48b6 100644 > --- a/Documentation/dev-tools/checkpatch.rst > +++ b/Documentation/dev-tools/checkpatch.rst > @@ -246,6 +246,7 @@ Allocation style > The first argument for kcalloc or kmalloc_array should be the > number of elements. sizeof() as the first argument is generally > wrong. > + > See: https://www.kernel.org/doc/html/latest/core-api/memory-allocation.html > > **ALLOC_SIZEOF_STRUCT** > @@ -264,6 +265,7 @@ Allocation style > **ALLOC_WITH_MULTIPLY** > Prefer kmalloc_array/kcalloc over kmalloc/kzalloc with a > sizeof multiply. > + > See: https://www.kernel.org/doc/html/latest/core-api/memory-allocation.html > > > @@ -284,6 +286,7 @@ API usage > BUG() or BUG_ON() should be avoided totally. > Use WARN() and WARN_ON() instead, and handle the "impossible" > error condition as gracefully as possible. > + > See: https://www.kernel.org/doc/html/latest/process/deprecated.html#bug-and-bug-on > > **CONSIDER_KSTRTO** > @@ -292,12 +295,23 @@ API usage > may lead to unexpected results in callers. The respective kstrtol(), > kstrtoll(), kstrtoul(), and kstrtoull() functions tend to be the > correct replacements. > + > See: https://www.kernel.org/doc/html/latest/process/deprecated.html#simple-strtol-simple-strtoll-simple-strtoul-simple-strtoull > > + **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 we may sleep, but it is not > + reliable in this use model therefore its use is strongly discouraged. > + > + However, in_atomic() is ok for core kernel use. > + > + See: https://lore.kernel.org/lkml/20080320201723.b87b3732.akpm@linux-foundation.org/ > + > **LOCKDEP** > The lockdep_no_validate class was added as a temporary measure to > prevent warnings on conversion of device->sem to device->mutex. > It should not be used for any other purpose. > + > See: https://lore.kernel.org/lkml/1268959062.9440.467.camel@laptop/ > > **MALFORMED_INCLUDE** > @@ -308,11 +322,18 @@ API usage > **USE_LOCKDEP** > lockdep_assert_held() annotations should be preferred over > assertions based on spin_is_locked() > + > See: https://www.kernel.org/doc/html/latest/locking/lockdep-design.html#annotations > > **UAPI_INCLUDE** > No #include statements in include/uapi should use a uapi/ path. > > + **USLEEP_RANGE** > + usleep_range() should be preferred over udelay(). The proper way of > + using usleep_range() is mentioned in the kernel docs. > + > + See: https://www.kernel.org/doc/html/latest/timers/timers-howto.html#delays-information-on-the-various-kernel-delay-sleep-mechanisms We really shouldn't be linking to outside sites - even kernel.org - when referring to the kernel docs themselves. Just say "Documentation/timers/timers-howto" and let the build system handle the links. There's a lot of these in this file, alas... I've applied this patch since it makes things better overall, but I would really like to see all those URLs go away if possible. Thanks, jon