From patchwork Wed Mar 16 19:20:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Randy Dunlap X-Patchwork-Id: 12783123 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6FDF7C4321E for ; Wed, 16 Mar 2022 19:20:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357839AbiCPTVj (ORCPT ); Wed, 16 Mar 2022 15:21:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231927AbiCPTVh (ORCPT ); Wed, 16 Mar 2022 15:21:37 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7029C40A3F; Wed, 16 Mar 2022 12:20:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=zlk0pYgeFrBRJtw/N83n4t+jmPWdRVlr1V46qxOWdnE=; b=OWH0M3YCDaaUvZNoeBhNPzIFL8 1mOFKNuRVgUQ5Iogx2eIIw9Mj4dmnKQHT/rvRLaYy7YEu6qwyj9iN55WNZ72jUQfmwyzy+g3ArdCm oAlJIiC2gYZhXLC3XI/4G2V7k/3WrVQQ9xcFl2aKGM3A7RWgmcYT7G0VSZg8WJdKy0+mxV2KWtRsb ktMgcdtXuN9OVRcoh5mBRUTWlMiuU5Qx+f4y4gp+RBIP8e7Iy76TUNOOuokZ0LmtPn+WZG5E5NN0r p36ObkoHZue3Sl2dvNTwt8OBP6UCI2pSUL01GUxoDuJWsfMKFSZ0CcV2BnY/gDeVhh+wmf2T+ajBI rw5JcjiA==; Received: from [2601:1c0:6280:3f0::aa0b] (helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1nUZBw-00EArp-Ge; Wed, 16 Mar 2022 19:20:16 +0000 From: Randy Dunlap To: linux-kernel@vger.kernel.org Cc: Randy Dunlap , "Michael S. Tsirkin" , Jason Wang , Paolo Bonzini , Stefan Hajnoczi , Jens Axboe , Amit Shah , Arnd Bergmann , Greg Kroah-Hartman , Eli Cohen , Saeed Mahameed , Leon Romanovsky , Pablo Neira Ayuso , Jozsef Kadlecsik , Florian Westphal , "David S. Miller" , Jakub Kicinski , "James E.J. Bottomley" , "Martin K. Petersen" , Felipe Balbi , =?utf-8?b?TWljaGHFgiBNaXJvc8WC?= =?utf-8?b?YXc=?= , Sebastian Andrzej Siewior , Krzysztof Opasiak , Igor Kotrasinski , Valentina Manea , Shuah Khan , Shuah Khan , Jussi Kivilinna , Joachim Fritschi , Herbert Xu , Thomas Gleixner , Steven Rostedt , Ingo Molnar , Karol Herbst , Pekka Paalanen , Dave Hansen , Andy Lutomirski , Peter Zijlstra , Borislav Petkov , "H. Peter Anvin" , netfilter-devel@vger.kernel.org, coreteam@netfilter.org, netdev@vger.kernel.org, linux-block@vger.kernel.org, linux-crypto@vger.kernel.org, linux-rdma@vger.kernel.org, linux-scsi@vger.kernel.org, linux-usb@vger.kernel.org, nouveau@lists.freedesktop.org, virtualization@lists.linux-foundation.org, x86@kernel.org Subject: [PATCH 1/9] virtio_blk: eliminate anonymous module_init & module_exit Date: Wed, 16 Mar 2022 12:20:02 -0700 Message-Id: <20220316192010.19001-2-rdunlap@infradead.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220316192010.19001-1-rdunlap@infradead.org> References: <20220316192010.19001-1-rdunlap@infradead.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Eliminate anonymous module_init() and module_exit(), which can lead to confusion or ambiguity when reading System.map, crashes/oops/bugs, or an initcall_debug log. Give each of these init and exit functions unique driver-specific names to eliminate the anonymous names. Example 1: (System.map) ffffffff832fc78c t init ffffffff832fc79e t init ffffffff832fc8f8 t init Example 2: (initcall_debug log) calling init+0x0/0x12 @ 1 initcall init+0x0/0x12 returned 0 after 15 usecs calling init+0x0/0x60 @ 1 initcall init+0x0/0x60 returned 0 after 2 usecs calling init+0x0/0x9a @ 1 initcall init+0x0/0x9a returned 0 after 74 usecs Fixes: e467cde23818 ("Block driver using virtio.") Signed-off-by: Randy Dunlap Cc: "Michael S. Tsirkin" Cc: Jason Wang Cc: Paolo Bonzini Cc: Stefan Hajnoczi Cc: virtualization@lists.linux-foundation.org Cc: Jens Axboe Cc: linux-block@vger.kernel.org Acked-by: Jason Wang Reviewed-by: Stefan Hajnoczi Acked-by: Michael S. Tsirkin --- drivers/block/virtio_blk.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- lnx-517-rc8.orig/drivers/block/virtio_blk.c +++ lnx-517-rc8/drivers/block/virtio_blk.c @@ -1058,7 +1058,7 @@ static struct virtio_driver virtio_blk = #endif }; -static int __init init(void) +static int __init virtio_blk_init(void) { int error; @@ -1084,14 +1084,14 @@ out_destroy_workqueue: return error; } -static void __exit fini(void) +static void __exit virtio_blk_fini(void) { unregister_virtio_driver(&virtio_blk); unregister_blkdev(major, "virtblk"); destroy_workqueue(virtblk_wq); } -module_init(init); -module_exit(fini); +module_init(virtio_blk_init); +module_exit(virtio_blk_fini); MODULE_DEVICE_TABLE(virtio, id_table); MODULE_DESCRIPTION("Virtio block driver"); From patchwork Wed Mar 16 19:20:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Randy Dunlap X-Patchwork-Id: 12783125 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7F9C3C41535 for ; Wed, 16 Mar 2022 19:20:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357847AbiCPTVk (ORCPT ); Wed, 16 Mar 2022 15:21:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51048 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230130AbiCPTVh (ORCPT ); Wed, 16 Mar 2022 15:21:37 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 710C65FF32; Wed, 16 Mar 2022 12:20:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=bxcgHAl0Vjaoi9igyOuuv3t+bDn9tO/RrS7lBi/KU+M=; b=f6hRy706t/BpNpFO1C9Km2RrDC QpQAZACubPMNHVjc1Qg4uTBS8JBsSkx6wWoOO6MkPJLDnRMPb4gvs6j+IxwOBV3OSeMK+SM4Bc/qr cbVKkVwZ7HPLsk4PUNHYTJtLurqFWxXaUdf1VQas1wSqg474f4RVgG74C1IMA8nhCoibwkT0pOmOU GBglyb2fZdt3taUHK7+NnvqDf/kegkuSfBz7kIBCvuVIgmTmTlKHaYbML2syZZpq1QELYE2/RzZoa l0az3lska8YewVS5FuOdlrR7fZdGroVN4nksyhhqrm4CGqbCEJyDuxhNl+9rqNtKe/b3GXlgFM8kV vY7z0i7Q==; Received: from [2601:1c0:6280:3f0::aa0b] (helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1nUZBy-00EArp-Bl; Wed, 16 Mar 2022 19:20:18 +0000 From: Randy Dunlap To: linux-kernel@vger.kernel.org Cc: Randy Dunlap , "Michael S. Tsirkin" , Jason Wang , Paolo Bonzini , Stefan Hajnoczi , Jens Axboe , Amit Shah , Arnd Bergmann , Greg Kroah-Hartman , Eli Cohen , Saeed Mahameed , Leon Romanovsky , Pablo Neira Ayuso , Jozsef Kadlecsik , Florian Westphal , "David S. Miller" , Jakub Kicinski , "James E.J. Bottomley" , "Martin K. Petersen" , Felipe Balbi , =?utf-8?b?TWljaGHFgiBNaXJvc8WC?= =?utf-8?b?YXc=?= , Sebastian Andrzej Siewior , Krzysztof Opasiak , Igor Kotrasinski , Valentina Manea , Shuah Khan , Shuah Khan , Jussi Kivilinna , Joachim Fritschi , Herbert Xu , Thomas Gleixner , Steven Rostedt , Ingo Molnar , Karol Herbst , Pekka Paalanen , Dave Hansen , Andy Lutomirski , Peter Zijlstra , Borislav Petkov , "H. Peter Anvin" , netfilter-devel@vger.kernel.org, coreteam@netfilter.org, netdev@vger.kernel.org, linux-block@vger.kernel.org, linux-crypto@vger.kernel.org, linux-rdma@vger.kernel.org, linux-scsi@vger.kernel.org, linux-usb@vger.kernel.org, nouveau@lists.freedesktop.org, virtualization@lists.linux-foundation.org, x86@kernel.org Subject: [PATCH 2/9] virtio_console: eliminate anonymous module_init & module_exit Date: Wed, 16 Mar 2022 12:20:03 -0700 Message-Id: <20220316192010.19001-3-rdunlap@infradead.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220316192010.19001-1-rdunlap@infradead.org> References: <20220316192010.19001-1-rdunlap@infradead.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Eliminate anonymous module_init() and module_exit(), which can lead to confusion or ambiguity when reading System.map, crashes/oops/bugs, or an initcall_debug log. Give each of these init and exit functions unique driver-specific names to eliminate the anonymous names. Example 1: (System.map) ffffffff832fc78c t init ffffffff832fc79e t init ffffffff832fc8f8 t init Example 2: (initcall_debug log) calling init+0x0/0x12 @ 1 initcall init+0x0/0x12 returned 0 after 15 usecs calling init+0x0/0x60 @ 1 initcall init+0x0/0x60 returned 0 after 2 usecs calling init+0x0/0x9a @ 1 initcall init+0x0/0x9a returned 0 after 74 usecs Fixes: 31610434bc35 ("Virtio console driver") Fixes: 7177876fea83 ("virtio: console: Add ability to remove module") Signed-off-by: Randy Dunlap Cc: Amit Shah Cc: virtualization@lists.linux-foundation.org Cc: Arnd Bergmann Cc: Greg Kroah-Hartman Reviewed-by: Amit Shah Acked-by: Michael S. Tsirkin --- drivers/char/virtio_console.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- lnx-517-rc8.orig/drivers/char/virtio_console.c +++ lnx-517-rc8/drivers/char/virtio_console.c @@ -2245,7 +2245,7 @@ static struct virtio_driver virtio_rproc .remove = virtcons_remove, }; -static int __init init(void) +static int __init virtio_console_init(void) { int err; @@ -2280,7 +2280,7 @@ free: return err; } -static void __exit fini(void) +static void __exit virtio_console_fini(void) { reclaim_dma_bufs(); @@ -2290,8 +2290,8 @@ static void __exit fini(void) class_destroy(pdrvdata.class); debugfs_remove_recursive(pdrvdata.debugfs_dir); } -module_init(init); -module_exit(fini); +module_init(virtio_console_init); +module_exit(virtio_console_fini); MODULE_DESCRIPTION("Virtio console driver"); MODULE_LICENSE("GPL"); From patchwork Wed Mar 16 19:20:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Randy Dunlap X-Patchwork-Id: 12783127 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F06F1C4707F for ; Wed, 16 Mar 2022 19:20:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357876AbiCPTVn (ORCPT ); Wed, 16 Mar 2022 15:21:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236552AbiCPTVh (ORCPT ); Wed, 16 Mar 2022 15:21:37 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C52A7606CA; Wed, 16 Mar 2022 12:20:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=eCnVY7uQehwpOm+/i+ja6QzAKTO0vo8Gbh+yXOb+Gg8=; b=m6A+Wfto0x/+asj1wMXe6zUSoZ VW5gB9LD8p4BZS/fH+G1DjKRf3HJg9qcRbrRBBDIf4xPZl6DdNvFnd6c68IC5/fMVAQFBK3WmkBZA b1YgQZgXNEa2sjTW4NsgVsBFL+UlE4F6iZn8e9REQQmC6G1ejP6tabyS/AVW/K/MUTr/tJFQ04Tm3 7t6qa5bO1NyCGn3r6ypp7kK+AgAqgg4M8dV9+q06bvu0XOTlt5wUoD3YAbcznwzzHiizxoy8balfP 1W/HSRRJTvQsHB24y9B/CI3cWIlYos50+150upEuzFMLrTvzpxBYw0wPNMtDbdaVK0lksct7M2Hah I/B++NZA==; Received: from [2601:1c0:6280:3f0::aa0b] (helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1nUZC0-00EArp-6Y; Wed, 16 Mar 2022 19:20:20 +0000 From: Randy Dunlap To: linux-kernel@vger.kernel.org Cc: Randy Dunlap , "Michael S. Tsirkin" , Jason Wang , Paolo Bonzini , Stefan Hajnoczi , Jens Axboe , Amit Shah , Arnd Bergmann , Greg Kroah-Hartman , Eli Cohen , Saeed Mahameed , Leon Romanovsky , Pablo Neira Ayuso , Jozsef Kadlecsik , Florian Westphal , "David S. Miller" , Jakub Kicinski , "James E.J. Bottomley" , "Martin K. Petersen" , Felipe Balbi , =?utf-8?b?TWljaGHFgiBNaXJvc8WC?= =?utf-8?b?YXc=?= , Sebastian Andrzej Siewior , Krzysztof Opasiak , Igor Kotrasinski , Valentina Manea , Shuah Khan , Shuah Khan , Jussi Kivilinna , Joachim Fritschi , Herbert Xu , Thomas Gleixner , Steven Rostedt , Ingo Molnar , Karol Herbst , Pekka Paalanen , Dave Hansen , Andy Lutomirski , Peter Zijlstra , Borislav Petkov , "H. Peter Anvin" , netfilter-devel@vger.kernel.org, coreteam@netfilter.org, netdev@vger.kernel.org, linux-block@vger.kernel.org, linux-crypto@vger.kernel.org, linux-rdma@vger.kernel.org, linux-scsi@vger.kernel.org, linux-usb@vger.kernel.org, nouveau@lists.freedesktop.org, virtualization@lists.linux-foundation.org, x86@kernel.org Subject: [PATCH 3/9] net: mlx5: eliminate anonymous module_init & module_exit Date: Wed, 16 Mar 2022 12:20:04 -0700 Message-Id: <20220316192010.19001-4-rdunlap@infradead.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220316192010.19001-1-rdunlap@infradead.org> References: <20220316192010.19001-1-rdunlap@infradead.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Eliminate anonymous module_init() and module_exit(), which can lead to confusion or ambiguity when reading System.map, crashes/oops/bugs, or an initcall_debug log. Give each of these init and exit functions unique driver-specific names to eliminate the anonymous names. Example 1: (System.map) ffffffff832fc78c t init ffffffff832fc79e t init ffffffff832fc8f8 t init Example 2: (initcall_debug log) calling init+0x0/0x12 @ 1 initcall init+0x0/0x12 returned 0 after 15 usecs calling init+0x0/0x60 @ 1 initcall init+0x0/0x60 returned 0 after 2 usecs calling init+0x0/0x9a @ 1 initcall init+0x0/0x9a returned 0 after 74 usecs Fixes: e126ba97dba9 ("mlx5: Add driver for Mellanox Connect-IB adapters") Signed-off-by: Randy Dunlap Cc: Eli Cohen Cc: Saeed Mahameed Cc: netdev@vger.kernel.org Cc: Leon Romanovsky Cc: linux-rdma@vger.kernel.org Reviewed-by: Leon Romanovsky --- drivers/net/ethernet/mellanox/mlx5/core/main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- lnx-517-rc8.orig/drivers/net/ethernet/mellanox/mlx5/core/main.c +++ lnx-517-rc8/drivers/net/ethernet/mellanox/mlx5/core/main.c @@ -1893,7 +1893,7 @@ static void mlx5_core_verify_params(void } } -static int __init init(void) +static int __init mlx5_init(void) { int err; @@ -1929,7 +1929,7 @@ err_debug: return err; } -static void __exit cleanup(void) +static void __exit mlx5_cleanup(void) { mlx5e_cleanup(); mlx5_sf_driver_unregister(); @@ -1937,5 +1937,5 @@ static void __exit cleanup(void) mlx5_unregister_debugfs(); } -module_init(init); -module_exit(cleanup); +module_init(mlx5_init); +module_exit(mlx5_cleanup); From patchwork Wed Mar 16 19:20:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Randy Dunlap X-Patchwork-Id: 12783126 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C87A8C35274 for ; Wed, 16 Mar 2022 19:20:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357864AbiCPTVm (ORCPT ); Wed, 16 Mar 2022 15:21:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239247AbiCPTVh (ORCPT ); Wed, 16 Mar 2022 15:21:37 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E23E64BC9; Wed, 16 Mar 2022 12:20:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=kkn5nl5PyZ0q8CQgfKlyj74bCk1dDbY3QIroXRJfS3I=; b=L0Bzgh5zuGNbr91N7JyNzX75Kt JhMPfxEcrzeOsN+4vC/CQeS/AfZDGU+5ouMlirI/rZlDV6medv70vXqOCpdpetjh/H7ppc9k7YjoQ mWVLClmn5iciAIW8GjkzdABLcKRZNG86bC0bj6NdTgJfo5d7UAQvPrCAUQ4FQyQPcgNzA4MmEdng6 5M/6nJLSdV4Wjea7de1J5ZEHA4+v3/9Xn2lcAV4IQZkYqUV5mDBeYxRqeKo2F2Nxn6ij2b1jWpj/B GJdT5rS8QpS8JY48lBxVds6mh4DtB5qF3Kq7M4maGkcKaJPRzyLnPEgEUUsJZEDdZVKPRbWapcHoH tc+kxufg==; Received: from [2601:1c0:6280:3f0::aa0b] (helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1nUZC2-00EArp-0P; Wed, 16 Mar 2022 19:20:22 +0000 From: Randy Dunlap To: linux-kernel@vger.kernel.org Cc: Randy Dunlap , "Michael S. Tsirkin" , Jason Wang , Paolo Bonzini , Stefan Hajnoczi , Jens Axboe , Amit Shah , Arnd Bergmann , Greg Kroah-Hartman , Eli Cohen , Saeed Mahameed , Leon Romanovsky , Pablo Neira Ayuso , Jozsef Kadlecsik , Florian Westphal , "David S. Miller" , Jakub Kicinski , "James E.J. Bottomley" , "Martin K. Petersen" , Felipe Balbi , =?utf-8?b?TWljaGHFgiBNaXJvc8WC?= =?utf-8?b?YXc=?= , Sebastian Andrzej Siewior , Krzysztof Opasiak , Igor Kotrasinski , Valentina Manea , Shuah Khan , Shuah Khan , Jussi Kivilinna , Joachim Fritschi , Herbert Xu , Thomas Gleixner , Steven Rostedt , Ingo Molnar , Karol Herbst , Pekka Paalanen , Dave Hansen , Andy Lutomirski , Peter Zijlstra , Borislav Petkov , "H. Peter Anvin" , netfilter-devel@vger.kernel.org, coreteam@netfilter.org, netdev@vger.kernel.org, linux-block@vger.kernel.org, linux-crypto@vger.kernel.org, linux-rdma@vger.kernel.org, linux-scsi@vger.kernel.org, linux-usb@vger.kernel.org, nouveau@lists.freedesktop.org, virtualization@lists.linux-foundation.org, x86@kernel.org Subject: [PATCH 4/9] netfilter: h323: eliminate anonymous module_init & module_exit Date: Wed, 16 Mar 2022 12:20:05 -0700 Message-Id: <20220316192010.19001-5-rdunlap@infradead.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220316192010.19001-1-rdunlap@infradead.org> References: <20220316192010.19001-1-rdunlap@infradead.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Eliminate anonymous module_init() and module_exit(), which can lead to confusion or ambiguity when reading System.map, crashes/oops/bugs, or an initcall_debug log. Give each of these init and exit functions unique driver-specific names to eliminate the anonymous names. Example 1: (System.map) ffffffff832fc78c t init ffffffff832fc79e t init ffffffff832fc8f8 t init Example 2: (initcall_debug log) calling init+0x0/0x12 @ 1 initcall init+0x0/0x12 returned 0 after 15 usecs calling init+0x0/0x60 @ 1 initcall init+0x0/0x60 returned 0 after 2 usecs calling init+0x0/0x9a @ 1 initcall init+0x0/0x9a returned 0 after 74 usecs Fixes: f587de0e2feb ("[NETFILTER]: nf_conntrack/nf_nat: add H.323 helper port") Signed-off-by: Randy Dunlap Cc: Pablo Neira Ayuso Cc: Jozsef Kadlecsik Cc: Florian Westphal Cc: netfilter-devel@vger.kernel.org Cc: coreteam@netfilter.org Cc: "David S. Miller" Cc: Jakub Kicinski Cc: netdev@vger.kernel.org Acked-by: Florian Westphal --- net/ipv4/netfilter/nf_nat_h323.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- lnx-517-rc8.orig/net/ipv4/netfilter/nf_nat_h323.c +++ lnx-517-rc8/net/ipv4/netfilter/nf_nat_h323.c @@ -580,7 +580,7 @@ static struct nf_ct_helper_expectfn call }; /****************************************************************************/ -static int __init init(void) +static int __init nf_nat_h323_init(void) { BUG_ON(set_h245_addr_hook != NULL); BUG_ON(set_h225_addr_hook != NULL); @@ -607,7 +607,7 @@ static int __init init(void) } /****************************************************************************/ -static void __exit fini(void) +static void __exit nf_nat_h323_fini(void) { RCU_INIT_POINTER(set_h245_addr_hook, NULL); RCU_INIT_POINTER(set_h225_addr_hook, NULL); @@ -624,8 +624,8 @@ static void __exit fini(void) } /****************************************************************************/ -module_init(init); -module_exit(fini); +module_init(nf_nat_h323_init); +module_exit(nf_nat_h323_fini); MODULE_AUTHOR("Jing Min Zhao "); MODULE_DESCRIPTION("H.323 NAT helper"); From patchwork Wed Mar 16 19:20:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Randy Dunlap X-Patchwork-Id: 12783129 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id ED112C433EF for ; Wed, 16 Mar 2022 19:20:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357887AbiCPTVo (ORCPT ); Wed, 16 Mar 2022 15:21:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51102 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352938AbiCPTVj (ORCPT ); Wed, 16 Mar 2022 15:21:39 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59CA440A3F; Wed, 16 Mar 2022 12:20:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=xtNRe1xty6FQQPFuledRJUXSwUairNMM4kORWxmQYV8=; b=t84D6OIOwke7941Ipke874O+qb aGBsnQhRO4EXcylH7PbZ6WwWeCmIP4gE/9nv3vDdhD6Os6XtG70EyG1KDkHTNG6ABB0g9QcjpdI0J 6N/hmx6YYf+6oZ/gr4ycnfMFPal+Dige9a+w8PggP2gPGgVIZzFbB96HtwvXzZx0mJE3frVq+3ZoH GqAwo3vDUKUFX67ZKegrnZ9P2I9r8/CCabOZh4Q2zU/aeqxkW7pHJ39DGMYNLyBiGPINg7GoFQeGX gTQQQGxpmdVzC4R5jza4poDTlmba5GZouKH8tZYaUsEpaWIqAzRdgk4s8ssWMJ1Zj/YQW+S+dYFbZ wOWrix6Q==; Received: from [2601:1c0:6280:3f0::aa0b] (helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1nUZC3-00EArp-Q1; Wed, 16 Mar 2022 19:20:23 +0000 From: Randy Dunlap To: linux-kernel@vger.kernel.org Cc: Randy Dunlap , "Michael S. Tsirkin" , Jason Wang , Paolo Bonzini , Stefan Hajnoczi , Jens Axboe , Amit Shah , Arnd Bergmann , Greg Kroah-Hartman , Eli Cohen , Saeed Mahameed , Leon Romanovsky , Pablo Neira Ayuso , Jozsef Kadlecsik , Florian Westphal , "David S. Miller" , Jakub Kicinski , "James E.J. Bottomley" , "Martin K. Petersen" , Felipe Balbi , =?utf-8?b?TWljaGHFgiBNaXJvc8WC?= =?utf-8?b?YXc=?= , Sebastian Andrzej Siewior , Krzysztof Opasiak , Igor Kotrasinski , Valentina Manea , Shuah Khan , Shuah Khan , Jussi Kivilinna , Joachim Fritschi , Herbert Xu , Thomas Gleixner , Steven Rostedt , Ingo Molnar , Karol Herbst , Pekka Paalanen , Dave Hansen , Andy Lutomirski , Peter Zijlstra , Borislav Petkov , "H. Peter Anvin" , netfilter-devel@vger.kernel.org, coreteam@netfilter.org, netdev@vger.kernel.org, linux-block@vger.kernel.org, linux-crypto@vger.kernel.org, linux-rdma@vger.kernel.org, linux-scsi@vger.kernel.org, linux-usb@vger.kernel.org, nouveau@lists.freedesktop.org, virtualization@lists.linux-foundation.org, x86@kernel.org Subject: [PATCH 5/9] virtio-scsi: eliminate anonymous module_init & module_exit Date: Wed, 16 Mar 2022 12:20:06 -0700 Message-Id: <20220316192010.19001-6-rdunlap@infradead.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220316192010.19001-1-rdunlap@infradead.org> References: <20220316192010.19001-1-rdunlap@infradead.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Eliminate anonymous module_init() and module_exit(), which can lead to confusion or ambiguity when reading System.map, crashes/oops/bugs, or an initcall_debug log. Give each of these init and exit functions unique driver-specific names to eliminate the anonymous names. Example 1: (System.map) ffffffff832fc78c t init ffffffff832fc79e t init ffffffff832fc8f8 t init Example 2: (initcall_debug log) calling init+0x0/0x12 @ 1 initcall init+0x0/0x12 returned 0 after 15 usecs calling init+0x0/0x60 @ 1 initcall init+0x0/0x60 returned 0 after 2 usecs calling init+0x0/0x9a @ 1 initcall init+0x0/0x9a returned 0 after 74 usecs Fixes: 4fe74b1cb051 ("[SCSI] virtio-scsi: SCSI driver for QEMU based virtual machines") Signed-off-by: Randy Dunlap Cc: "Michael S. Tsirkin" Cc: Jason Wang Cc: Paolo Bonzini Cc: Stefan Hajnoczi Cc: "James E.J. Bottomley" Cc: "Martin K. Petersen" Cc: linux-scsi@vger.kernel.org Cc: virtualization@lists.linux-foundation.org Acked-by: Jason Wang Reviewed-by: Stefan Hajnoczi Acked-by: Michael S. Tsirkin --- drivers/scsi/virtio_scsi.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- lnx-517-rc8.orig/drivers/scsi/virtio_scsi.c +++ lnx-517-rc8/drivers/scsi/virtio_scsi.c @@ -988,7 +988,7 @@ static struct virtio_driver virtio_scsi_ .remove = virtscsi_remove, }; -static int __init init(void) +static int __init virtio_scsi_init(void) { int ret = -ENOMEM; @@ -1020,14 +1020,14 @@ error: return ret; } -static void __exit fini(void) +static void __exit virtio_scsi_fini(void) { unregister_virtio_driver(&virtio_scsi_driver); mempool_destroy(virtscsi_cmd_pool); kmem_cache_destroy(virtscsi_cmd_cache); } -module_init(init); -module_exit(fini); +module_init(virtio_scsi_init); +module_exit(virtio_scsi_fini); MODULE_DEVICE_TABLE(virtio, id_table); MODULE_DESCRIPTION("Virtio SCSI HBA driver"); From patchwork Wed Mar 16 19:20:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Randy Dunlap X-Patchwork-Id: 12783128 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BAB0CC433EF for ; Wed, 16 Mar 2022 19:20:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357902AbiCPTVp (ORCPT ); Wed, 16 Mar 2022 15:21:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51236 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1357851AbiCPTVl (ORCPT ); Wed, 16 Mar 2022 15:21:41 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2CAF940A3F; Wed, 16 Mar 2022 12:20:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Sender:Reply-To:Content-ID:Content-Description; bh=4Krw3MostSzdRmJotMI0a/aFHrz6hD4Rnz4KlkBsZsY=; b=oMmN0YOyCxbwsqUbjdCoYoeLS5 xwOMYvr9c6y0ZD0gLE9DMUnynweLItGGubfTLvG/AFTS8gDdpV6qbKOe2/SN3s2MVuCKG2ip8Mj1T daPYsOGmw7rRzY22M54r0qxbz7gAzmEjzHxFdcWBVn37bavK9d81on5K0p1gEE5WIrLXqWY8/fU6M s5P/mifVEcH7CseJqbey8V+DTjHnfTd9wcLrhUE4NbrJGroreYsn7JZe2n7d0wMy7AotAiFE9ZHGk 8JL0YSuhRL0OVQ5l3GWEQSBBUdGvXVahxlykI44NQpLaQo/Se64NnCywaP3JRAx3A9pSa/0AcvqOF CO5qvuzA==; Received: from [2601:1c0:6280:3f0::aa0b] (helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1nUZC5-00EArp-Jb; Wed, 16 Mar 2022 19:20:25 +0000 From: Randy Dunlap To: linux-kernel@vger.kernel.org Cc: Randy Dunlap , "Michael S. Tsirkin" , Jason Wang , Paolo Bonzini , Stefan Hajnoczi , Jens Axboe , Amit Shah , Arnd Bergmann , Greg Kroah-Hartman , Eli Cohen , Saeed Mahameed , Leon Romanovsky , Pablo Neira Ayuso , Jozsef Kadlecsik , Florian Westphal , "David S. Miller" , Jakub Kicinski , "James E.J. Bottomley" , "Martin K. Petersen" , Felipe Balbi , =?utf-8?b?TWljaGHFgiBNaXJvc8WC?= =?utf-8?b?YXc=?= , Sebastian Andrzej Siewior , Krzysztof Opasiak , Igor Kotrasinski , Valentina Manea , Shuah Khan , Shuah Khan , Jussi Kivilinna , Joachim Fritschi , Herbert Xu , Thomas Gleixner , Steven Rostedt , Ingo Molnar , Karol Herbst , Pekka Paalanen , Dave Hansen , Andy Lutomirski , Peter Zijlstra , Borislav Petkov , "H. Peter Anvin" , netfilter-devel@vger.kernel.org, coreteam@netfilter.org, netdev@vger.kernel.org, linux-block@vger.kernel.org, linux-crypto@vger.kernel.org, linux-rdma@vger.kernel.org, linux-scsi@vger.kernel.org, linux-usb@vger.kernel.org, nouveau@lists.freedesktop.org, virtualization@lists.linux-foundation.org, x86@kernel.org Subject: [PATCH 6/9] usb: gadget: eliminate anonymous module_init & module_exit Date: Wed, 16 Mar 2022 12:20:07 -0700 Message-Id: <20220316192010.19001-7-rdunlap@infradead.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220316192010.19001-1-rdunlap@infradead.org> References: <20220316192010.19001-1-rdunlap@infradead.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Eliminate anonymous module_init() and module_exit(), which can lead to confusion or ambiguity when reading System.map, crashes/oops/bugs, or an initcall_debug log. Give each of these init and exit functions unique driver-specific names to eliminate the anonymous names. Example 1: (System.map) ffffffff832fc78c t init ffffffff832fc79e t init ffffffff832fc8f8 t init Example 2: (initcall_debug log) calling init+0x0/0x12 @ 1 initcall init+0x0/0x12 returned 0 after 15 usecs calling init+0x0/0x60 @ 1 initcall init+0x0/0x60 returned 0 after 2 usecs calling init+0x0/0x9a @ 1 initcall init+0x0/0x9a returned 0 after 74 usecs Fixes: bd25a14edb75 ("usb: gadget: legacy/serial: allow dynamic removal") Fixes: 7bb5ea54be47 ("usb gadget serial: use composite gadget framework") Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Randy Dunlap Cc: Felipe Balbi Cc: Michał Mirosław Cc: Greg Kroah-Hartman Cc: Sebastian Andrzej Siewior Cc: linux-usb@vger.kernel.org Reviewed-by: Ira Weiny --- drivers/usb/gadget/legacy/inode.c | 8 ++++---- drivers/usb/gadget/legacy/serial.c | 10 +++++----- drivers/usb/gadget/udc/dummy_hcd.c | 8 ++++---- 3 files changed, 13 insertions(+), 13 deletions(-) --- lnx-517-rc8.orig/drivers/usb/gadget/legacy/serial.c +++ lnx-517-rc8/drivers/usb/gadget/legacy/serial.c @@ -273,7 +273,7 @@ static struct usb_composite_driver gseri static int switch_gserial_enable(bool do_enable) { if (!serial_config_driver.label) - /* init() was not called, yet */ + /* gserial_init() was not called, yet */ return 0; if (do_enable) @@ -283,7 +283,7 @@ static int switch_gserial_enable(bool do return 0; } -static int __init init(void) +static int __init gserial_init(void) { /* We *could* export two configs; that'd be much cleaner... * but neither of these product IDs was defined that way. @@ -314,11 +314,11 @@ static int __init init(void) return usb_composite_probe(&gserial_driver); } -module_init(init); +module_init(gserial_init); -static void __exit cleanup(void) +static void __exit gserial_cleanup(void) { if (enable) usb_composite_unregister(&gserial_driver); } -module_exit(cleanup); +module_exit(gserial_cleanup); --- lnx-517-rc8.orig/drivers/usb/gadget/udc/dummy_hcd.c +++ lnx-517-rc8/drivers/usb/gadget/udc/dummy_hcd.c @@ -2765,7 +2765,7 @@ static struct platform_driver dummy_hcd_ static struct platform_device *the_udc_pdev[MAX_NUM_UDC]; static struct platform_device *the_hcd_pdev[MAX_NUM_UDC]; -static int __init init(void) +static int __init dummy_hcd_init(void) { int retval = -ENOMEM; int i; @@ -2887,9 +2887,9 @@ err_alloc_udc: platform_device_put(the_hcd_pdev[i]); return retval; } -module_init(init); +module_init(dummy_hcd_init); -static void __exit cleanup(void) +static void __exit dummy_hcd_cleanup(void) { int i; @@ -2905,4 +2905,4 @@ static void __exit cleanup(void) platform_driver_unregister(&dummy_udc_driver); platform_driver_unregister(&dummy_hcd_driver); } -module_exit(cleanup); +module_exit(dummy_hcd_cleanup); --- lnx-517-rc8.orig/drivers/usb/gadget/legacy/inode.c +++ lnx-517-rc8/drivers/usb/gadget/legacy/inode.c @@ -2101,7 +2101,7 @@ MODULE_ALIAS_FS("gadgetfs"); /*----------------------------------------------------------------------*/ -static int __init init (void) +static int __init gadgetfs_init (void) { int status; @@ -2111,12 +2111,12 @@ static int __init init (void) shortname, driver_desc); return status; } -module_init (init); +module_init (gadgetfs_init); -static void __exit cleanup (void) +static void __exit gadgetfs_cleanup (void) { pr_debug ("unregister %s\n", shortname); unregister_filesystem (&gadgetfs_type); } -module_exit (cleanup); +module_exit (gadgetfs_cleanup); From patchwork Wed Mar 16 19:20:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Randy Dunlap X-Patchwork-Id: 12783130 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 891E5C433EF for ; Wed, 16 Mar 2022 19:20:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357979AbiCPTV7 (ORCPT ); Wed, 16 Mar 2022 15:21:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1357860AbiCPTVm (ORCPT ); Wed, 16 Mar 2022 15:21:42 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 17A1340A3F; Wed, 16 Mar 2022 12:20:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=I73CgbF6729wI2OMfPa7NCxG3sEoqNqrUxCVuaWYikI=; b=vfQEJC7clJiDCX70jOXFjsAqVr RsHe0lFIEd1MJgFbYE0gt+pK9/bBQ9yr/XHgb6PlXtKVNnE4grHpTSqJXg+QKYQKUpGnsBonJ9U01 hDerMUrt6itAF3TL6Llq6sGGjgWz0n599JPSP5lVrYGGZTJrOpKqSEWKxM3DdyX/hO6EDO6WwFV5C SobsjsMQ5TbbMAVQdJlaP8GZyf1U8kWywA8fSEQxcpsaz/Da6CGPqDfObwvZPtq5v+9H3k0mO94hs HAGJyirDT+UWjgACI8PEJ0FufcIHgw7aJb7xm7hWahssEZydzz68UNUu2l9JpqX2qCyCWQXC/V06+ cVrWMhgA==; Received: from [2601:1c0:6280:3f0::aa0b] (helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1nUZC7-00EArp-Gg; Wed, 16 Mar 2022 19:20:27 +0000 From: Randy Dunlap To: linux-kernel@vger.kernel.org Cc: Randy Dunlap , "Michael S. Tsirkin" , Jason Wang , Paolo Bonzini , Stefan Hajnoczi , Jens Axboe , Amit Shah , Arnd Bergmann , Greg Kroah-Hartman , Eli Cohen , Saeed Mahameed , Leon Romanovsky , Pablo Neira Ayuso , Jozsef Kadlecsik , Florian Westphal , "David S. Miller" , Jakub Kicinski , "James E.J. Bottomley" , "Martin K. Petersen" , Felipe Balbi , =?utf-8?b?TWljaGHFgiBNaXJvc8WC?= =?utf-8?b?YXc=?= , Sebastian Andrzej Siewior , Krzysztof Opasiak , Igor Kotrasinski , Valentina Manea , Shuah Khan , Shuah Khan , Jussi Kivilinna , Joachim Fritschi , Herbert Xu , Thomas Gleixner , Steven Rostedt , Ingo Molnar , Karol Herbst , Pekka Paalanen , Dave Hansen , Andy Lutomirski , Peter Zijlstra , Borislav Petkov , "H. Peter Anvin" , netfilter-devel@vger.kernel.org, coreteam@netfilter.org, netdev@vger.kernel.org, linux-block@vger.kernel.org, linux-crypto@vger.kernel.org, linux-rdma@vger.kernel.org, linux-scsi@vger.kernel.org, linux-usb@vger.kernel.org, nouveau@lists.freedesktop.org, virtualization@lists.linux-foundation.org, x86@kernel.org Subject: [PATCH 7/9] usb: usbip: eliminate anonymous module_init & module_exit Date: Wed, 16 Mar 2022 12:20:08 -0700 Message-Id: <20220316192010.19001-8-rdunlap@infradead.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220316192010.19001-1-rdunlap@infradead.org> References: <20220316192010.19001-1-rdunlap@infradead.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Eliminate anonymous module_init() and module_exit(), which can lead to confusion or ambiguity when reading System.map, crashes/oops/bugs, or an initcall_debug log. Give each of these init and exit functions unique driver-specific names to eliminate the anonymous names. Example 1: (System.map) ffffffff832fc78c t init ffffffff832fc79e t init ffffffff832fc8f8 t init Example 2: (initcall_debug log) calling init+0x0/0x12 @ 1 initcall init+0x0/0x12 returned 0 after 15 usecs calling init+0x0/0x60 @ 1 initcall init+0x0/0x60 returned 0 after 2 usecs calling init+0x0/0x9a @ 1 initcall init+0x0/0x9a returned 0 after 74 usecs Fixes: 80fd9cd52de6 ("usbip: vudc: Add VUDC main file") Signed-off-by: Randy Dunlap Cc: Krzysztof Opasiak Cc: Igor Kotrasinski Cc: Greg Kroah-Hartman Cc: Valentina Manea Cc: Shuah Khan Cc: Shuah Khan Cc: linux-usb@vger.kernel.org Acked-by: Shuah Khan --- drivers/usb/usbip/vudc_main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- lnx-517-rc8.orig/drivers/usb/usbip/vudc_main.c +++ lnx-517-rc8/drivers/usb/usbip/vudc_main.c @@ -28,7 +28,7 @@ static struct platform_driver vudc_drive static struct list_head vudc_devices = LIST_HEAD_INIT(vudc_devices); -static int __init init(void) +static int __init vudc_init(void) { int retval = -ENOMEM; int i; @@ -86,9 +86,9 @@ cleanup: out: return retval; } -module_init(init); +module_init(vudc_init); -static void __exit cleanup(void) +static void __exit vudc_cleanup(void) { struct vudc_device *udc_dev = NULL, *udc_dev2 = NULL; @@ -103,7 +103,7 @@ static void __exit cleanup(void) } platform_driver_unregister(&vudc_driver); } -module_exit(cleanup); +module_exit(vudc_cleanup); MODULE_DESCRIPTION("USB over IP Device Controller"); MODULE_AUTHOR("Krzysztof Opasiak, Karol Kosik, Igor Kotrasinski"); From patchwork Wed Mar 16 19:20:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Randy Dunlap X-Patchwork-Id: 12783131 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3B534C43217 for ; Wed, 16 Mar 2022 19:20:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357985AbiCPTWB (ORCPT ); Wed, 16 Mar 2022 15:22:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1357917AbiCPTVq (ORCPT ); Wed, 16 Mar 2022 15:21:46 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6CC376A00C; Wed, 16 Mar 2022 12:20:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=mAEBdlB3OIVWW6VHbg2SecqMSqz6buQ0aUi+Rw762/Y=; b=QU8xTqKmgiaf0d2RYK0H55UDCG aLJvbEgjnyUe31XqnajbeerGSgezvbj7E6vzKNEkthY9gGqTCGwCgSKs/P6N/RAY4zpEqVLmXvKbP uiSRzPcbdU7p3lSpluXCtlaLUMBZuaHvqoH09vYAF9WublfayTlpUU/qLQX/IDYXeABeZH5o+zC2W 8kZMfKNRXr6lT1/BQuMttKB9AK/4vNhr0ZbmY9ozWZm9W0S5VvcJ8UryNdPz0mWnabak/ruaUP3LR RSlCpaIl4OEVlR7bIZCUxDmvaJ/Q+Xkkx2o2F4c2Wa2eoa9/E3ikl20nvmBdUIbACnjGJJLK415O7 7YK7glNg==; Received: from [2601:1c0:6280:3f0::aa0b] (helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1nUZCA-00EArp-3R; Wed, 16 Mar 2022 19:20:30 +0000 From: Randy Dunlap To: linux-kernel@vger.kernel.org Cc: Randy Dunlap , "Michael S. Tsirkin" , Jason Wang , Paolo Bonzini , Stefan Hajnoczi , Jens Axboe , Amit Shah , Arnd Bergmann , Greg Kroah-Hartman , Eli Cohen , Saeed Mahameed , Leon Romanovsky , Pablo Neira Ayuso , Jozsef Kadlecsik , Florian Westphal , "David S. Miller" , Jakub Kicinski , "James E.J. Bottomley" , "Martin K. Petersen" , Felipe Balbi , =?utf-8?b?TWljaGHFgiBNaXJvc8WC?= =?utf-8?b?YXc=?= , Sebastian Andrzej Siewior , Krzysztof Opasiak , Igor Kotrasinski , Valentina Manea , Shuah Khan , Shuah Khan , Jussi Kivilinna , Joachim Fritschi , Herbert Xu , Thomas Gleixner , Steven Rostedt , Ingo Molnar , Karol Herbst , Pekka Paalanen , Dave Hansen , Andy Lutomirski , Peter Zijlstra , Borislav Petkov , "H. Peter Anvin" , netfilter-devel@vger.kernel.org, coreteam@netfilter.org, netdev@vger.kernel.org, linux-block@vger.kernel.org, linux-crypto@vger.kernel.org, linux-rdma@vger.kernel.org, linux-scsi@vger.kernel.org, linux-usb@vger.kernel.org, nouveau@lists.freedesktop.org, virtualization@lists.linux-foundation.org, x86@kernel.org Subject: [PATCH 8/9] x86/crypto: eliminate anonymous module_init & module_exit Date: Wed, 16 Mar 2022 12:20:09 -0700 Message-Id: <20220316192010.19001-9-rdunlap@infradead.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220316192010.19001-1-rdunlap@infradead.org> References: <20220316192010.19001-1-rdunlap@infradead.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Eliminate anonymous module_init() and module_exit(), which can lead to confusion or ambiguity when reading System.map, crashes/oops/bugs, or an initcall_debug log. Give each of these init and exit functions unique driver-specific names to eliminate the anonymous names. Example 1: (System.map) ffffffff832fc78c t init ffffffff832fc79e t init ffffffff832fc8f8 t init Example 2: (initcall_debug log) calling init+0x0/0x12 @ 1 initcall init+0x0/0x12 returned 0 after 15 usecs calling init+0x0/0x60 @ 1 initcall init+0x0/0x60 returned 0 after 2 usecs calling init+0x0/0x9a @ 1 initcall init+0x0/0x9a returned 0 after 74 usecs Fixes: 64b94ceae8c1 ("crypto: blowfish - add x86_64 assembly implementation") Fixes: 676a38046f4f ("crypto: camellia-x86_64 - module init/exit functions should be static") Fixes: 0b95ec56ae19 ("crypto: camellia - add assembler implementation for x86_64") Fixes: 56d76c96a9f3 ("crypto: serpent - add AVX2/x86_64 assembler implementation of serpent cipher") Fixes: b9f535ffe38f ("[CRYPTO] twofish: i586 assembly version") Fixes: ff0a70fe0536 ("crypto: twofish-x86_64-3way - module init/exit functions should be static") Fixes: 8280daad436e ("crypto: twofish - add 3-way parallel x86_64 assembler implemention") Signed-off-by: Randy Dunlap Cc: Jussi Kivilinna Cc: Joachim Fritschi Cc: Herbert Xu Cc: "David S. Miller" Cc: linux-crypto@vger.kernel.org Cc: x86@kernel.org --- arch/x86/crypto/blowfish_glue.c | 8 ++++---- arch/x86/crypto/camellia_glue.c | 8 ++++---- arch/x86/crypto/serpent_avx2_glue.c | 8 ++++---- arch/x86/crypto/twofish_glue.c | 8 ++++---- arch/x86/crypto/twofish_glue_3way.c | 8 ++++---- 5 files changed, 20 insertions(+), 20 deletions(-) --- lnx-517-rc8.orig/arch/x86/crypto/blowfish_glue.c +++ lnx-517-rc8/arch/x86/crypto/blowfish_glue.c @@ -315,7 +315,7 @@ static int force; module_param(force, int, 0); MODULE_PARM_DESC(force, "Force module load, ignore CPU blacklist"); -static int __init init(void) +static int __init blowfish_init(void) { int err; @@ -339,15 +339,15 @@ static int __init init(void) return err; } -static void __exit fini(void) +static void __exit blowfish_fini(void) { crypto_unregister_alg(&bf_cipher_alg); crypto_unregister_skciphers(bf_skcipher_algs, ARRAY_SIZE(bf_skcipher_algs)); } -module_init(init); -module_exit(fini); +module_init(blowfish_init); +module_exit(blowfish_fini); MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("Blowfish Cipher Algorithm, asm optimized"); --- lnx-517-rc8.orig/arch/x86/crypto/camellia_glue.c +++ lnx-517-rc8/arch/x86/crypto/camellia_glue.c @@ -1377,7 +1377,7 @@ static int force; module_param(force, int, 0); MODULE_PARM_DESC(force, "Force module load, ignore CPU blacklist"); -static int __init init(void) +static int __init camellia_init(void) { int err; @@ -1401,15 +1401,15 @@ static int __init init(void) return err; } -static void __exit fini(void) +static void __exit camellia_fini(void) { crypto_unregister_alg(&camellia_cipher_alg); crypto_unregister_skciphers(camellia_skcipher_algs, ARRAY_SIZE(camellia_skcipher_algs)); } -module_init(init); -module_exit(fini); +module_init(camellia_init); +module_exit(camellia_fini); MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("Camellia Cipher Algorithm, asm optimized"); --- lnx-517-rc8.orig/arch/x86/crypto/serpent_avx2_glue.c +++ lnx-517-rc8/arch/x86/crypto/serpent_avx2_glue.c @@ -96,7 +96,7 @@ static struct skcipher_alg serpent_algs[ static struct simd_skcipher_alg *serpent_simd_algs[ARRAY_SIZE(serpent_algs)]; -static int __init init(void) +static int __init serpent_avx2_init(void) { const char *feature_name; @@ -115,14 +115,14 @@ static int __init init(void) serpent_simd_algs); } -static void __exit fini(void) +static void __exit serpent_avx2_fini(void) { simd_unregister_skciphers(serpent_algs, ARRAY_SIZE(serpent_algs), serpent_simd_algs); } -module_init(init); -module_exit(fini); +module_init(serpent_avx2_init); +module_exit(serpent_avx2_fini); MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("Serpent Cipher Algorithm, AVX2 optimized"); --- lnx-517-rc8.orig/arch/x86/crypto/twofish_glue.c +++ lnx-517-rc8/arch/x86/crypto/twofish_glue.c @@ -81,18 +81,18 @@ static struct crypto_alg alg = { } }; -static int __init init(void) +static int __init twofish_glue_init(void) { return crypto_register_alg(&alg); } -static void __exit fini(void) +static void __exit twofish_glue_fini(void) { crypto_unregister_alg(&alg); } -module_init(init); -module_exit(fini); +module_init(twofish_glue_init); +module_exit(twofish_glue_fini); MODULE_LICENSE("GPL"); MODULE_DESCRIPTION ("Twofish Cipher Algorithm, asm optimized"); --- lnx-517-rc8.orig/arch/x86/crypto/twofish_glue_3way.c +++ lnx-517-rc8/arch/x86/crypto/twofish_glue_3way.c @@ -140,7 +140,7 @@ static int force; module_param(force, int, 0); MODULE_PARM_DESC(force, "Force module load, ignore CPU blacklist"); -static int __init init(void) +static int __init twofish_3way_init(void) { if (!force && is_blacklisted_cpu()) { printk(KERN_INFO @@ -154,13 +154,13 @@ static int __init init(void) ARRAY_SIZE(tf_skciphers)); } -static void __exit fini(void) +static void __exit twofish_3way_fini(void) { crypto_unregister_skciphers(tf_skciphers, ARRAY_SIZE(tf_skciphers)); } -module_init(init); -module_exit(fini); +module_init(twofish_3way_init); +module_exit(twofish_3way_fini); MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("Twofish Cipher Algorithm, 3-way parallel asm optimized"); From patchwork Wed Mar 16 19:20:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Randy Dunlap X-Patchwork-Id: 12783132 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B0F1AC4167D for ; Wed, 16 Mar 2022 19:20:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357995AbiCPTWD (ORCPT ); Wed, 16 Mar 2022 15:22:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52202 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1357942AbiCPTV4 (ORCPT ); Wed, 16 Mar 2022 15:21:56 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A7EC26AA73; Wed, 16 Mar 2022 12:20:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=vYNWn7/gWvdXVAuSqHEJdNrAy6DmSK7DzABaWvfRolU=; b=uz/gKWuyajnQkK6EymeSIkywI8 AKee4iVGItlSmtUcyfpMs2rpMKsnM+1/6giveeY/JiJlrqSVxOo/uKyCQMLRnf2rtJLUGAat2DheY jlAWn5xBb7LboEv7888ALv/5/v+uInPkhSvt1z/XZ3RC/iEuJpn9ACgG9yZgYz+Oi6jgUxBqSCUmx aCyq4+1vi7jjqsiV+NLiqIgV4WBYdtKnDD1jgX6hBWsAS/lCde6/J+6WW6RQvJO43a1TKudjCx5Lv cA480jryLVqH5og5d6tTRnTuMIQ/mMRRCUvOHVwbY4zZr+mPiy5PCW5pN7fH3DP5OwZaIlFLgCqCM qw9BeXNQ==; Received: from [2601:1c0:6280:3f0::aa0b] (helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1nUZCC-00EArp-TR; Wed, 16 Mar 2022 19:20:33 +0000 From: Randy Dunlap To: linux-kernel@vger.kernel.org Cc: Randy Dunlap , "Michael S. Tsirkin" , Jason Wang , Paolo Bonzini , Stefan Hajnoczi , Jens Axboe , Amit Shah , Arnd Bergmann , Greg Kroah-Hartman , Eli Cohen , Saeed Mahameed , Leon Romanovsky , Pablo Neira Ayuso , Jozsef Kadlecsik , Florian Westphal , "David S. Miller" , Jakub Kicinski , "James E.J. Bottomley" , "Martin K. Petersen" , Felipe Balbi , =?utf-8?b?TWljaGHFgiBNaXJvc8WC?= =?utf-8?b?YXc=?= , Sebastian Andrzej Siewior , Krzysztof Opasiak , Igor Kotrasinski , Valentina Manea , Shuah Khan , Shuah Khan , Jussi Kivilinna , Joachim Fritschi , Herbert Xu , Thomas Gleixner , Steven Rostedt , Ingo Molnar , Karol Herbst , Pekka Paalanen , Dave Hansen , Andy Lutomirski , Peter Zijlstra , Borislav Petkov , "H. Peter Anvin" , netfilter-devel@vger.kernel.org, coreteam@netfilter.org, netdev@vger.kernel.org, linux-block@vger.kernel.org, linux-crypto@vger.kernel.org, linux-rdma@vger.kernel.org, linux-scsi@vger.kernel.org, linux-usb@vger.kernel.org, nouveau@lists.freedesktop.org, virtualization@lists.linux-foundation.org, x86@kernel.org Subject: [PATCH 9/9] testmmiotrace: eliminate anonymous module_init & module_exit Date: Wed, 16 Mar 2022 12:20:10 -0700 Message-Id: <20220316192010.19001-10-rdunlap@infradead.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220316192010.19001-1-rdunlap@infradead.org> References: <20220316192010.19001-1-rdunlap@infradead.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Eliminate anonymous module_init() and module_exit(), which can lead to confusion or ambiguity when reading System.map, crashes/oops/bugs, or an initcall_debug log. Give each of these init and exit functions unique driver-specific names to eliminate the anonymous names. Example 1: (System.map) ffffffff832fc78c t init ffffffff832fc79e t init ffffffff832fc8f8 t init Example 2: (initcall_debug log) calling init+0x0/0x12 @ 1 initcall init+0x0/0x12 returned 0 after 15 usecs calling init+0x0/0x60 @ 1 initcall init+0x0/0x60 returned 0 after 2 usecs calling init+0x0/0x9a @ 1 initcall init+0x0/0x9a returned 0 after 74 usecs Fixes: 8b7d89d02ef3 ("x86: mmiotrace - trace memory mapped IO") Signed-off-by: Randy Dunlap Cc: Thomas Gleixner Cc: Steven Rostedt Cc: Ingo Molnar Cc: Karol Herbst Cc: Pekka Paalanen Cc: Dave Hansen Cc: Andy Lutomirski Cc: Peter Zijlstra Cc: Borislav Petkov Cc: "H. Peter Anvin" Cc: nouveau@lists.freedesktop.org Cc: x86@kernel.org Acked-by: Steven Rostedt (Google) --- arch/x86/mm/testmmiotrace.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- lnx-517-rc8.orig/arch/x86/mm/testmmiotrace.c +++ lnx-517-rc8/arch/x86/mm/testmmiotrace.c @@ -113,7 +113,7 @@ static void do_test_bulk_ioremapping(voi synchronize_rcu(); } -static int __init init(void) +static int __init testmmiotrace_init(void) { unsigned long size = (read_far) ? (8 << 20) : (16 << 10); int ret = security_locked_down(LOCKDOWN_MMIOTRACE); @@ -136,11 +136,11 @@ static int __init init(void) return 0; } -static void __exit cleanup(void) +static void __exit testmmiotrace_cleanup(void) { pr_debug("unloaded.\n"); } -module_init(init); -module_exit(cleanup); +module_init(testmmiotrace_init); +module_exit(testmmiotrace_cleanup); MODULE_LICENSE("GPL");