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 DA67FC433FE for ; Sun, 20 Mar 2022 12:04:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244997AbiCTMFn (ORCPT ); Sun, 20 Mar 2022 08:05:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36752 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244991AbiCTMFi (ORCPT ); Sun, 20 Mar 2022 08:05:38 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3D85237013 for ; Sun, 20 Mar 2022 05:04:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1647777854; 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=9OfrrvJ+JSNxjBs8qAJPKPxz/pmLtZ2ITjpHEArPw5E=; b=RNM2hDPx/BuydcEGMaDPuIaI2BD33giuOYfEV6AIYnkPJcwIUzDFtdoLqcM196GMiiYXie fsR6ecLotW6stPnE40yLWRCsxB7cM4329NQ3ELfBZ8aegmWwpK/MHPjtLxIoZyzQfrKLEv OVS4dIDn/qxWT1EUxoErDFf8VqEPKc0= Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-496-hGdIMVx_MqGOXoFp0WkDFQ-1; Sun, 20 Mar 2022 08:04:12 -0400 X-MC-Unique: hGdIMVx_MqGOXoFp0WkDFQ-1 Received: by mail-ed1-f70.google.com with SMTP id bq19-20020a056402215300b0040f276105a4so7385124edb.2 for ; Sun, 20 Mar 2022 05:04:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=9OfrrvJ+JSNxjBs8qAJPKPxz/pmLtZ2ITjpHEArPw5E=; b=EVSkJ+7xpFRxhLGR4yY1wdT2BjEmBzC1w8qfmbr0PuR/a3PBTZYtZPxGM7xbeivoy9 G9YNjVRVg4yJsXopy34a/Z+asoTvi85Nkx/JYW1NOLLki6gNXzWlCx2s/LEvj9fxk9PN 9CDHaSzZxoABfYdmXBXmx0RsSBF14NgcQcqoJG+k3cpgLEn6Cu64JRrAbpmcAJJN5LuS KXFRzv6/2wzRuk1+9Zb2QZlD6ODHsBqUxj9LmLwH8LXAR8cBBlcIG2pbh6Qo/muEpNPd 7xQakQRn3J4J2q1rZhXrDyqWyqSwK9DAGliCJkw0PJAT+a+ZcNXIlT2vzwLEreuaIpCD QEyg== X-Gm-Message-State: AOAM53115tPTABH2trjp1kPO0xUoYALUitYnyqc1a2RQAnh5HQ13pPX3 KF67CX2IadzkDJxcJeyj4zLBxxZyPbaonvwltOHBOVcz8sBnCtZv9NSf99T5lfnaah9qY/F/FHe KT+d6tS3yU/dQzwSmiDKSE7do X-Received: by 2002:a17:907:7e88:b0:6db:ad88:2294 with SMTP id qb8-20020a1709077e8800b006dbad882294mr16017825ejc.371.1647777851541; Sun, 20 Mar 2022 05:04:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJybuaY3RTwLFhNmn8ph3qfEMlXOeFvtOmTr+FUYne4h/XgSMGx9RwM3ZmeWDHdWHYLvNIiqSA== X-Received: by 2002:a17:907:7e88:b0:6db:ad88:2294 with SMTP id qb8-20020a1709077e8800b006dbad882294mr16017754ejc.371.1647777851178; Sun, 20 Mar 2022 05:04:11 -0700 (PDT) Received: from redhat.com ([2.55.132.0]) by smtp.gmail.com with ESMTPSA id hb6-20020a170907160600b006dff6a979fdsm856220ejc.51.2022.03.20.05.04.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Mar 2022 05:04:10 -0700 (PDT) Date: Sun, 20 Mar 2022 08:04:00 -0400 From: "Michael S. Tsirkin" To: Randy Dunlap Cc: linux-kernel@vger.kernel.org, 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?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@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: Re: [PATCH 1/9] virtio_blk: eliminate anonymous module_init & module_exit Message-ID: <20220320080242-mutt-send-email-mst@kernel.org> References: <20220316192010.19001-1-rdunlap@infradead.org> <20220316192010.19001-2-rdunlap@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220316192010.19001-2-rdunlap@infradead.org> Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Wed, Mar 16, 2022 at 12:20:02PM -0700, 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 If this is done tree-wide, it's ok to do it for virtio too. Acked-by: Michael S. Tsirkin No real opinion on whether it's a good idea. > --- > 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 smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (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 EDB8CC433F5 for ; Sun, 20 Mar 2022 12:04:23 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 955DB60BDC; Sun, 20 Mar 2022 12:04:23 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pNu140JTfs1N; Sun, 20 Mar 2022 12:04:22 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp3.osuosl.org (Postfix) with ESMTPS id 05DB560BB5; Sun, 20 Mar 2022 12:04:22 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id CE0E9C0012; Sun, 20 Mar 2022 12:04:21 +0000 (UTC) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 6DCA8C000B for ; Sun, 20 Mar 2022 12:04:20 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 5C7DC408F6 for ; Sun, 20 Mar 2022 12:04:20 +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 6don2Emh7_pS for ; Sun, 20 Mar 2022 12:04:19 +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 89E03408D6 for ; Sun, 20 Mar 2022 12:04:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1647777858; 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=9OfrrvJ+JSNxjBs8qAJPKPxz/pmLtZ2ITjpHEArPw5E=; b=S0IMRgP6LqUlRA5H6VItXrGXWcUHQhnYlJ0hpYsAJSg4UhXTlylZuBjwh5DjB3q74/yzX2 5dNb7aCPUqUnG1BqpqpYu5+jDfLv4dR3ilUlIq7RROVERypJfzhR+acJ9r3xELPRaN+SmV DiSwuj03cMcOwd0zQI+b7G+pLJvPong= Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-13-vrfiWLeIOQaICoEUjURMWg-1; Sun, 20 Mar 2022 08:04:12 -0400 X-MC-Unique: vrfiWLeIOQaICoEUjURMWg-1 Received: by mail-ej1-f70.google.com with SMTP id 13-20020a170906328d00b006982d0888a4so5909205ejw.9 for ; Sun, 20 Mar 2022 05:04:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=9OfrrvJ+JSNxjBs8qAJPKPxz/pmLtZ2ITjpHEArPw5E=; b=yNxknaJR0lKbnS8A4FZ0NOYM8Zg8fs9oRKIbJM+LNJAKEnaZbsWcOeJEaA/2cZLXoS d6l3Uzi8YBXjDAYI3AS4cnwEDFYxvNy/S237dWpaorXGLgEs8pPJCS5RwWJAyWRfMSuc 7EbZxNJ+7fstbexorFR6UIBxiWcbJ+YSOYOUZJgJ6zLL8/E0uabHtoyTMMqHG2sUegP2 DZt2zfhvEFjVKSBfR8EMODNc504n/aeAFal5lSrLIQm6dV8vmcChbusgmr95L/71IdxG f8MIFoDm1hP/g3HKJ1AiNH1koPRo693ER8sEfn94kBgktWV+BicqK7wG5XDoWQ8GW35u lLiw== X-Gm-Message-State: AOAM532W2H1neb51mvNynavyfjVaIJ/zN68V0c8Pm8xH7pFLIgJnM9lB cLX/Vg5btUhWjF9pwXLbDLx7VQGhiI8oOwcDvZsaDaZ6qkOBs7N8zyZpgo+u3tqh4tedUCp/psY A36aOpJINav6loWCKtnAzmvd1IVcubN2FPN34NDE1Bg== X-Received: by 2002:a17:907:7e88:b0:6db:ad88:2294 with SMTP id qb8-20020a1709077e8800b006dbad882294mr16017785ejc.371.1647777851440; Sun, 20 Mar 2022 05:04:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJybuaY3RTwLFhNmn8ph3qfEMlXOeFvtOmTr+FUYne4h/XgSMGx9RwM3ZmeWDHdWHYLvNIiqSA== X-Received: by 2002:a17:907:7e88:b0:6db:ad88:2294 with SMTP id qb8-20020a1709077e8800b006dbad882294mr16017754ejc.371.1647777851178; Sun, 20 Mar 2022 05:04:11 -0700 (PDT) Received: from redhat.com ([2.55.132.0]) by smtp.gmail.com with ESMTPSA id hb6-20020a170907160600b006dff6a979fdsm856220ejc.51.2022.03.20.05.04.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Mar 2022 05:04:10 -0700 (PDT) Date: Sun, 20 Mar 2022 08:04:00 -0400 From: "Michael S. Tsirkin" To: Randy Dunlap Subject: Re: [PATCH 1/9] virtio_blk: eliminate anonymous module_init & module_exit Message-ID: <20220320080242-mutt-send-email-mst@kernel.org> References: <20220316192010.19001-1-rdunlap@infradead.org> <20220316192010.19001-2-rdunlap@infradead.org> MIME-Version: 1.0 In-Reply-To: <20220316192010.19001-2-rdunlap@infradead.org> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mst@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline Cc: x86@kernel.org, Andy Lutomirski , Peter Zijlstra , nouveau@lists.freedesktop.org, Dave Hansen , Valentina Manea , Karol Herbst , Krzysztof Opasiak , Eli Cohen , netdev@vger.kernel.org, Shuah Khan , Thomas Gleixner , "H. Peter Anvin" , Arnd Bergmann , Leon Romanovsky , linux-rdma@vger.kernel.org, Ingo Molnar , Jozsef Kadlecsik , coreteam@netfilter.org, Jakub Kicinski , Sebastian Andrzej Siewior , 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@lists.linux-foundation.org, Herbert Xu , Jens Axboe , linux-scsi@vger.kernel.org, "Martin K. Petersen" , Greg Kroah-Hartman , linux-usb@vger.kernel.org, Florian Westphal , linux-kernel@vger.kernel.org, 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 Wed, Mar 16, 2022 at 12:20:02PM -0700, 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 If this is done tree-wide, it's ok to do it for virtio too. Acked-by: Michael S. Tsirkin No real opinion on whether it's a good idea. > --- > 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 41007C433F5 for ; Sun, 27 Mar 2022 07:44:28 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 123C610E1A4; Sun, 27 Mar 2022 07:44:06 +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 9B05988735 for ; Sun, 20 Mar 2022 12:04:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1647777854; 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=9OfrrvJ+JSNxjBs8qAJPKPxz/pmLtZ2ITjpHEArPw5E=; b=RNM2hDPx/BuydcEGMaDPuIaI2BD33giuOYfEV6AIYnkPJcwIUzDFtdoLqcM196GMiiYXie fsR6ecLotW6stPnE40yLWRCsxB7cM4329NQ3ELfBZ8aegmWwpK/MHPjtLxIoZyzQfrKLEv OVS4dIDn/qxWT1EUxoErDFf8VqEPKc0= Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-483-w3eYX4zDNIGrwpecmJf0Jw-1; Sun, 20 Mar 2022 08:04:12 -0400 X-MC-Unique: w3eYX4zDNIGrwpecmJf0Jw-1 Received: by mail-ej1-f70.google.com with SMTP id hr26-20020a1709073f9a00b006d6d1ee8cf8so5894164ejc.19 for ; Sun, 20 Mar 2022 05:04:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=9OfrrvJ+JSNxjBs8qAJPKPxz/pmLtZ2ITjpHEArPw5E=; b=cWorCU1gKiE4iGJaszih4bwMbmeRrPaLhw4sQBtrWwtbPvKGDZz1yyOcy8k2mRKBFv jdMcAogTh4DJuBWxl6NctSG7eEXmk3PSCuBvv1FA5t/kf+oGXQylH2B45wQS+gx9pb60 X72oC4TRoOsbVgxfzNQzOX0SwYpeofo+09Pph2tKn2WPkrb5EOVKkhJHiINQUHjnsy/j MSe7VxifW+IGO8EXT4eESPNEuTNQErahqYzj6lmWV9+8LqbAqMFK1G5ALh1ug4qqUKbX pUftQ+/iIZ4AShoH5S7fpRAp7cfQtCQtDxVh+GzlMDq3PqtmvF3ix+clYmHLQtjnI1lW T7tQ== X-Gm-Message-State: AOAM533hiC4AAcmjAu6VvtekUin1ANkE33bFYDCSohRP+Z9V7+1hvdjT nV86NKTc0eJCI1jvkQjjozf4xEGRu0mSjI4y98WBddMbien4A3kd2rU8cHrQ+3lG+R8HZSMQPSJ Y0S1HS3Ga5hskwbPvPgdjyAGYVQ== X-Received: by 2002:a17:907:7e88:b0:6db:ad88:2294 with SMTP id qb8-20020a1709077e8800b006dbad882294mr16017783ejc.371.1647777851459; Sun, 20 Mar 2022 05:04:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJybuaY3RTwLFhNmn8ph3qfEMlXOeFvtOmTr+FUYne4h/XgSMGx9RwM3ZmeWDHdWHYLvNIiqSA== X-Received: by 2002:a17:907:7e88:b0:6db:ad88:2294 with SMTP id qb8-20020a1709077e8800b006dbad882294mr16017754ejc.371.1647777851178; Sun, 20 Mar 2022 05:04:11 -0700 (PDT) Received: from redhat.com ([2.55.132.0]) by smtp.gmail.com with ESMTPSA id hb6-20020a170907160600b006dff6a979fdsm856220ejc.51.2022.03.20.05.04.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Mar 2022 05:04:10 -0700 (PDT) Date: Sun, 20 Mar 2022 08:04:00 -0400 From: "Michael S. Tsirkin" To: Randy Dunlap Message-ID: <20220320080242-mutt-send-email-mst@kernel.org> References: <20220316192010.19001-1-rdunlap@infradead.org> <20220316192010.19001-2-rdunlap@infradead.org> MIME-Version: 1.0 In-Reply-To: <20220316192010.19001-2-rdunlap@infradead.org> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mst@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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: x86@kernel.org, Andy Lutomirski , Peter Zijlstra , nouveau@lists.freedesktop.org, Jason Wang , Dave Hansen , Valentina Manea , Krzysztof Opasiak , Eli Cohen , netdev@vger.kernel.org, Shuah Khan , Thomas Gleixner , "H. Peter Anvin" , Arnd Bergmann , Leon Romanovsky , linux-rdma@vger.kernel.org, Ingo Molnar , Jozsef Kadlecsik , coreteam@netfilter.org, Jakub Kicinski , Sebastian Andrzej Siewior , 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@lists.linux-foundation.org, Herbert Xu , Jens Axboe , linux-scsi@vger.kernel.org, "Martin K. Petersen" , Greg Kroah-Hartman , linux-usb@vger.kernel.org, Florian Westphal , linux-kernel@vger.kernel.org, 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 Wed, Mar 16, 2022 at 12:20:02PM -0700, 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 If this is done tree-wide, it's ok to do it for virtio too. Acked-by: Michael S. Tsirkin No real opinion on whether it's a good idea. > --- > 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");