Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1316573

[PATCH 3.12 15/39] module: remove MODULE_GENERIC_TABLE

From Jiri Slaby <jslaby@suse.cz>
Newsgroups linux.kernel
Subject [PATCH 3.12 15/39] module: remove MODULE_GENERIC_TABLE
Date 2016-01-25 13:00 +0100
Message-ID <qUNYo-3kJ-55@gated-at.bofh.it> (permalink)
References <qUNYl-3kJ-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Rusty Russell <rusty@rustcorp.com.au>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit cff26a51da5d206d3baf871e75778da44710219d upstream.

MODULE_DEVICE_TABLE() calles MODULE_GENERIC_TABLE(); make it do the
work directly.  This also removes a wart introduced in the last patch,
where the alias is defined to be an unknown struct type "struct
type##__##name##_device_id" instead of "struct type##_device_id" (it's
an extern so GCC doesn't care, but it's wrong).

The other user of MODULE_GENERIC_TABLE (ISAPNP_CARD_TABLE) is unused,
so delete it.

Bryan: gcc v3.3.2 cares

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Cc: Bryan Kadzban <bryan@kadzban.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 include/linux/isapnp.h |  4 ----
 include/linux/module.h | 19 ++++++++-----------
 2 files changed, 8 insertions(+), 15 deletions(-)

diff --git a/include/linux/isapnp.h b/include/linux/isapnp.h
index e2d28b026a8c..3c77bf9b1efd 100644
--- a/include/linux/isapnp.h
+++ b/include/linux/isapnp.h
@@ -56,10 +56,6 @@
 #define ISAPNP_DEVICE_ID(_va, _vb, _vc, _function) \
 		{ .vendor = ISAPNP_VENDOR(_va, _vb, _vc), .function = ISAPNP_FUNCTION(_function) }
 
-/* export used IDs outside module */
-#define ISAPNP_CARD_TABLE(name) \
-		MODULE_GENERIC_TABLE(isapnp_card, name)
-
 struct isapnp_card_id {
 	unsigned long driver_data;	/* data private to the driver */
 	unsigned short card_vendor, card_device;
diff --git a/include/linux/module.h b/include/linux/module.h
index 54aef1b38463..73c8c06c25bf 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -83,15 +83,6 @@ void sort_extable(struct exception_table_entry *start,
 void sort_main_extable(void);
 void trim_init_extable(struct module *m);
 
-#ifdef MODULE
-#define MODULE_GENERIC_TABLE(gtype,name)			\
-extern const struct gtype##_id __mod_##gtype##_table		\
-  __attribute__ ((unused, alias(__stringify(name))))
-
-#else  /* !MODULE */
-#define MODULE_GENERIC_TABLE(gtype,name)
-#endif
-
 /* Generic info of form tag = "info" */
 #define MODULE_INFO(tag, info) __MODULE_INFO(tag, tag, info)
 
@@ -142,8 +133,14 @@ extern const struct gtype##_id __mod_##gtype##_table		\
 /* What your module does. */
 #define MODULE_DESCRIPTION(_description) MODULE_INFO(description, _description)
 
-#define MODULE_DEVICE_TABLE(type,name)		\
-  MODULE_GENERIC_TABLE(type##__##name##_device, name)
+#ifdef MODULE
+/* Creates an alias so file2alias.c can find device table. */
+#define MODULE_DEVICE_TABLE(type, name)					\
+  extern const struct type##_device_id __mod_##type##__##name##_device_table \
+  __attribute__ ((unused, alias(__stringify(name))))
+#else  /* !MODULE */
+#define MODULE_DEVICE_TABLE(type, name)
+#endif
 
 /* Version of form [<epoch>:]<version>[-<extra-version>].
    Or for CVS/RCS ID version, everything but the number is stripped.
-- 
2.7.0

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 3.12 01/39] efi: Disable interrupts around EFI calls, not in the epilog/prolog calls Jiri Slaby <jslaby@suse.cz> - 2016-01-25 13:00 +0100
  [PATCH 3.12 02/39] tools: Add a "make all" rule Jiri Slaby <jslaby@suse.cz> - 2016-01-25 13:00 +0100
  [PATCH 3.12 26/39] udp: properly support MSG_PEEK with truncated buffers Jiri Slaby <jslaby@suse.cz> - 2016-01-25 13:00 +0100
  [PATCH 3.12 24/39] KEYS: Fix race between read and revoke Jiri Slaby <jslaby@suse.cz> - 2016-01-25 13:00 +0100
  [PATCH 3.12 22/39] sctp: Prevent soft lockup when sctp_accept() is called during a timeout event Jiri Slaby <jslaby@suse.cz> - 2016-01-25 13:00 +0100
  [PATCH 3.12 28/39] xen/gntdev: Grant maps should not be subject to NUMA balancing Jiri Slaby <jslaby@suse.cz> - 2016-01-25 13:00 +0100
  [PATCH 3.12 36/39] MAINTAINERS: Add public mailing list for ARC Jiri Slaby <jslaby@suse.cz> - 2016-01-25 13:00 +0100
  [PATCH 3.12 27/39] x86/signal: Fix restart_syscall number for x32 tasks Jiri Slaby <jslaby@suse.cz> - 2016-01-25 13:00 +0100
  [PATCH 3.12 16/39] staging/dgnc: fix info leak in ioctl Jiri Slaby <jslaby@suse.cz> - 2016-01-25 13:00 +0100
  [PATCH 3.12 37/39] ARC: Fix silly typo in MAINTAINERS file commit 30b9dbee895ff0d5cbf155bd1ef3f0f5992bca6f upstream. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Jiri Slaby <jslaby@suse.cz> - 2016-01-25 13:00 +0100
  [PATCH 3.12 25/39] KEYS: Fix keyring ref leak in join_session_keyring() Jiri Slaby <jslaby@suse.cz> - 2016-01-25 13:00 +0100
  [PATCH 3.12 32/39] x86/boot: Double BOOT_HEAP_SIZE to 64KB Jiri Slaby <jslaby@suse.cz> - 2016-01-25 13:00 +0100
  [PATCH 3.12 38/39] isdn_ppp: Add checks for allocation failure in isdn_ppp_open() Jiri Slaby <jslaby@suse.cz> - 2016-01-25 13:00 +0100
  [PATCH 3.12 12/39] block: Always check queue limits for cloned requests Jiri Slaby <jslaby@suse.cz> - 2016-01-25 13:00 +0100
  [PATCH 3.12 20/39] m68k/mm: Check for mm != NULL in do_page_fault() debug code Jiri Slaby <jslaby@suse.cz> - 2016-01-25 13:00 +0100
  [PATCH 3.12 18/39] m32r: fix potential NULL-pointer dereference Jiri Slaby <jslaby@suse.cz> - 2016-01-25 13:00 +0100
  [PATCH 3.12 15/39] module: remove MODULE_GENERIC_TABLE Jiri Slaby <jslaby@suse.cz> - 2016-01-25 13:00 +0100
  [PATCH 3.12 23/39] USB: quirks: Fix another ELAN touchscreen Jiri Slaby <jslaby@suse.cz> - 2016-01-25 13:00 +0100
  [PATCH 3.12 17/39] pm: use GFP_ATOMIC when pm core call this function Jiri Slaby <jslaby@suse.cz> - 2016-01-25 13:00 +0100
  [PATCH 3.12 39/39] ppp, slip: Validate VJ compression slot parameters completely Jiri Slaby <jslaby@suse.cz> - 2016-01-25 13:00 +0100
  [PATCH 3.12 30/39] KVM: PPC: Book3S HV: Prohibit setting illegal transaction state in MSR Jiri Slaby <jslaby@suse.cz> - 2016-01-25 13:00 +0100
  [PATCH 3.12 21/39] m68k/mac: Make SCC reset work more reliably Jiri Slaby <jslaby@suse.cz> - 2016-01-25 13:00 +0100
  [PATCH 3.12 34/39] ALSA: hda - Add Intel Lewisburg device IDs Audio Jiri Slaby <jslaby@suse.cz> - 2016-01-25 13:00 +0100
  [PATCH 3.12 04/39] dlm: make posix locks interruptible Jiri Slaby <jslaby@suse.cz> - 2016-01-25 13:00 +0100
  [PATCH 3.12 35/39] ALSA: hda - Apply pin fixup for HP ProBook 6550b Jiri Slaby <jslaby@suse.cz> - 2016-01-25 13:00 +0100
  [PATCH 3.12 14/39] qla2xxx: Fix hardware lock/unlock issue causing kernel panic. Jiri Slaby <jslaby@suse.cz> - 2016-01-25 13:00 +0100
  [PATCH 3.12 29/39] x86/xen: don't reset vcpu_info on a cancelled suspend Jiri Slaby <jslaby@suse.cz> - 2016-01-25 13:00 +0100
  [PATCH 3.12 10/39] drm/i915: Fix SRC_COPY width on 830/845g Jiri Slaby <jslaby@suse.cz> - 2016-01-25 13:10 +0100
  [PATCH 3.12 07/39] route: Use ipv4_mtu instead of raw rt_pmtu Jiri Slaby <jslaby@suse.cz> - 2016-01-25 13:10 +0100
  [PATCH 3.12 13/39] Input: aiptek - fix crash on detecting device without endpoints Jiri Slaby <jslaby@suse.cz> - 2016-01-25 13:10 +0100
  [PATCH 3.12 05/39] PCI: Drop "setting latency timer" messages Jiri Slaby <jslaby@suse.cz> - 2016-01-25 13:10 +0100
  [PATCH 3.12 11/39] lpfc: Fix null ndlp dereference in target_reset_handler Jiri Slaby <jslaby@suse.cz> - 2016-01-25 13:10 +0100
  [PATCH 3.12 09/39] ring-buffer: Always run per-cpu ring buffer resize with schedule_work_on() Jiri Slaby <jslaby@suse.cz> - 2016-01-25 13:10 +0100
  [PATCH 3.12 06/39] ipv4: Don't increase PMTU with Datagram Too Big message. Jiri Slaby <jslaby@suse.cz> - 2016-01-25 13:10 +0100
  [PATCH 3.12 03/39] ALSA: hda - Fix noise problems on Thinkpad T440s Jiri Slaby <jslaby@suse.cz> - 2016-01-25 13:10 +0100
  [PATCH 3.12 08/39] SUNRPC: Fix oops when trace sunrpc_task events in nfs client Jiri Slaby <jslaby@suse.cz> - 2016-01-25 13:10 +0100

csiph-web