[PATCHv8 13/13] init.h: add some more documentation to __ref* tags

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Michal Nazarewicz
Date: Thursday, August 12, 2010 - 8:43 am

The __ref* tags may have been confusing for new kernel
developers (I was confused by them for sure) so adding a few
more sentences to comment to clear things up for people who
see those for the first time.

Signed-off-by: Michal Nazarewicz <m.nazarewicz@samsung.com>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Sam Ravnborg <sam@ravnborg.org>
---
 include/linux/init.h |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/include/linux/init.h b/include/linux/init.h
index de99430..577671c 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -46,16 +46,23 @@
 #define __exitdata	__section(.exit.data)
 #define __exit_call	__used __section(.exitcall.exit)
 
-/* modpost check for section mismatches during the kernel build.
+/*
+ * modpost check for section mismatches during the kernel build.
  * A section mismatch happens when there are references from a
  * code or data section to an init section (both code or data).
  * The init sections are (for most archs) discarded by the kernel
  * when early init has completed so all such references are potential bugs.
  * For exit sections the same issue exists.
+ *
  * The following markers are used for the cases where the reference to
  * the *init / *exit section (code or data) is valid and will teach
- * modpost not to issue a warning.
- * The markers follow same syntax rules as __init / __initdata. */
+ * modpost not to issue a warning.  Intended semantics is that a code or
+ * data tagged __ref* can reference code or data from init section without
+ * producing a warning (of course, no warning does not mean code is
+ * correct, so optimally document why the __ref is needed and why it's OK).
+ *
+ * The markers follow same syntax rules as __init / __initdata.
+ */
 #define __ref            __section(.ref.text) noinline
 #define __refdata        __section(.ref.data)
 #define __refconst       __section(.ref.rodata)
-- 
1.7.1

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCHv8 01/13] USB: gadget: g_multi: fixed vendor and pro ..., Michal Nazarewicz, (Thu Aug 12, 8:43 am)
[PATCHv8 02/13] USB: gadget: g_ffs: fixed vendor and produ ..., Michal Nazarewicz, (Thu Aug 12, 8:43 am)
[PATCHv8 03/13] USB: gadget: composite: Better string over ..., Michal Nazarewicz, (Thu Aug 12, 8:43 am)
[PATCHv8 04/13] USB: gadget: mass_storage: moved strings h ..., Michal Nazarewicz, (Thu Aug 12, 8:43 am)
[PATCHv8 05/13] USB: gadget: functionfs: code cleanup, Michal Nazarewicz, (Thu Aug 12, 8:43 am)
[PATCHv8 06/13] USB: gadget: g_multi: moved strings handli ..., Michal Nazarewicz, (Thu Aug 12, 8:43 am)
[PATCHv8 07/13] usb: gadget: storage: remove nofua file wh ..., Michal Nazarewicz, (Thu Aug 12, 8:43 am)
[PATCHv8 08/13] usb: gadget: mass_storage: optional SCSI W ..., Michal Nazarewicz, (Thu Aug 12, 8:43 am)
[PATCHv8 10/13] usb gadget: don't save bind callback in st ..., Michal Nazarewicz, (Thu Aug 12, 8:43 am)
[PATCHv8 11/13] usb gadget: don't save bind callback in st ..., Michal Nazarewicz, (Thu Aug 12, 8:43 am)
[PATCHv8 12/13] usb gadget: don't save bind callback in st ..., Michal Nazarewicz, (Thu Aug 12, 8:43 am)
[PATCHv8 13/13] init.h: add some more documentation to __r ..., Michal Nazarewicz, (Thu Aug 12, 8:43 am)
Re: [PATCHv8 11/13] usb gadget: don't save bind callback i ..., Uwe Kleine-König, (Thu Aug 12, 8:45 am)
Re: [PATCHv8 03/13] USB: gadget: composite: Better string ..., Michał Nazarewicz, (Wed Sep 1, 5:57 pm)