From mboxrd@z Thu Jan 1 00:00:00 1970 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 17564C4332F for ; Mon, 7 Nov 2022 10:41:13 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A4E786B0071; Mon, 7 Nov 2022 05:41:12 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A2DB16B0072; Mon, 7 Nov 2022 05:41:12 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 914396B0073; Mon, 7 Nov 2022 05:41:12 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 825996B0071 for ; Mon, 7 Nov 2022 05:41:12 -0500 (EST) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 5365E1A0F45 for ; Mon, 7 Nov 2022 10:41:12 +0000 (UTC) X-FDA: 80106303984.20.27D8638 Received: from mail-pg1-f175.google.com (mail-pg1-f175.google.com [209.85.215.175]) by imf08.hostedemail.com (Postfix) with ESMTP id E3ECA16000C for ; Mon, 7 Nov 2022 10:41:11 +0000 (UTC) Received: by mail-pg1-f175.google.com with SMTP id q1so10072725pgl.11 for ; Mon, 07 Nov 2022 02:41:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:subject:from:cc:to:content-language :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=tEufRRTntxUkAcRUT4L6QYUBosoXo1+hroxdMyZBxDM=; b=PnA7GFo5D4nL5XJOksZE+4RMVKV1U1CG4zXsx57EcIlt9icfkb7RUA5IIX/o3vgaoZ G0opN7HkRFnO7nm+8ZGa+XxvIqo5XHIrxCx7H/eEx/tQCMEcVfiZZED7MJ8oRm6cKi30 HrS4ZvKKENQznAXWQvY4AB/vLUrOFMLGSMgLKYh98BrPwG2kXApk8ftTAPU0I+OaOJr7 YV6EBkPi9bZ3vio2fjKOF6So3GFVqI12Nh0dOIachekWDdMjPDE8SP3x2px2tnm0TX7l 99E6zxEp0XUsPhy+WOtczf4t7kr61pt6VQqbb9GCNrEAW3XlPUfqK2w7XUWiH37zLkG9 OdGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:subject:from:cc:to:content-language :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=tEufRRTntxUkAcRUT4L6QYUBosoXo1+hroxdMyZBxDM=; b=d5g/poDpRaoi6oY6ZIc0hXnfXVovu1mWWvvnGDmYsNoNXNprpixXvb6AvwSlaM0/hq oyE0l0i6XOhRCV4h1ixRE+v/cUrLDlih7c9wk3RahfZ9npjB2MlZJbB45wxhBMruz55v FdsMHWIV2aJVgtdxfz4hAQeIMAiLPNoFoRJNpjNRyNkN2pwshtDXYQVPL1+UTOKm3m6j aRaSk6H+OoqiPIk8La/C8jw7Cb5kIoja88j1/pmlW4S/kRKAUzwPL0GXUEGuHLwiyehr 6dExZHAFPysvc7DEP2GANAAGByZlR2CQn91gOE3DuQN56Ixm2cUxtMFB4uhV+ZDfqdD0 /Bdw== X-Gm-Message-State: ACrzQf1Q9WTUnGFkVOASvEVoJdpUb/8qHkYxNz6X+yg1DlwyHLWu7chy v4z/K6YmoEaE4eRquA1b79I= X-Google-Smtp-Source: AMsMyM5+h/uaeniMLrEluJC846E6MxmoYkm+Ihy2TQJwnEL1nL5fIMZsQYtxGfNvPQtJ86tJ23EtXg== X-Received: by 2002:a05:6a00:1348:b0:56b:f5c0:1d9d with SMTP id k8-20020a056a00134800b0056bf5c01d9dmr49735461pfu.45.1667817670873; Mon, 07 Nov 2022 02:41:10 -0800 (PST) Received: from [192.168.11.9] (KD106167171201.ppp-bb.dion.ne.jp. [106.167.171.201]) by smtp.gmail.com with ESMTPSA id l5-20020a622505000000b0056be1581126sm4317626pfl.143.2022.11.07.02.41.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 07 Nov 2022 02:41:09 -0800 (PST) Message-ID: Date: Mon, 7 Nov 2022 19:41:05 +0900 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Content-Language: en-US To: Kees Cook Cc: Vlastimil Babka , Jonathan Corbet , Akira Yokosawa , linux-mm@kvack.org, linux-kernel@vger.kernel.org From: Akira Yokosawa Subject: Duplicate kernel-doc comments for ksize() Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1667817672; a=rsa-sha256; cv=none; b=Tyxk9wlxPZ4of3cquLZ4NnOwF0n+WyTGzeq1CArabH7Serz7BOMP1LtVaq0QrjhxQeFRwF v8XphIcXVvPJzpP/xf0kROzTFXka58M1a6Omw72prrr18haEJlcnxiYbK7edBAABRYx8L5 +hsAmOE/AABQd38/q1tbGcFWR3yDvlI= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=PnA7GFo5; spf=pass (imf08.hostedemail.com: domain of akiyks@gmail.com designates 209.85.215.175 as permitted sender) smtp.mailfrom=akiyks@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1667817671; 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-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=tEufRRTntxUkAcRUT4L6QYUBosoXo1+hroxdMyZBxDM=; b=Kes6NU9lgvlBLi0w2xPIS42kFlX6IJwhxLHTxZXby22ExiRSAJZYFr6QcZnLVKwLLd1T6A QindfK+YydxHqf7c1j5LvAQi+NKZaqhPX+CZIlv9wBc3Pj5bX77GAZ+u9q59Ba+g+MD5uB zHYcz5mHjJ4k8C9w7WG3plWj/3v4X10= X-Stat-Signature: gbywy869mudykrocx9y8myf9f5yi9idz X-Rspamd-Queue-Id: E3ECA16000C Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=PnA7GFo5; spf=pass (imf08.hostedemail.com: domain of akiyks@gmail.com designates 209.85.215.175 as permitted sender) smtp.mailfrom=akiyks@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Rspam-User: X-Rspamd-Server: rspam11 X-HE-Tag: 1667817671-904737 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: Hi Kees, "make htmldocs" reports duplicate C declaration of ksize() as follows: /linux/Documentation/core-api/mm-api:43: ./mm/slab_common.c:1428: WARNING: Duplicate C declaration, also defined at core-api/mm-api:212. Declaration is '.. c:function:: size_t ksize (const void *objp)'. This is due to the kernel-doc comment for ksize() added in include/linux/slab.h by a commit you have authored: 05a940656e1e ("slab:Introduce kmalloc_size_roundup()"). /** * ksize - Report actual allocation size of associated object * * @objp: Pointer returned from a prior kmalloc()-family allocation. * * This should not be used for writing beyond the originally requested * allocation size. Either use krealloc() or round up the allocation size * with kmalloc_size_roundup() prior to allocation. If this is used to * access beyond the originally requested allocation size, UBSAN_BOUNDS * and/or FORTIFY_SOURCE may trip, since they only know about the * originally allocated size via the __alloc_size attribute. */ There is another kernel-doc comment in mm/slab_common.c (originally by Manfred, since v2.6.14): /** * ksize - get the actual amount of memory allocated for a given object * @objp: Pointer to the object * * kmalloc may internally round up allocations and return more memory * than requested. ksize() can be used to determine the actual amount of * memory allocated. The caller may use this additional memory, even though * a smaller amount of memory was initially specified with the kmalloc call. * The caller must guarantee that objp points to a valid object previously * allocated with either kmalloc() or kmem_cache_alloc(). The object * must not be freed during the duration of the call. * * Return: size of the actual memory used by @objp in bytes */ I guess the one in slab_common.c is outdated and can be removed. Can you please take care of it? Thanks, Akira