Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1557118rwb; Mon, 7 Nov 2022 03:06:41 -0800 (PST) X-Google-Smtp-Source: AMsMyM5ulJNxQo0EZy+EYnGCz6YkojjE9GukwTFNAeZ9+UIWltS2ciwqAf+FuPmZpFr2pR7a00hA X-Received: by 2002:a17:907:270e:b0:7ae:41e1:cdf9 with SMTP id w14-20020a170907270e00b007ae41e1cdf9mr13453986ejk.151.1667819200844; Mon, 07 Nov 2022 03:06:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667819200; cv=none; d=google.com; s=arc-20160816; b=yaqC9TCjMWcZxoa2mlwEzaDZHSm1tqfruq5AcUXo5vLc2aQ4pIuCuUoQ/73KvuyIBu QUqo7BtuwL1bWOygoVNmjDe8C1aSqtl4tLc4+/6mQhVdl9gB6qH69CX/cyaoKXeF+uUF 5A4sdb3VuIJsIc1ynGmeLDvd3JyuqB3Q5tc0u2qHSC1w13ZDGBLBu2+mjOdlz1EWEIBV imEJ9AHbb2s0jaNrGK0TExlv8QgrI1fG2Ka+s3WR1WJyX3fA1eXl8UL7zXN3k679VZtX fIxAR04aZhO1zjm8qoIEZk1SJGpqVmBX25q11e+MPMTohl3XBKMTBOu4185WECdAzMzO LQJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:subject:from:cc:to :content-language:user-agent:mime-version:date:message-id :dkim-signature; bh=tEufRRTntxUkAcRUT4L6QYUBosoXo1+hroxdMyZBxDM=; b=ct/ROB4JMlr1NWq2mioiilz17AiJFG1JTKi5iEnhArHB3/bKN7sGHuBld4B17YkjbL bICCVQ9v2m39NF9PnlCvV5FvE26trxBcbjH1N9VdvXCKWYiizRkQuZIxgO+hN49cHP7E FTx7KroyD+2iYr4LFMR+1pjBPZr+wJrn+FOADW6loxbCoQBl8aN9YBgLy1lxZQluJF60 G3L+4ixJ4W6vrlPDZScR2w2nzVbky+cGy9xxNOWP1Ap+b9e/dXKjbHDquynN50PeYn38 puMCtSZ56ZukT2iz53hM8pmIKeQr1gKYKfwCrZspeRTJ4rYe78gcFiGnOXD2qbNrh6op 3TxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=PnA7GFo5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bb6-20020a1709070a0600b00781bbff1cc1si8609623ejc.455.2022.11.07.03.06.18; Mon, 07 Nov 2022 03:06:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=PnA7GFo5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S231332AbiKGKlN (ORCPT + 93 others); Mon, 7 Nov 2022 05:41:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229530AbiKGKlM (ORCPT ); Mon, 7 Nov 2022 05:41:12 -0500 Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F1311900F for ; Mon, 7 Nov 2022 02:41:11 -0800 (PST) Received: by mail-pf1-x434.google.com with SMTP id q9so10210170pfg.5 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=PeT/8BL0yxqAZoF+vx4ZYU5qxc4xIbOoH4fu0k9J9IZnzp/23uGlwq7REyN4Al+TS/ A5eSxtc5h/CeYaY4k2D0YBsrejuDXX8I9ll5PyJOs3OW92ukeXiiEnn81+O6owQDorja BQFUpCDVe0TMcFo8wKAuwLnttxYQSu4kRbg4Suw3E3bZIjvkPoPz1W2zaBbVqqv6y1De jGoAZPKCnOuHIunIxR2Csvwr4Xd4GXINZBl4LUlT0JZZKjh9njXCBDtA4Ay/tFHF97Am UT/8DChaYwczWpB85a1VN99wWcJKsJinRv3CEzyzgTx0Z1un6eTUIwngduRwUlrJOUqL tNDQ== X-Gm-Message-State: ACrzQf31CvPQzq9e/F9q9bOTVrwIWke7UmALY9eisMKGu+cGVgZXsUdj 0YOCyFbnFmw8gxQ70lbwdHQ= 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 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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