Received: by 2002:a25:5b86:0:0:0:0:0 with SMTP id p128csp2662053ybb; Sat, 30 Mar 2019 10:26:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqxTs0L6hnguKbYeTtxORhnnLLD4RJCMcOQUBPWa2q7ANsH06TfeV6vlmmv8FbrzVyfZHKbN X-Received: by 2002:a17:902:d211:: with SMTP id t17mr20240500ply.214.1553966763894; Sat, 30 Mar 2019 10:26:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553966763; cv=none; d=google.com; s=arc-20160816; b=P9AE5fZD8d5vv9FdYB2JdodeyqxdMVShLFsFVcSkzSAOFkKDGTA95dVzH3Dc2UhKnf jI/w9jb7fqu3kvXuLQ4Zu3sXjmLMNjMzfqp2+CJQlk0L/ROTquzPcj6Vs4UcBDMI/tW4 gazcYDcaM0HZcs8Rb3WvyWuDkcWjlgBAWxJee0sqrw8UDbVxRuYaO1vT0H3uCAWsti2P eu4ETx+XDDqe2VXIe755Yq38zlJUZnPH+hYOXp98pSQypIMYqWah3PJmNQF2L3XHkW+p tzgrLy7Jtqr806+cWy9KYSA5WIAprqZyIZKDxTw2UkvCtrNPQcaSqs9JGFm6unZqe1le qtug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:date:cc:to:from:subject:message-id; bh=AIjxHy4OMEIP+eMvHxGvIw7WMdc3nFpPw8wC9ydwa7c=; b=0glupSQ2z9imMvVoEpXnZJlc6FkTTn4bS8BVzEuoEA9oayeux9WcCi+xKhNO1ZoO4h IHMB1vP20/B6A6Xf9AYsTYezbbgh5X+Xz86ROMFPbAC2ANBG74cjBPVCJjf0TXNGllN3 mdjYyKU2RrrhSNsvzadFogdiB7TKqYYd5Z14VhOneqf3lKxGeoyhgCe9Iluxc4bmowuo YrIcFbLrOAo4rHjA/dLxd9CZqKh9vYn5fTcM3ysvnWt8O7uzvWGXyOipG2QwtgwNg56o d2ZzSonmt4SdxvaXv5wHjmuG/CtzdVhdXYn4720sqvxFVotsgnXWomfoRkbO9sSFHRir +mIQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h6si4708290pfn.229.2019.03.30.10.25.48; Sat, 30 Mar 2019 10:26:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730826AbfC3RZH (ORCPT + 99 others); Sat, 30 Mar 2019 13:25:07 -0400 Received: from smtprelay0047.hostedemail.com ([216.40.44.47]:43643 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730669AbfC3RZH (ORCPT ); Sat, 30 Mar 2019 13:25:07 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay05.hostedemail.com (Postfix) with ESMTP id 70824180D539E; Sat, 30 Mar 2019 17:25:05 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::,RULES_HIT:41:69:355:379:800:960:973:988:989:1260:1277:1311:1313:1314:1345:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:1978:1981:2194:2199:2393:2559:2562:2828:2892:2899:3138:3139:3140:3141:3142:3352:3865:3866:3867:3868:3870:3871:3872:3874:4250:5007:6119:7904:8603:10004:10400:10848:11232:11658:11914:12043:12555:12760:13069:13095:13200:13229:13311:13357:13439:14181:14394:14659:14721:14777:21080:21433:21451:21627:30054:30070:30075,0,RBL:47.151.153.53:@perches.com:.lbl8.mailshell.net-62.8.0.100 64.201.201.201,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:29,LUA_SUMMARY:none X-HE-Tag: flesh37_66851c21bce11 X-Filterd-Recvd-Size: 2134 Received: from XPS-9350.home (unknown [47.151.153.53]) (Authenticated sender: joe@perches.com) by omf18.hostedemail.com (Postfix) with ESMTPA; Sat, 30 Mar 2019 17:25:04 +0000 (UTC) Message-ID: <5d7229de06286b4ec06daee3411e39e9b638d66c.camel@perches.com> Subject: [PATCH] coding-style.rst: Generic alloc functions do not need OOM logging From: Joe Perches To: Jonathan Corbet Cc: Nick Crews , LKML , linux-doc Date: Sat, 30 Mar 2019 10:25:03 -0700 Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.30.1-1build1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Generic allocation functions already emit a dump_stack() so additional error logging isn't useful. Document it as such and add a reference to the allocation API. Signed-off-by: Joe Perches --- Documentation/process/coding-style.rst | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Documentation/process/coding-style.rst b/Documentation/process/coding-style.rst index 8ea913e99fa1..fa864a51e6ea 100644 --- a/Documentation/process/coding-style.rst +++ b/Documentation/process/coding-style.rst @@ -843,7 +843,8 @@ used. The kernel provides the following general purpose memory allocators: kmalloc(), kzalloc(), kmalloc_array(), kcalloc(), vmalloc(), and vzalloc(). Please refer to the API documentation for further information -about them. +about them. :ref:`Documentation/core-api/memory-allocation.rst +` The preferred form for passing a size of a struct is the following: @@ -874,6 +875,9 @@ The preferred form for allocating a zeroed array is the following: Both forms check for overflow on the allocation size n * sizeof(...), and return NULL if that occurred. +These generic allocation functions all emit a stack dump on failure when used +without __GFP_NOWARN so there is no use in emitting an additional failure +message when NULL is returned. 15) The inline disease ----------------------