From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>,
linux-kernel@vger.kernel.org, Sam Ravnborg <sam@ravnborg.org>,
Andrew Morton <akpm@linux-foundation.org>,
Rusty Russell <rusty@rustcorp.com.au>
Subject: Re: [PATCH 31/34] move virtrng_remove to .devexit.text
Date: Thu, 1 Oct 2009 19:41:16 +0200 [thread overview]
Message-ID: <20091001174116.GA27288@pengutronix.de> (raw)
In-Reply-To: <20091001123213.GL5718@redhat.com>
Hello Michael,
> > But note it's not an error in general to use a .text function as remove
> > callback. E.g. take drivers/gpio/twl4030-gpio.c. gpio_twl4030_remove
> > is used in gpio_twl4030_probe which is defined using __devinit. So
> > using __devexit for gpio_twl4030_remove is wrong. (So there is a bug,
> > as gpio_twl4030_remove uses __devexit.) I didn't try, but as far as I
> > understand this will result in a compile error if the driver is built-in
> > with HOTPLUG=n.
>
> Wait a second.
> As far as I understand, __devexit makes it possible to remove code if
> hotplug is off.
right.
> At least for static functions, it's enough to mark their only use
> as _devexit_p, and compiler will remove the text as it's unused.
>
> Isn't that right?
hmm, I don't know. I'll try, one moment. OK, you're right. The
function is discarded with a compiler warning.
> If so, what, again, was the motivation for the patches that added
> __devexit to functions that were already used with __devexit_p?
I thought it saves some memory, but as it looks now it only fixes a
compiler warning.
Note there are two types of errors fixed in this series. One is:
-static int func(void arg)
+static int __devexit func(void arg)
if the only usage of func() is wraped by __devexit_p. This is (as
seen above) not that critical, there is only a warning fixed.
The other type results in a build failure:
-remove = __devexit_p(another_func),
+remove = __exit_p(another_func),
with another_func being defined using __exit. In the case
defined(MODULE) && defined(CONFIG_HOTPLUG) another_func is discarded,
but __devexit_p(another_func) evaluates to another_func and thus the
module doesn't link.
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
next prev parent reply other threads:[~2009-10-01 17:41 UTC|newest]
Thread overview: 65+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-01 8:26 [PATCH 00/35] fix usage of __{,dev}exit_p Uwe Kleine-König
2009-10-01 8:28 ` [PATCH 01/34] move asic3_remove to .devexit.text Uwe Kleine-König
2009-10-01 17:30 ` Samuel Ortiz
2009-10-01 8:28 ` [PATCH 02/34] move atp870u_remove " Uwe Kleine-König
2009-10-01 14:20 ` James Bottomley
2009-10-02 19:13 ` Uwe Kleine-König
2009-10-01 8:28 ` [PATCH 03/34] move bbc_remove " Uwe Kleine-König
2009-10-01 8:28 ` [PATCH 04/34] don't use __devexit_p to wrap excite_nand_remove Uwe Kleine-König
2009-10-01 8:28 ` [PATCH 05/34] move grover_remove to .devexit.text Uwe Kleine-König
2009-10-06 5:05 ` Dmitry Torokhov
2009-10-01 8:28 ` [PATCH 06/34] don't use __devexit_p to wrap hal2_remove Uwe Kleine-König
2009-10-01 8:36 ` Takashi Iwai
2009-10-01 8:53 ` Uwe Kleine-König
2009-10-02 9:02 ` Takashi Iwai
2009-10-02 9:20 ` Uwe Kleine-König
2009-10-02 9:42 ` Takashi Iwai
2009-10-01 8:28 ` [PATCH 07/34] move ilo_remove to .devexit.text Uwe Kleine-König
2009-10-01 14:10 ` Altobelli, David
2009-10-01 17:44 ` Uwe Kleine-König
2009-10-01 17:49 ` Altobelli, David
2009-10-01 8:28 ` [PATCH 08/34] move initio_remove_one " Uwe Kleine-König
2009-10-01 8:28 ` [PATCH 09/34] don't use __devexit_p to wrap iodev_remove Uwe Kleine-König
2009-10-01 8:28 ` [PATCH 10/34] don't use __devexit_p to wrap lasi700_driver_remove Uwe Kleine-König
2009-10-01 8:28 ` [PATCH 11/34] move mcf_remove to .devexit.text Uwe Kleine-König
2009-10-02 0:53 ` Greg Ungerer
2009-10-01 8:28 ` [PATCH 12/34] move megaraid_detach_one " Uwe Kleine-König
2009-10-01 8:28 ` [PATCH 13/34] don't use __devexit_p to wrap meth_remove Uwe Kleine-König
2009-10-01 8:28 ` [PATCH 14/34] don't wrap mlx4_remove_one in __devexit_p Uwe Kleine-König
2009-10-01 8:28 ` [PATCH 15/34] move mpc85xx_pci_err_remove to .devexit.text Uwe Kleine-König
2009-10-01 8:28 ` [PATCH 16/34] move mv64x60_pci_err_remove " Uwe Kleine-König
2009-10-01 8:28 ` [PATCH 17/34] move mxcnd_remove to .exit.text Uwe Kleine-König
2009-10-01 8:28 ` [PATCH 18/34] don't use __devexit_p to wrap NCR_Q720_remove Uwe Kleine-König
2009-10-01 8:28 ` [PATCH 19/34] move s3c_adc_remove to .devexit.text Uwe Kleine-König
2009-10-02 7:20 ` Ben Dooks
2009-10-01 8:28 ` [PATCH 20/34] move s3c_pwm_remove " Uwe Kleine-König
2009-10-01 8:28 ` [PATCH 21/34] wrap sc26xx_driver_remove by __exit_p Uwe Kleine-König
2009-10-01 8:28 ` [PATCH 22/34] don't use __devexit_p to wrap sgiseeq_remove Uwe Kleine-König
2009-10-01 8:28 ` [PATCH 23/34] don't use __devexit_p to wrap sgiwd93_remove Uwe Kleine-König
2009-10-01 8:28 ` [PATCH 24/34] don't use __devexit_p to wrap snd_sgio2audio_remove Uwe Kleine-König
2009-10-01 8:28 ` [PATCH 25/34] don't use __devexit_p to wrap snirm710_driver_remove Uwe Kleine-König
2009-10-01 8:28 ` [PATCH 26/34] move spidev_remove to .devexit.text Uwe Kleine-König
2009-10-01 8:28 ` [PATCH 27/34] move stex_remove " Uwe Kleine-König
2009-10-01 8:28 ` [PATCH 28/34] move vhci_hcd_remove " Uwe Kleine-König
2009-10-01 8:28 ` [PATCH 29/34] move virtballoon_remove " Uwe Kleine-König
2009-10-01 9:35 ` Michael S. Tsirkin
2009-10-01 9:52 ` Uwe Kleine-König
2009-10-01 10:07 ` Michael S. Tsirkin
2009-10-06 9:47 ` Rusty Russell
2009-10-01 8:28 ` [PATCH 30/34] move virtnet_remove " Uwe Kleine-König
2009-10-01 8:28 ` [PATCH 31/34] move virtrng_remove " Uwe Kleine-König
2009-10-01 8:44 ` Christian Borntraeger
2009-10-01 8:48 ` Uwe Kleine-König
2009-10-01 9:12 ` Michael S. Tsirkin
2009-10-01 9:31 ` Uwe Kleine-König
2009-10-01 9:45 ` Michael S. Tsirkin
2009-10-01 10:17 ` Uwe Kleine-König
2009-10-01 12:32 ` Michael S. Tsirkin
2009-10-01 17:41 ` Uwe Kleine-König [this message]
2009-10-01 18:05 ` Michael S. Tsirkin
2009-10-01 18:19 ` Uwe Kleine-König
2009-10-01 8:28 ` [PATCH 32/34] don't use __devexit_p to wrap zalon_remove Uwe Kleine-König
2009-10-01 8:28 ` [PATCH 33/34] move lis3l02dq_remove to .devexit.text Uwe Kleine-König
2009-10-01 9:38 ` Jonathan Cameron
2009-10-01 8:28 ` [PATCH 34/34] move sca3000_remove " Uwe Kleine-König
2009-10-01 9:39 ` Jonathan Cameron
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20091001174116.GA27288@pengutronix.de \
--to=u.kleine-koenig@pengutronix.de \
--cc=akpm@linux-foundation.org \
--cc=borntraeger@de.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mst@redhat.com \
--cc=rusty@rustcorp.com.au \
--cc=sam@ravnborg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome