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 B060FC021BE for ; Thu, 27 Feb 2025 12:48:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 347376B0085; Thu, 27 Feb 2025 07:48:47 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 2F70E6B0088; Thu, 27 Feb 2025 07:48:47 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1E6096B0089; Thu, 27 Feb 2025 07:48:47 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id F3E9B6B0085 for ; Thu, 27 Feb 2025 07:48:46 -0500 (EST) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 88149160AAB for ; Thu, 27 Feb 2025 12:48:46 +0000 (UTC) X-FDA: 83165703852.15.A495078 Received: from pv50p00im-ztdg10022001.me.com (pv50p00im-ztdg10022001.me.com [17.58.6.58]) by imf23.hostedemail.com (Postfix) with ESMTP id 8EBC1140035 for ; Thu, 27 Feb 2025 12:48:44 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=icloud.com header.s=1a1hai header.b=GLbbhl50; dmarc=pass (policy=quarantine) header.from=icloud.com; spf=pass (imf23.hostedemail.com: domain of zijun_hu@icloud.com designates 17.58.6.58 as permitted sender) smtp.mailfrom=zijun_hu@icloud.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1740660524; a=rsa-sha256; cv=none; b=pg4Jqr+BwSUBfLZSbrzqrZ6eC+ffBg1UXW5phBu9liccgZSf3rzRUg+1Nt8eTX5cxxOmgy vBD263ZLngeHisq/defghMcddMUQP/i1kI4ijUS/NeJLkshPRTPJ23hz0H6uriVdiMncOu is7sSsqAH04+pkUsx20ZB6AFWecTIcE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1740660524; 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=3a4gDmWNcm/PN/PkyXMAH7J982HJ/SWLRPrRdcNbL0I=; b=2c+9tgDFzWb9jvN3IqoGVDPfdoPrwfvSDYbMnU8mwDPi1onnr0PhGf039bDlbXWNz7bw5n sw+jnYkrjqZpCnNb8fw/rJFcnaH7YCznu1QwzZrD1OWEnEEGiELFPagd+kJGXwDojHEpzq lL+f7AXsQk6w80CWhwY34OAH/gm2Xhw= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=icloud.com header.s=1a1hai header.b=GLbbhl50; dmarc=pass (policy=quarantine) header.from=icloud.com; spf=pass (imf23.hostedemail.com: domain of zijun_hu@icloud.com designates 17.58.6.58 as permitted sender) smtp.mailfrom=zijun_hu@icloud.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=icloud.com; s=1a1hai; bh=3a4gDmWNcm/PN/PkyXMAH7J982HJ/SWLRPrRdcNbL0I=; h=Message-ID:Date:MIME-Version:From:Subject:To:Content-Type:x-icloud-hme; b=GLbbhl50/6s4XSz2hWsI2pBZw9mNkyoy4mfVS3ceyWFxtT2IXAgPw4vR2c4niyC8z Cn2HmQiD1m50m37YfMI08jjxHRfhEn42+FHcXSScomZlHKDtu+Wp54dOblB3imAZgA 8Sh5FnBSf63pOv7KKwz4PnuK53+FcygvCr7GQVeYyjKkuNNU3G7hg7+mVfYTDQsuYn V/LofsjZFEnKZpfyRxF2x9XD81VAonZ5IWIEsKoP+zCePc8L+vIyjsVPd78Yr1B3dG y7y+n4035LJBFthLQyoBxgdJQehrL+qDmYWtQI5x+p4yNMchSmlhXEXKe5LinKs/Im ZmDofqUPOnkdw== Received: from [192.168.1.26] (pv50p00im-dlb-asmtp-mailmevip.me.com [17.56.9.10]) by pv50p00im-ztdg10022001.me.com (Postfix) with ESMTPSA id 9DDEC3E1E07; Thu, 27 Feb 2025 12:48:23 +0000 (UTC) Message-ID: <46d17d84-5298-4460-96b0-9c62672167a0@icloud.com> Date: Thu, 27 Feb 2025 20:48:19 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Zijun Hu Subject: Re: [PATCH *-next 00/18] Remove weird and needless 'return' for void APIs To: Zijun Hu , Greg Kroah-Hartman , Will Deacon , "Aneesh Kumar K.V" , Andrew Morton , Nick Piggin , Peter Zijlstra , Arnd Bergmann , 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@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, linux-rdma@vger.kernel.org, linux-gpio@vger.kernel.org, linux-pm@vger.kernel.org, iommu@lists.linux.dev, linux-mtd@lists.infradead.org References: <20250221-rmv_return-v1-0-cc8dff275827@quicinc.com> Content-Language: en-US In-Reply-To: <20250221-rmv_return-v1-0-cc8dff275827@quicinc.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Proofpoint-GUID: dWcj_ItTiibsX6WGOwhQtepLygIMQOy8 X-Proofpoint-ORIG-GUID: dWcj_ItTiibsX6WGOwhQtepLygIMQOy8 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-27_06,2025-02-27_01,2024-11-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 phishscore=0 bulkscore=0 clxscore=1015 malwarescore=0 adultscore=0 mlxlogscore=999 mlxscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2411120000 definitions=main-2502270097 X-Rspamd-Queue-Id: 8EBC1140035 X-Rspamd-Server: rspam08 X-Rspam-User: X-Stat-Signature: 54bn5szwbgzjhjepafoayddrtyu18wpb X-HE-Tag: 1740660524-326197 X-HE-Meta: U2FsdGVkX18JX1+sFOOkvAPt/ur1VMSwgR1k5/d0Wi5jMxro8PDUpqBYgAm8jxU0DDgsJkImuSfneiRpQu+72ZWfX2LMAsuWQhfoN/ZXrSM15P4znMxvzHaWau/fvtJ4XyzhlIvZ65hQ8zPMIqCTHtPP+zh/rOnK1iAgPifcL6v6Q4Y4izd1bkupfOoujVy2gFJ+yH3E6y+2bOuZLgKKqLYJEoaVoDIflPsf7/R1/2Enw06j4kAa+4yHKif7Ft2M40ANUqebKE4MTXHNfHLySyXfl23dPQW1NpNiYbtHLKyNJtYky/csfQ0LHNSO8AYL/8+Ize/L8gnR4ghpKPKYupx+3aOO6kVpciW3oCIOkZX+088EbJzGTxnho2ClZgB1ZK2oJeYUiAld8TWMEkKm8LCSIZjjCfz6EtzTUC62vXZ/ZnBiWvbOaLmFz+UQzE0sc1Ic/QR826ZABR4a/WKC9wmkwlFba4EF6URSez0jaZ10vhNE4lUPek4EePKyr05pP7Tk0RKpVU2cKyKjx31EN7Bwts2UccCNB49SLddbxOJ3VGg2PEmKYTRU9pHEpsbQqtAj8TzfQ9pSdL3jjHWk5KDdFS/JS8HTxMT6qx6rsLKJDc2v2PMzkBYBVWCvGlCazErbRcsgymn3rneJFDN86KbBTo/rE/QJ7ZNrw/smhk8QdQLCGM0yovmM9hgGgxoku3hDfYNpWBl4vHwJB8VrlmNsM3T0e4EESkq9MQ+AgdDSBwCZLb6n1vNaM3cq+KG9ZbGQhNcASz1EHZaNZYOR72mFvjGszyiQGdqtgXOrRBMtiouZIFRWjen/CCEyloZviwwn68sg8xckDnc2vsQub/Y8hgAoE5bkYJyxDTG+eIzUXVi46izjSu2ofjxmT+6Tqz3JhEeZdIB/Me9AYaqV+WydnlZ6/SyzRiZiL5cAmWtQ5YoxCoHhMOfi4gKGApedJfzp2+guJhgYN3PirEO FeACvBJU 9Gyzg9dCijED+/F64F3W0zJGvdqkuZtrPjga+P4JBujR12UekMsKCmHD/iUOZCET10SS/5cuEl/oniA2ZYu/FfZQv18Vm3lBynGNXYhrlRISvAc7iewW5b0hZrYdF5wUDoYMEwnxlupcyag24Bu9Gs+/f5cXsiss0bBRYVUO5ZYefyi6Y7/m/m8Lp17ZB9OsuAOtexWmiXL3CXpo+CWqyoCkHIC3TDdWSdZgdA8tiON/62CJBIJId/aMEy37Nw7sOoREJ3z2mFIhhBJvX8IZnkqNFe/gyeNE8xaIorA9PpVqEw48TXJj5hX+LkOL2AlW5mnihlkw6BQfgbBmckYlKAg+f2yNe3QGx0+o6by5MAhPl86LfGZd91QKU+TWFtO657yXNpM5dfRbkdnDg4u9olwBRNOC+f5klCLMq 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 21:02, Zijun Hu wrote: > void api_func_a(...); > > static inline void api_func_b(...) > { > return api_func_a(...); > } The Usage : Return void function in void function IMO, perhaps, the usage is not good since: A) STD C does not like the usage, and i find GCC has no description about the usage. C11/C17: 6.8.6.4 The return statement "A return statement with an expression shall not appear in a function whose return type is void" B) According to discussion, the usage have function that return type of the callee api_func_a() is monitored. but this function has below shortcoming as well: the monitor is not needed if the caller api_func_b() is in the same module with the callee api_func_a(), otherwise, provided the callee is a API and provided by author of other module. the author needs to clean up lot of usages of the API if he/she changes the API's return type from void to any other type, so it is not nice to API provider. C) perhaps, most ordinary developers don't known the function mentioned by B), and also feel strange for the usage