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 E9548C021B2 for ; Sat, 22 Feb 2025 10:39:43 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4B79B6B007B; Sat, 22 Feb 2025 05:39:43 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 440A26B0083; Sat, 22 Feb 2025 05:39:43 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2E0F36B0085; Sat, 22 Feb 2025 05:39:43 -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 112326B007B for ; Sat, 22 Feb 2025 05:39:43 -0500 (EST) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 92C8A1A12E8 for ; Sat, 22 Feb 2025 10:39:42 +0000 (UTC) X-FDA: 83147234604.07.FA032E8 Received: from pv50p00im-ztdg10012001.me.com (pv50p00im-ztdg10012001.me.com [17.58.6.51]) by imf18.hostedemail.com (Postfix) with ESMTP id A63171C000A for ; Sat, 22 Feb 2025 10:39:40 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=icloud.com header.s=1a1hai header.b=yYDN+E04; dmarc=pass (policy=quarantine) header.from=icloud.com; spf=pass (imf18.hostedemail.com: domain of zijun_hu@icloud.com designates 17.58.6.51 as permitted sender) smtp.mailfrom=zijun_hu@icloud.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1740220780; a=rsa-sha256; cv=none; b=QcHspslWR9uawfD76hI5HlbjHFFmm0FCJR9aN1O0k2pXNtxscsT01RIKuW6bzmHOG1B6gU FleYat7vR8et+vjKbSSAapzjWmoOpPFfuZQaTBwhm8H5phxNx9X9ZXBWGwpClCxX+01J8Y uyPbCcLwnQrW9NIyfLcfek7JCHE8rdM= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=icloud.com header.s=1a1hai header.b=yYDN+E04; dmarc=pass (policy=quarantine) header.from=icloud.com; spf=pass (imf18.hostedemail.com: domain of zijun_hu@icloud.com designates 17.58.6.51 as permitted sender) smtp.mailfrom=zijun_hu@icloud.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1740220780; 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:in-reply-to:references:references:dkim-signature; bh=mbxficQPTzs09LWwBbFhdunStNbxz1Db5LUu+U2NlSw=; b=gc+ak0mdshSxOvbqzr+4ga1bKLaQ9xRgfkcVdIMZcBLqTFkQwqdmDvsc2ApvxqxtMR6sDk dVka03i43t09mMLP2V/ZA2SCA3+0nPg35MnwNXG+3/qG5w24wscLpKWjtnqiPT+G+NmsT7 FWyrOf79mddwePQntUw5aabFFk0zDqQ= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=icloud.com; s=1a1hai; bh=mbxficQPTzs09LWwBbFhdunStNbxz1Db5LUu+U2NlSw=; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type:x-icloud-hme; b=yYDN+E04f3AdizaUiroUuQGY41SPVVZcRqALdOpH6NFQhX3QCjWpHGcmHdHvZgXyw lY1ddO0XjuI5jwoyQLYS2xsXRa555rOew3qMgB02ajNFY2naY0JiMg3EzOtw/vDBsm rNcbU3RkjyAdmQBUnnLpBha3Hg45RvWSCLNO8oK0o5dE+ouOgYdV9O7OaddprvalcC F7e6FcKQyQxquf6C4CR09WnXr4uHh4OXsP+wDyxaBcn55oVkRsljjd3IOmoDXx5njY kMIwNWVp9xmRX9kyVkPTFuHEolnlCaw5jRp5Hj9sFk69BnUaESstfS78tB+JnoKuuq DJolzLt315u8g== Received: from [192.168.1.26] (pv50p00im-dlb-asmtp-mailmevip.me.com [17.56.9.10]) by pv50p00im-ztdg10012001.me.com (Postfix) with ESMTPSA id 00694A0092; Sat, 22 Feb 2025 10:38:11 +0000 (UTC) Message-ID: <732f9f29-f794-4491-b942-45ad01b01db5@icloud.com> Date: Sat, 22 Feb 2025 18:38:06 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH *-next 00/18] Remove weird and needless 'return' for void APIs To: Arnd Bergmann , Zijun Hu , Greg Kroah-Hartman , Will Deacon , "Aneesh Kumar K.V" , Andrew Morton , Nicholas Piggin , Peter Zijlstra , Thomas Gleixner , Herbert Xu , "David S . Miller" , "Rafael J . Wysocki" , Danilo Krummrich , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Johannes Berg , Jamal Hadi Salim , Cong Wang , Jiri Pirko , Jason Gunthorpe , Leon Romanovsky , Linus Walleij , Bartosz Golaszewski , Lee Jones , Thomas Graf , Christoph Hellwig , Marek Szyprowski , Robin Murphy , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra Cc: Linux-Arch , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, Netdev , linux-wireless@vger.kernel.org, linux-rdma@vger.kernel.org, "open list:GPIO SUBSYSTEM" , linux-pm@vger.kernel.org, iommu@lists.linux.dev, linux-mtd@lists.infradead.org References: <20250221-rmv_return-v1-0-cc8dff275827@quicinc.com> <5d662c4c-76f7-4e5c-82f3-2aeeaf9e3311@app.fastmail.com> Content-Language: en-US From: Zijun Hu In-Reply-To: <5d662c4c-76f7-4e5c-82f3-2aeeaf9e3311@app.fastmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Proofpoint-GUID: 5BaBpFy7OfeZq74ITSrzTheUfV5JFE1_ X-Proofpoint-ORIG-GUID: 5BaBpFy7OfeZq74ITSrzTheUfV5JFE1_ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-02-22_04,2025-02-20_02,2024-11-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 adultscore=0 mlxlogscore=999 suspectscore=0 bulkscore=0 clxscore=1011 phishscore=0 malwarescore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2308100000 definitions=main-2502220085 X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: A63171C000A X-Stat-Signature: 98gyiy194ysakk9y8ccdp5o454i3ej5p X-Rspam-User: X-HE-Tag: 1740220780-102639 X-HE-Meta: U2FsdGVkX19mbTlKZLNDHeu0O6IzrgEhsEExRiW0E6sqw9ApSWYbMhfe7Gafb+9mvvNw8ayLcz+fsAV8l0uCseVBuw2RloFsHpb9+QQFBOPFL1/dN1Djn7EnemsCWg8ww4Xd0+5yx1yxjQAHCr6pUGnDzTc2xYsemB+KJsUpBAIgFR9yP7WRG2USiVR9gnXjAkHwsD5bt9wZ4WDCIPxaXaiIRPQSUd9R5BzqYeHwow3+wA7Ud99TBRdC6+dFi8mQL6pEwNsTRLXmmd9jhg3+8i/KLGGSaAcfB4QnQWXWfd2I28/rxWqXaRjZDiLXB5VIPYcScokcxy9FMOVixdki7iKiauFwDm2yyJFb2Po1jWdjs7by+jFuFgEPMRTvT1KVuDmKKeUbQDVa7ZHJOUCzBouGnt/olLR/BNKOCZlhbmOpNByKHduR59R4h1/kizaPltSZtJFMSXJp/NytotSB0FY+XsN/1G6Nn6wjLgfjCdDdf4AANirder65N/6CKZjN1lqjYKU5pFXrVUdOM7aDIk9ZnOPk7w6ZigEB3b1FUItqifAnEMVUHHupYeWOoqZCnjBT9NVo3p4KpCGz/9POWMa+dPNJJ1UrkYs3+zh6JFNC8mbbpdWEZz0UOwGthtYB5WEQo6TeTZDkW8Yao4UTktrigQ++6xojnrlGVHOTa/dIPScouCTVNvRmuTo7h0ZHv/iQGSbb1/jfJ5g4WPWYsXWJHwGykDBpIClzhnWKeYoYtPEa6QkNYl7YXz4C4mHzcrP4u2ULQYloi7G1mRG4bVLdq6usR1uRkMAU8eYbyp8h9OYcjYQLRi1exdPIJjftCvjiZGB96NszVgkEE5PH30pBCLin8pO0Usy3FI7PttqGggZtm0Ecc73pjjb3NXDzUkuSn5cjPTxBfqT1jKV6B2I72k/SaLACkfZoprqR/LicBayrafgLtVCSuDakXNdHgCGdDMlS/5l/ujIXFpi ZF/jbQgs gZ/c9QC2Jx4KqbONMkadspXbO70HDmrwA0urdtqBDMuDyLFoOiQ7Ns5HrqWNoky81CtxHr+R842/x/vnHDKWdiYYRQUFs8v5GV3scRJbuq5ilA80xg6uBETF06YiEu3mbk7HIcvwyerF8rvHcapOzXLuiIcNLwLG2bnujnFSn4McnkYCEL1cjD+3qXD0KfQbrtmmXElrT6eqNli/2N/Ph1KjaTD4qSacFGW1ppfNPqDZIw53+ZkbscBiHH1Fcm91slabKy3jRtzU4DLF/yQW7nHugHr0OzMPbcSvFzeZWpspZZy4PT5mO/cp1NMq0JOD2wf4hlXNRqFE8ezJGbPV+uS1mTDNjUjbsFg/I3W7mknbDqO0QzQiFxhY/2M0fkpLrUh+VW0SeCkKb/JjwuebwWc3OnJEqAL511ABig9VZoN4pBOC0Rkryk45l775Oaf0Bpcz/LRX4a85B8TYlfrEgzzeKDJvuyUijYxIVH1O4zyfKrM4= 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: List-Subscribe: List-Unsubscribe: On 2025/2/21 23:40, Arnd Bergmann wrote: >> This patch series is to remove weird and needless 'return' for >> void APIs under include/ with the following pattern: >> >> api_header.h: >> >> void api_func_a(...); >> >> static inline void api_func_b(...) >> { >> return api_func_a(...); >> } >> >> Remove the needless 'return' in api_func_b(). >> >> Signed-off-by: Zijun Hu > I have no objection to the changes, but I think you should > describe the motivation for them beyond them being 'weird'. > yes. C spec such as C17 have this description about return statement: 6.8.6.4: A return statement with an expression shall not appear in a function whose return type is void. A return statement without an expression shall only appear in a function whose return type is void. do we need to treat below return statement as bad code style ? void api_func_a(...); void api_func_b(...) { ... return api_func_a(...); // return void function in void func ... } > Do these 'return' statements get in the way of some other > work you are doing? Is there a compiler warning you want > to enable to ensure they don't come back? Is this all of > the instances in the kernel or just the ones you found by > inspection? actually, i find this weird return usage by reading code by accident in driver core firstly: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git/commit/?h=driver-core-testing&id=a44073c28bc6d4118891d61e31c9fa9dc4333dc0 then i check folder include/ and work out this patch series. not sure if there are still such instances in current kernel tree.