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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 83BEEC433F5 for ; Thu, 17 Mar 2022 03:26:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230189AbiCQD2E (ORCPT ); Wed, 16 Mar 2022 23:28:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46148 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233103AbiCQD14 (ORCPT ); Wed, 16 Mar 2022 23:27:56 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 83070344C0 for ; Wed, 16 Mar 2022 20:26:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1647487599; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=VdUR6nzOC/8O0v+PINEYQA8hLCMnHSUIAPMWwkW08rs=; b=Wyfm3m60PtMDs9J980olZsBlkeVIRdwuebiXZVqR/xCw2kGY60wv6+aE80qaAaiMFwEGDM 7YRqS4nHgBrBPJ+pBHMKwcrRNiUoG52KtSnMdK0lsMRTr0fNEcoYGSXhHXgyBofffJUzFa tIGbVspPUaqcrKVF86iqziLojiuccKA= Received: from mail-lf1-f71.google.com (mail-lf1-f71.google.com [209.85.167.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-157-KbmQmiozOc-iWy4AqivSqQ-1; Wed, 16 Mar 2022 23:26:38 -0400 X-MC-Unique: KbmQmiozOc-iWy4AqivSqQ-1 Received: by mail-lf1-f71.google.com with SMTP id x23-20020ac25dd7000000b004492a3f2ecdso738330lfq.12 for ; Wed, 16 Mar 2022 20:26:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=VdUR6nzOC/8O0v+PINEYQA8hLCMnHSUIAPMWwkW08rs=; b=J2renV5tyLZbeT2nja15n6KwBoumkc07vg4cWg4NpbC27OQeR49xxPnL1jHMhtdG9f jpgon9eFrdxfta9B9v6jtfzYlRx2WXzVXX1E8vuc28lDmzTR5EaKLnLJmlZOc5g9zCAS BeUBrg1dOEaCgJWGUoHEllBaV+WKi1Bio/h//hFGgkO1rsb0ICqQIUXxbL94vR7uzC0R 9+Ov2pdtJr2Jtn3/tB1m0vLn6u83AQ2xVK7OqyQI7yq931In+ui+ak/4vOPAyjtks/Yp wnG5kw0QngyZ8A6x9FYzJQKBiMiWFvEFkjhLI3E4KiwFrxe5qCNyenmc/ZN3JzGyV+Dj xEbg== X-Gm-Message-State: AOAM533G38bW6ca/m2iElpCB2M+gRTpT7aWlfTTDmFJ5Gm68tBGvk7RM VXBVjo4rkvZ7kXxsHUSQXKplDG+VwVLa0EoH3Aei8gOoUFRDtJHW88vBpjx8tZcukm19szUBypp D+bGSsIwVKLfzlcrNIqIbBFAXPz5tykrjFxWWk+Xb X-Received: by 2002:a2e:a490:0:b0:248:8f0:e4ee with SMTP id h16-20020a2ea490000000b0024808f0e4eemr1585875lji.97.1647487596333; Wed, 16 Mar 2022 20:26:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxodJS4+oPuUw6/FJlLdS1DOlRDugHlSvT6drTv1PuTs0XvDj5DTLTyLGxZOhq4kq4IHrWqpfNVV0chS1q08S4= X-Received: by 2002:a2e:a490:0:b0:248:8f0:e4ee with SMTP id h16-20020a2ea490000000b0024808f0e4eemr1585821lji.97.1647487596075; Wed, 16 Mar 2022 20:26:36 -0700 (PDT) MIME-Version: 1.0 References: <20220316192010.19001-1-rdunlap@infradead.org> <20220316192010.19001-2-rdunlap@infradead.org> In-Reply-To: <20220316192010.19001-2-rdunlap@infradead.org> From: Jason Wang Date: Thu, 17 Mar 2022 11:26:24 +0800 Message-ID: Subject: Re: [PATCH 1/9] virtio_blk: eliminate anonymous module_init & module_exit To: Randy Dunlap Cc: linux-kernel , "Michael S. Tsirkin" , 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?TWljaGHFgiBNaXJvc8WCYXc=?= , 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 , linux-block@vger.kernel.org, linux-crypto@vger.kernel.org, RDMA mailing list , linux-scsi@vger.kernel.org, linux-usb@vger.kernel.org, nouveau@lists.freedesktop.org, virtualization , "the arch/x86 maintainers" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Thu, Mar 17, 2022 at 3:25 AM Randy Dunlap wrote: > > 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 > 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 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 smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 91A33C433EF for ; Thu, 17 Mar 2022 03:26:44 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 35AA940AF8; Thu, 17 Mar 2022 03:26:44 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Th4KcTEsTgcD; Thu, 17 Mar 2022 03:26:43 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp2.osuosl.org (Postfix) with ESMTPS id 993C340AEE; Thu, 17 Mar 2022 03:26:42 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 7F8CCC0012; Thu, 17 Mar 2022 03:26:42 +0000 (UTC) Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 497E5C000B for ; Thu, 17 Mar 2022 03:26:41 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 37F144179F for ; Thu, 17 Mar 2022 03:26:41 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp4.osuosl.org (amavisd-new); dkim=pass (1024-bit key) header.d=redhat.com Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 88C6AYucxZjg for ; Thu, 17 Mar 2022 03:26:40 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by smtp4.osuosl.org (Postfix) with ESMTPS id 636824179A for ; Thu, 17 Mar 2022 03:26:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1647487599; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=VdUR6nzOC/8O0v+PINEYQA8hLCMnHSUIAPMWwkW08rs=; b=Wyfm3m60PtMDs9J980olZsBlkeVIRdwuebiXZVqR/xCw2kGY60wv6+aE80qaAaiMFwEGDM 7YRqS4nHgBrBPJ+pBHMKwcrRNiUoG52KtSnMdK0lsMRTr0fNEcoYGSXhHXgyBofffJUzFa tIGbVspPUaqcrKVF86iqziLojiuccKA= Received: from mail-lj1-f198.google.com (mail-lj1-f198.google.com [209.85.208.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-451-PxnU4jONOlSu3nBoCBt9LA-1; Wed, 16 Mar 2022 23:26:37 -0400 X-MC-Unique: PxnU4jONOlSu3nBoCBt9LA-1 Received: by mail-lj1-f198.google.com with SMTP id 20-20020a2e0914000000b0024635d136ddso1596761ljj.22 for ; Wed, 16 Mar 2022 20:26:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=VdUR6nzOC/8O0v+PINEYQA8hLCMnHSUIAPMWwkW08rs=; b=UX3P2fVrEa20pLQ9Yr3ZXdug/Oe879L/cObyXuoIlY5v7iccyHpatxXYSAgz+aHVPI HAW6nmdgLCegKZHsXjDOaHTn0F9vgqRMDWzFN1zV44SKcaZEsxKFgj0B2JifoLwVa1ke 2Y/C3rl5r/8XQyuidOPwE5FTQ8miCc7qO3EZ42YrT575+uMfQ0A+vQSDUWInsGQOq7/m Qo130XPH1WhwxvskCgkcZHgdCs77OZU5MyoD39IBQce3ov99pCQyIl3253PnhpVFQKmz nX0Zlu7pwF03GmdoOR+0tU3qEcwEwE83kfh6ctz+uQl4r7KGVPH3B4/74QvinzDPWKz8 rDew== X-Gm-Message-State: AOAM5339VDuVUS1z3hJIZk/CBBtEZohXQ7XesH16h0m5RaLesA7eIH0d 3PV4otxWdpl7kDpJQWZLCv8eYCa9eOZI9RrFYeHZoXrFvXi2Ny5mXYQHKEgoXq9eNauBE4cDGiZ +ozYSO2nDmLP1+7HzzcwlJp2N8mzNoyLFxA/M4eZMqHu9HqkNzOsOPYwcrg== X-Received: by 2002:a2e:a490:0:b0:248:8f0:e4ee with SMTP id h16-20020a2ea490000000b0024808f0e4eemr1585848lji.97.1647487596267; Wed, 16 Mar 2022 20:26:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxodJS4+oPuUw6/FJlLdS1DOlRDugHlSvT6drTv1PuTs0XvDj5DTLTyLGxZOhq4kq4IHrWqpfNVV0chS1q08S4= X-Received: by 2002:a2e:a490:0:b0:248:8f0:e4ee with SMTP id h16-20020a2ea490000000b0024808f0e4eemr1585821lji.97.1647487596075; Wed, 16 Mar 2022 20:26:36 -0700 (PDT) MIME-Version: 1.0 References: <20220316192010.19001-1-rdunlap@infradead.org> <20220316192010.19001-2-rdunlap@infradead.org> In-Reply-To: <20220316192010.19001-2-rdunlap@infradead.org> From: Jason Wang Date: Thu, 17 Mar 2022 11:26:24 +0800 Message-ID: Subject: Re: [PATCH 1/9] virtio_blk: eliminate anonymous module_init & module_exit To: Randy Dunlap Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jasowang@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Cc: the arch/x86 maintainers , Andy Lutomirski , "Michael S. Tsirkin" , Peter Zijlstra , nouveau@lists.freedesktop.org, Sebastian Andrzej Siewior , Dave Hansen , Valentina Manea , Karol Herbst , Krzysztof Opasiak , Eli Cohen , netdev , Shuah Khan , Thomas Gleixner , "H. Peter Anvin" , Arnd Bergmann , Leon Romanovsky , RDMA mailing list , Ingo Molnar , Jozsef Kadlecsik , coreteam@netfilter.org, Jakub Kicinski , Pablo Neira Ayuso , Joachim Fritschi , Felipe Balbi , Amit Shah , "James E.J. Bottomley" , Steven Rostedt , =?UTF-8?B?TWljaGHFgiBNaXJvc8WCYXc=?= , linux-block@vger.kernel.org, Pekka Paalanen , Borislav Petkov , Stefan Hajnoczi , Shuah Khan , Jussi Kivilinna , virtualization , Herbert Xu , Jens Axboe , linux-scsi@vger.kernel.org, "Martin K. Petersen" , Greg Kroah-Hartman , linux-usb@vger.kernel.org, Florian Westphal , linux-kernel , netfilter-devel@vger.kernel.org, linux-crypto@vger.kernel.org, Igor Kotrasinski , Paolo Bonzini , Saeed Mahameed , "David S. Miller" X-BeenThere: virtualization@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux virtualization List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: virtualization-bounces@lists.linux-foundation.org Sender: "Virtualization" On Thu, Mar 17, 2022 at 3:25 AM Randy Dunlap wrote: > > 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 > 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"); > _______________________________________________ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2BD80C433EF for ; Sun, 27 Mar 2022 07:44:42 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 210F489262; Sun, 27 Mar 2022 07:44:22 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by gabe.freedesktop.org (Postfix) with ESMTPS id 032EB10EADF for ; Thu, 17 Mar 2022 03:26:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1647487599; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=VdUR6nzOC/8O0v+PINEYQA8hLCMnHSUIAPMWwkW08rs=; b=Wyfm3m60PtMDs9J980olZsBlkeVIRdwuebiXZVqR/xCw2kGY60wv6+aE80qaAaiMFwEGDM 7YRqS4nHgBrBPJ+pBHMKwcrRNiUoG52KtSnMdK0lsMRTr0fNEcoYGSXhHXgyBofffJUzFa tIGbVspPUaqcrKVF86iqziLojiuccKA= Received: from mail-lf1-f70.google.com (mail-lf1-f70.google.com [209.85.167.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-73-wDty7bpHMN-x23g10kjzFA-1; Wed, 16 Mar 2022 23:26:37 -0400 X-MC-Unique: wDty7bpHMN-x23g10kjzFA-1 Received: by mail-lf1-f70.google.com with SMTP id bp30-20020a056512159e00b004484bd7ffe9so1339670lfb.5 for ; Wed, 16 Mar 2022 20:26:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=VdUR6nzOC/8O0v+PINEYQA8hLCMnHSUIAPMWwkW08rs=; b=1qw7TwUefd2km3cPxS9pN6QqKWTeXHwtuL03Aepy7PQz26+r8sDXYqtlxpumSHvO// K11Zs0HBlmu9mUAZE3UUM+aI550Ty2hbzbw7mUfNGXMPd6kFbhxuW3+w6UrRneO+5U2x x0gj68WzZI3Q2tp/pck9HPgreWzSR/KlwWtSH9KUTOzJGB+eq8r7AOy4OVv6lU/17yUH MD2qaVTQdbbc1hYUHIhUCfknFZufQIs3b2+SqCx1J41e9hiZlNMeLG5dBqoEURAHT+Nv vDi1w1Ux8L0hpABJRocUtXnR6MN/PBECFClfrBI+1CUUibicwteaaw5hNHz9BT3tlxFh 6xuA== X-Gm-Message-State: AOAM5337/YjG3HW7v9DHVTTcI2ArWMRgmUUrjUWNmJQ7oTbm0RVB577e gR+BtYvc4/gj24DnZVPrC0APffjCf7d7Z+nkDEkD08UrhHsbX8tF9DpNnsRJdmvBtaWudlPimIw eFIW3FTTlx/yzSIUfla4Bn+Wo7HiQ+igpTFB2/lxKjw== X-Received: by 2002:a2e:a490:0:b0:248:8f0:e4ee with SMTP id h16-20020a2ea490000000b0024808f0e4eemr1585835lji.97.1647487596266; Wed, 16 Mar 2022 20:26:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxodJS4+oPuUw6/FJlLdS1DOlRDugHlSvT6drTv1PuTs0XvDj5DTLTyLGxZOhq4kq4IHrWqpfNVV0chS1q08S4= X-Received: by 2002:a2e:a490:0:b0:248:8f0:e4ee with SMTP id h16-20020a2ea490000000b0024808f0e4eemr1585821lji.97.1647487596075; Wed, 16 Mar 2022 20:26:36 -0700 (PDT) MIME-Version: 1.0 References: <20220316192010.19001-1-rdunlap@infradead.org> <20220316192010.19001-2-rdunlap@infradead.org> In-Reply-To: <20220316192010.19001-2-rdunlap@infradead.org> From: Jason Wang Date: Thu, 17 Mar 2022 11:26:24 +0800 Message-ID: To: Randy Dunlap Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jasowang@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" X-Mailman-Approved-At: Sun, 27 Mar 2022 07:44:03 +0000 Subject: Re: [Nouveau] [PATCH 1/9] virtio_blk: eliminate anonymous module_init & module_exit X-BeenThere: nouveau@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Nouveau development list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: the arch/x86 maintainers , Andy Lutomirski , "Michael S. Tsirkin" , Peter Zijlstra , nouveau@lists.freedesktop.org, Sebastian Andrzej Siewior , Dave Hansen , Valentina Manea , Krzysztof Opasiak , Eli Cohen , netdev , Shuah Khan , Thomas Gleixner , "H. Peter Anvin" , Arnd Bergmann , Leon Romanovsky , RDMA mailing list , Ingo Molnar , Jozsef Kadlecsik , coreteam@netfilter.org, Jakub Kicinski , Pablo Neira Ayuso , Joachim Fritschi , Felipe Balbi , Amit Shah , "James E.J. Bottomley" , Steven Rostedt , =?UTF-8?B?TWljaGHFgiBNaXJvc8WCYXc=?= , linux-block@vger.kernel.org, Pekka Paalanen , Borislav Petkov , Stefan Hajnoczi , Shuah Khan , Jussi Kivilinna , virtualization , Herbert Xu , Jens Axboe , linux-scsi@vger.kernel.org, "Martin K. Petersen" , Greg Kroah-Hartman , linux-usb@vger.kernel.org, Florian Westphal , linux-kernel , netfilter-devel@vger.kernel.org, linux-crypto@vger.kernel.org, Igor Kotrasinski , Paolo Bonzini , Saeed Mahameed , "David S. Miller" Errors-To: nouveau-bounces@lists.freedesktop.org Sender: "Nouveau" On Thu, Mar 17, 2022 at 3:25 AM Randy Dunlap wrote: > > 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 > 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"); >