[PATCH 2/3] mark unused/obsolete code in bulkmem.c

Dominik Brodowski linux at dominikbrodowski.de
Thu Mar 25 13:25:04 GMT 2004


Most of bulkmem.c is unused. Mark it PCMCIA_OBSOLETE, and move the 
corresponding EXPORT_SYMBOL calls closer to the functions.

 drivers/pcmcia/bulkmem.c     |   19 +++++++++++++++++++
 drivers/pcmcia/cs.c          |   10 ----------
 drivers/pcmcia/cs_internal.h |    3 +++
 3 files changed, 22 insertions(+), 10 deletions(-)

diff -ruN linux-original/drivers/pcmcia/bulkmem.c linux/drivers/pcmcia/bulkmem.c
--- linux-original/drivers/pcmcia/bulkmem.c	2004-03-25 12:49:14.000000000 +0100
+++ linux/drivers/pcmcia/bulkmem.c	2004-03-25 12:59:44.993296560 +0100
@@ -48,6 +48,8 @@
 #include <pcmcia/cistpl.h>
 #include "cs_internal.h"
 
+#ifdef CONFIG_PCMCIA_OBSOLETE
+
 static void retry_erase_list(erase_busy_t *list, u_int cause);
 
 /*======================================================================
@@ -318,6 +320,9 @@
 	return CS_UNSUPPORTED_FUNCTION; break;
     }
 } /* MTDHelperEntry */
+EXPORT_SYMBOL(MTDHelperEntry);
+
+#endif /* CONFIG_PCMCIA_OBSOLETE */
 
 /*======================================================================
 
@@ -440,6 +445,9 @@
     return match_region(handle, rgn->next, rgn);
 } /* get_next_region */
 
+
+#ifdef CONFIG_PCMCIA_OBSOLETE
+
 /*======================================================================
 
     Connect an MTD with a memory region.
@@ -474,6 +482,7 @@
     } else
 	return CS_BAD_OFFSET;
 } /* register_mtd */
+EXPORT_SYMBOL(pcmcia_register_mtd);
 
 /*======================================================================
 
@@ -497,6 +506,7 @@
     *e = queue;
     return CS_SUCCESS;
 } /* register_erase_queue */
+EXPORT_SYMBOL(pcmcia_register_erase_queue);
 
 int pcmcia_deregister_erase_queue(eraseq_handle_t eraseq)
 {
@@ -511,6 +521,7 @@
     kfree(eraseq);
     return CS_SUCCESS;
 } /* deregister_erase_queue */
+EXPORT_SYMBOL(pcmcia_deregister_erase_queue);
 
 int pcmcia_check_erase_queue(eraseq_handle_t eraseq)
 {
@@ -522,6 +533,7 @@
 	    setup_erase_request(eraseq->handle, &eraseq->entry[i]);
     return CS_SUCCESS;
 } /* check_erase_queue */
+EXPORT_SYMBOL(pcmcia_check_erase_queue);
 
 /*======================================================================
 
@@ -554,6 +566,7 @@
     } else
 	return CS_BAD_OFFSET;
 } /* open_memory */
+EXPORT_SYMBOL(pcmcia_open_memory);
 
 /*======================================================================
 
@@ -570,6 +583,7 @@
 	return CS_BAD_HANDLE;
     return CS_SUCCESS;
 } /* close_memory */
+EXPORT_SYMBOL(pcmcia_close_memory);
 
 /*======================================================================
 
@@ -596,6 +610,7 @@
 	mtd.Function |= MTD_REQ_KERNEL;
     return do_mtd_request(handle, &mtd, buf);
 } /* read_memory */
+EXPORT_SYMBOL(pcmcia_read_memory);
 
 /*======================================================================
 
@@ -605,6 +620,7 @@
 ======================================================================*/
 
 int pcmcia_write_memory(memory_handle_t handle, mem_op_t *req, caddr_t buf)
+
 {
     mtd_request_t mtd;
     if (CHECK_REGION(handle))
@@ -622,6 +638,7 @@
 	mtd.Function |= MTD_REQ_KERNEL;
     return do_mtd_request(handle, &mtd, buf);
 } /* write_memory */
+EXPORT_SYMBOL(pcmcia_write_memory);
 
 /*======================================================================
 
@@ -635,4 +652,6 @@
 	return CS_BAD_HANDLE;
     return CS_UNSUPPORTED_FUNCTION;
 }
+EXPORT_SYMBOL(pcmcia_copy_memory);
 
+#endif /* CONFIG_PCMCIA_OBSOLETE */
diff -ruN linux-original/drivers/pcmcia/cs.c linux/drivers/pcmcia/cs.c
--- linux-original/drivers/pcmcia/cs.c	2004-03-25 12:49:14.000000000 +0100
+++ linux/drivers/pcmcia/cs.c	2004-03-25 13:00:05.438188464 +0100
@@ -2091,11 +2091,7 @@
 /* in alpha order */
 EXPORT_SYMBOL(pcmcia_access_configuration_register);
 EXPORT_SYMBOL(pcmcia_adjust_resource_info);
-EXPORT_SYMBOL(pcmcia_check_erase_queue);
-EXPORT_SYMBOL(pcmcia_close_memory);
-EXPORT_SYMBOL(pcmcia_copy_memory);
 EXPORT_SYMBOL(pcmcia_deregister_client);
-EXPORT_SYMBOL(pcmcia_deregister_erase_queue);
 EXPORT_SYMBOL(pcmcia_eject_card);
 EXPORT_SYMBOL(pcmcia_get_first_client);
 EXPORT_SYMBOL(pcmcia_get_card_services_info);
@@ -2114,12 +2110,8 @@
 EXPORT_SYMBOL(pcmcia_map_mem_page);
 EXPORT_SYMBOL(pcmcia_modify_configuration);
 EXPORT_SYMBOL(pcmcia_modify_window);
-EXPORT_SYMBOL(pcmcia_open_memory);
 EXPORT_SYMBOL(pcmcia_parse_tuple);
-EXPORT_SYMBOL(pcmcia_read_memory);
 EXPORT_SYMBOL(pcmcia_register_client);
-EXPORT_SYMBOL(pcmcia_register_erase_queue);
-EXPORT_SYMBOL(pcmcia_register_mtd);
 EXPORT_SYMBOL(pcmcia_release_configuration);
 EXPORT_SYMBOL(pcmcia_release_io);
 EXPORT_SYMBOL(pcmcia_release_irq);
@@ -2134,10 +2126,8 @@
 EXPORT_SYMBOL(pcmcia_set_event_mask);
 EXPORT_SYMBOL(pcmcia_suspend_card);
 EXPORT_SYMBOL(pcmcia_validate_cis);
-EXPORT_SYMBOL(pcmcia_write_memory);
 
 EXPORT_SYMBOL(dead_socket);
-EXPORT_SYMBOL(MTDHelperEntry);
 EXPORT_SYMBOL(pcmcia_parse_events);
 
 struct class pcmcia_socket_class = {
diff -ruN linux-original/drivers/pcmcia/cs_internal.h linux/drivers/pcmcia/cs_internal.h
--- linux-original/drivers/pcmcia/cs_internal.h	2004-03-25 12:49:14.000000000 +0100
+++ linux/drivers/pcmcia/cs_internal.h	2004-03-25 13:00:27.635813912 +0100
@@ -169,6 +169,8 @@
 /* In bulkmem.c */
 int get_first_region(client_handle_t handle, region_info_t *rgn);
 int get_next_region(client_handle_t handle, region_info_t *rgn);
+
+#ifdef CONFIG_PCMCIA_OBSOLETE
 int register_mtd(client_handle_t handle, mtd_reg_t *reg);
 int register_erase_queue(client_handle_t *handle, eraseq_hdr_t *header);
 int deregister_erase_queue(eraseq_handle_t eraseq);
@@ -178,6 +180,7 @@
 int read_memory(memory_handle_t handle, mem_op_t *req, caddr_t buf);
 int write_memory(memory_handle_t handle, mem_op_t *req, caddr_t buf);
 int copy_memory(memory_handle_t handle, copy_op_t *req);
+#endif
 
 /* In rsrc_mgr */
 void validate_mem(struct pcmcia_socket *s);



More information about the linux-pcmcia mailing list