Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp11201191imu; Thu, 6 Dec 2018 13:15:47 -0800 (PST) X-Google-Smtp-Source: AFSGD/W8Nfbp1Sgj2S6+LSJXUD4WNVT3Gc4UWtOxcUPhodZvhdYcicZmK3SXA0oMgmn2x0xMUYkn X-Received: by 2002:a63:4566:: with SMTP id u38mr25399534pgk.4.1544130947806; Thu, 06 Dec 2018 13:15:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544130947; cv=none; d=google.com; s=arc-20160816; b=AhPSm1oLAnmK05X8ShvM8Z5OZG3v+wZuGhLn9LoEuhOUW8DZxp1RC8Ce7p8mxDb5vy 1Lk/pDkYugWbPYZ38KLF7ZABVHE6tJegXETQg0O/uofA6mKgCuq72Sgjylq6PjTIr5ew NhYiGwfV8Znc9guXOrkBBruD3DNdqqgqZRLQdzgG50qF+qkIZ1NZd4iS8RMnw+lAV60k 9Zz2Hlqy+fHA/AwTR7E59SsGbgpll2zGrzuO9UObYb+uWf2hsD0fokAuBlp9QdZhWsNn NiUagl2sVmiTvVsoi9C7zZ8QlCm1TZVS/60+nkOGJAdrTOX45SHooG9DCcjs5DoUjYGt gGOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:references:in-reply-to:date :subject:cc:to:from; bh=lyyH4SUNbL+qV4PQ4MvsIqjFPayEORBiISRr4fYofeM=; b=hUHicQkqLVtYLqQLmwiCuqfDYQfkULHJvovgg+wHtDE1MHu496fjhC081sYH38bvFG JSkeFtpb+EVgUApt84jyUwtUH5rVe/LLOZtbPUQj4j5yHNlhRLJSiyRSGONw+YPu3NMg QTAC6ekU6z/pY5FNM8JybIqCn/i0JTGBKwciXfAazBlnLBUT/9p8ojGaWQXKzqNKDz53 SRYuU/oPz3v9uuS5kBZY4+A2VrJVBVn1r0QRKpvg3ucOn+LG7E8FOnzCGME+lhM+fvVN c2Un2bUNb0hHKom963J0OAP3d1BOJ2DDzPaOb8i5u4a2fwmPXkIkUdirOlqAl+ET5JMS XpRA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r14si1150871pfh.229.2018.12.06.13.15.32; Thu, 06 Dec 2018 13:15:47 -0800 (PST) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726047AbeLFVNS (ORCPT + 99 others); Thu, 6 Dec 2018 16:13:18 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:40360 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726034AbeLFVNS (ORCPT ); Thu, 6 Dec 2018 16:13:18 -0500 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id wB6LAj36021518 for ; Thu, 6 Dec 2018 16:13:17 -0500 Received: from e06smtp07.uk.ibm.com (e06smtp07.uk.ibm.com [195.75.94.103]) by mx0a-001b2d01.pphosted.com with ESMTP id 2p79kx567n-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 06 Dec 2018 16:13:16 -0500 Received: from localhost by e06smtp07.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 6 Dec 2018 21:13:13 -0000 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp07.uk.ibm.com (192.168.101.137) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Thu, 6 Dec 2018 21:13:09 -0000 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id wB6LD8QD50987252 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 6 Dec 2018 21:13:08 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6A62811C054; Thu, 6 Dec 2018 21:13:08 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 79E5211C04A; Thu, 6 Dec 2018 21:13:06 +0000 (GMT) Received: from rapoport-lnx (unknown [9.148.206.110]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Thu, 6 Dec 2018 21:13:06 +0000 (GMT) Received: by rapoport-lnx (sSMTP sendmail emulation); Thu, 06 Dec 2018 23:13:05 +0200 From: Mike Rapoport To: Jonathan Corbet Cc: Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , linux-doc@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Mike Rapoport Subject: [PATCH 1/2] slab: make kmem_cache_create{_usercopy} description proper kernel-doc Date: Thu, 6 Dec 2018 23:13:00 +0200 X-Mailer: git-send-email 2.7.4 In-Reply-To: <1544130781-13443-1-git-send-email-rppt@linux.ibm.com> References: <1544130781-13443-1-git-send-email-rppt@linux.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18120621-0028-0000-0000-00000327259A X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18120621-0029-0000-0000-000023E3392F Message-Id: <1544130781-13443-2-git-send-email-rppt@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-12-06_08:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1812060177 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add the description for kmem_cache_create, fixup the return value paragraph and make both kmem_cache_create and add the second '*' to the comment opening. Signed-off-by: Mike Rapoport --- mm/slab_common.c | 35 +++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/mm/slab_common.c b/mm/slab_common.c index 7eb8dc1..dbf63d6 100644 --- a/mm/slab_common.c +++ b/mm/slab_common.c @@ -406,8 +406,9 @@ static struct kmem_cache *create_cache(const char *name, goto out; } -/* - * kmem_cache_create_usercopy - Create a cache. +/** + * kmem_cache_create_usercopy - Create a cache with a region suitable + * for copying to userspace * @name: A string which is used in /proc/slabinfo to identify this cache. * @size: The size of objects to be created in this cache. * @align: The required alignment for the objects. @@ -416,7 +417,6 @@ static struct kmem_cache *create_cache(const char *name, * @usersize: Usercopy region size * @ctor: A constructor for the objects. * - * Returns a ptr to the cache on success, NULL on failure. * Cannot be called within a interrupt, but can be interrupted. * The @ctor is run when new pages are allocated by the cache. * @@ -425,12 +425,14 @@ static struct kmem_cache *create_cache(const char *name, * %SLAB_POISON - Poison the slab with a known test pattern (a5a5a5a5) * to catch references to uninitialised memory. * - * %SLAB_RED_ZONE - Insert `Red' zones around the allocated memory to check + * %SLAB_RED_ZONE - Insert `Red` zones around the allocated memory to check * for buffer overruns. * * %SLAB_HWCACHE_ALIGN - Align the objects in this cache to a hardware * cacheline. This can be beneficial if you're counting cycles as closely * as davem. + * + * Return: a pointer to the cache on success, NULL on failure. */ struct kmem_cache * kmem_cache_create_usercopy(const char *name, @@ -514,6 +516,31 @@ kmem_cache_create_usercopy(const char *name, } EXPORT_SYMBOL(kmem_cache_create_usercopy); +/** + * kmem_cache_create - Create a cache. + * @name: A string which is used in /proc/slabinfo to identify this cache. + * @size: The size of objects to be created in this cache. + * @align: The required alignment for the objects. + * @flags: SLAB flags + * @ctor: A constructor for the objects. + * + * Cannot be called within a interrupt, but can be interrupted. + * The @ctor is run when new pages are allocated by the cache. + * + * The flags are + * + * %SLAB_POISON - Poison the slab with a known test pattern (a5a5a5a5) + * to catch references to uninitialised memory. + * + * %SLAB_RED_ZONE - Insert `Red` zones around the allocated memory to check + * for buffer overruns. + * + * %SLAB_HWCACHE_ALIGN - Align the objects in this cache to a hardware + * cacheline. This can be beneficial if you're counting cycles as closely + * as davem. + * + * Return: a pointer to the cache on success, NULL on failure. + */ struct kmem_cache * kmem_cache_create(const char *name, unsigned int size, unsigned int align, slab_flags_t flags, void (*ctor)(void *)) -- 2.7.4