Skip to contentSkip to conversation

small ftape cleanups (fwd)

PATCH New Adrian Bunk 1 participant 1 message Nov 20, 2004

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 small ftape cleanups (fwd)

The patch forwarded below still applies and compiles against 2.6.10-rc2-mm2.

Please apply.

----- Forwarded message from Adrian Bunk <[email protected]> -----

Date: Sat, 6 Nov 2004 23:24:32 +0100
From: Adrian Bunk <[email protected]>
To: [email protected]
Subject: [2.6 patch] small ftape cleanups

The patch below does cleanups under drivers/char/rio/ including the following:
- remove some completely unused code
- make some needlessly global code static

diffstat output:

 drivers/char/ftape/compressor/zftape-compress.c |    4 
 drivers/char/ftape/lowlevel/fc-10.c             |    4 
 drivers/char/ftape/lowlevel/fdc-io.c            |   67 ++--------------
 drivers/char/ftape/lowlevel/fdc-io.h            |    5 -
 drivers/char/ftape/lowlevel/ftape-bsm.c         |    8 +
 drivers/char/ftape/lowlevel/ftape-bsm.h         |    1 
 drivers/char/ftape/lowlevel/ftape-ctl.c         |   15 +--
 drivers/char/ftape/lowlevel/ftape-ctl.h         |    1 
 drivers/char/ftape/lowlevel/ftape-init.c        |    6 -
 drivers/char/ftape/lowlevel/ftape-io.c          |   24 -----
 drivers/char/ftape/lowlevel/ftape-io.h          |    4 
 drivers/char/ftape/lowlevel/ftape-proc.c        |    4 
 drivers/char/ftape/lowlevel/ftape-rw.c          |    2 
 drivers/char/ftape/lowlevel/ftape-rw.h          |    1 
 drivers/char/ftape/zftape/zftape-buffers.c      |    7 -
 drivers/char/ftape/zftape/zftape-buffers.h      |    1 
 drivers/char/ftape/zftape/zftape-init.c         |   13 ---
 drivers/char/ftape/zftape/zftape-init.h         |    1 
 drivers/char/ftape/zftape/zftape-rw.c           |    1 
 drivers/char/ftape/zftape/zftape-rw.h           |    1 
 drivers/char/ftape/zftape/zftape-vtbl.c         |    4 
 drivers/char/ftape/zftape/zftape-vtbl.h         |    1 
 drivers/char/ftape/zftape/zftape_syms.c         |    1 
 23 files changed, 31 insertions(+), 145 deletions(-)
drivers/char/ftape/compressor/zftape-compress.c renamed from drivers/char/ftape/compressor/zftape-compress.c.old +0 -4
@@ -27,10 +27,6 @@
  *     changed * appropriately. See below.
  */
 
- char zftc_src[] ="$Source: /homes/cvs/ftape-stacked/ftape/compressor/zftape-compress.c,v $";
- char zftc_rev[] = "$Revision: 1.1.6.1 $";
- char zftc_dat[] = "$Date: 1997/11/16 15:15:56 $";
-
 #include <linux/version.h>
 #include <linux/errno.h>
 #include <linux/mm.h>
drivers/char/ftape/lowlevel/fc-10.c renamed from drivers/char/ftape/lowlevel/fc-10.c.old +2 -2
@@ -56,13 +56,13 @@
 #include "../lowlevel/fdc-io.h"
 #include "../lowlevel/fc-10.h"
 
-__u16 inbs_magic[] = {
+static __u16 inbs_magic[] = {
 	0x3, 0x3, 0x0, 0x4, 0x7, 0x2, 0x5, 0x3, 0x1, 0x4,
 	0x3, 0x5, 0x2, 0x0, 0x3, 0x7, 0x4, 0x2,
 	0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7
 };
 
-__u16 fc10_ports[] = {
+static __u16 fc10_ports[] = {
 	0x180, 0x210, 0x2A0, 0x300, 0x330, 0x340, 0x370
 };
 
drivers/char/ftape/lowlevel/fdc-io.h renamed from drivers/char/ftape/lowlevel/fdc-io.h.old +0 -5
@@ -210,7 +210,6 @@
 extern volatile fdc_mode_enum fdc_mode;
 extern int fdc_setup_error;	/* outdated ??? */
 extern wait_queue_head_t ftape_wait_intr;
-extern int ftape_motor;		/* fdc motor line state */
 extern volatile int ftape_current_cylinder; /* track nr FDC thinks we're on */
 extern volatile __u8 fdc_head;	/* FDC head */
 extern volatile __u8 fdc_cyl;	/* FDC track */
@@ -231,15 +230,11 @@
 extern int fdc_ready_wait(unsigned int timeout);
 extern int fdc_command(const __u8 * cmd_data, int cmd_len);
 extern int fdc_result(__u8 * res_data, int res_len);
-extern int fdc_issue_command(const __u8 * out_data, int out_count,
-			     __u8 * in_data, int in_count);
 extern int fdc_interrupt_wait(unsigned int time);
-extern int fdc_set_seek_rate(int seek_rate);
 extern int fdc_seek(int track);
 extern int fdc_sense_drive_status(int *st3);
 extern void fdc_motor(int motor);
 extern void fdc_reset(void);
-extern int fdc_recalibrate(void);
 extern void fdc_disable(void);
 extern int fdc_fifo_threshold(__u8 threshold,
 			      int *fifo_state, int *lock_state, int *fifo_thr);
drivers/char/ftape/lowlevel/fdc-io.c renamed from drivers/char/ftape/lowlevel/fdc-io.c.old +10 -57

132 lines not on this page · raw message

drivers/char/ftape/lowlevel/ftape-bsm.h renamed from drivers/char/ftape/lowlevel/ftape-bsm.h.old +0 -1
@@ -60,7 +60,6 @@
 extern void update_bad_sector_map(__u8 * buffer);
 extern void ftape_extract_bad_sector_map(__u8 * buffer);
 extern SectorMap ftape_get_bad_sector_entry(int segment_id);
-extern void      ftape_put_bad_sector_entry(int segment_id, SectorMap mask);
 extern __u8 *ftape_find_end_of_bsm_list(__u8 * address);
 extern void ftape_init_bsm(void);
 
drivers/char/ftape/lowlevel/ftape-bsm.c renamed from drivers/char/ftape/lowlevel/ftape-bsm.c.old +7 -1
@@ -47,6 +47,10 @@
 } mode_type;
 
 #if 0
+static void ftape_put_bad_sector_entry(int segment_id, SectorMap new_map);
+#endif
+
+#if 0
 /*  fix_tape converts a normal QIC-80 tape into a 'wide' tape.
  *  For testing purposes only !
  */
@@ -375,7 +379,8 @@
 	}
 }
 
-void ftape_put_bad_sector_entry(int segment_id, SectorMap new_map)
+#if 0
+static void ftape_put_bad_sector_entry(int segment_id, SectorMap new_map)
 {
 	SectorCount *ptr = (SectorCount *)bad_sector_map;
 	int count;
@@ -438,6 +443,7 @@
 	}
 	TRACE_EXIT;
 }
+#endif  /*  0  */
 
 SectorMap ftape_get_bad_sector_entry(int segment_id)
 {
drivers/char/ftape/lowlevel/ftape-ctl.h renamed from drivers/char/ftape/lowlevel/ftape-ctl.h.old +0 -1
@@ -158,6 +158,5 @@
 				 unsigned int data_rate,
 				 unsigned int tape_len);
 extern int  ftape_calibrate_data_rate(unsigned int qic_std);
-extern int  ftape_init_drive(void);
 extern const ftape_info *ftape_get_status(void);
 #endif
drivers/char/ftape/lowlevel/ftape-ctl.c renamed from drivers/char/ftape/lowlevel/ftape-ctl.c.old +5 -10
@@ -113,11 +113,6 @@
 #endif
 }
 
-void ftape_set_status(const ftape_info *status)
-{
-	ftape_status = *status;
-}
-
 static int ftape_not_operational(int status)
 {
 	/* return true if status indicates tape can not be used.
@@ -210,7 +205,7 @@
 	return i;
 }
 
-void ftape_detach_drive(void)
+static void ftape_detach_drive(void)
 {
 	TRACE_FUN(ft_t_any);
 
@@ -241,7 +236,7 @@
 		ft_history.rewinds = 0;
 }
 
-int ftape_activate_drive(vendor_struct * drive_type)
+static int ftape_activate_drive(vendor_struct * drive_type)
 {
 	int result = 0;
 	TRACE_FUN(ft_t_flow);
@@ -301,7 +296,7 @@
 	TRACE_EXIT result;
 }
 
-int ftape_get_drive_status(void)
+static int ftape_get_drive_status(void)
 {
 	int result;
 	int status;
@@ -374,7 +369,7 @@
 	TRACE_EXIT 0;
 }
 
-void ftape_log_vendor_id(void)
+static void ftape_log_vendor_id(void)
 {
 	int vendor_index;
 	TRACE_FUN(ft_t_flow);
@@ -580,7 +575,7 @@
 	TRACE_EXIT 0;
 }
 
-int ftape_init_drive(void)
+static int ftape_init_drive(void)
 {
 	int status;
 	qic_model model;
drivers/char/ftape/lowlevel/ftape-init.c renamed from drivers/char/ftape/lowlevel/ftape-init.c.old +0 -6
@@ -48,12 +48,6 @@
 #include "../lowlevel/ftape-proc.h"
 #include "../lowlevel/ftape-tracing.h"
 
-/*      Global vars.
- */
-char ft_src[] __initdata = "$Source: /homes/cvs/ftape-stacked/ftape/lowlevel/ftape-init.c,v $";
-char ft_rev[] __initdata = "$Revision: 1.8 $";
-char ft_dat[] __initdata = "$Date: 1997/11/06 00:38:08 $";
-
 
 #if defined(MODULE) && !defined(CONFIG_FT_NO_TRACE_AT_ALL)
 static int ft_tracing = -1;
drivers/char/ftape/lowlevel/ftape-io.h renamed from drivers/char/ftape/lowlevel/ftape-io.h.old +0 -4
@@ -65,9 +65,6 @@
 			       unsigned int timeout,
 			       int *status);
 extern int  ftape_parameter(unsigned int parameter);
-extern int  ftape_parameter_wait(unsigned int parameter,
-				 unsigned int timeout,
-				 int *status);
 extern int ftape_report_operation(int *status,
 				  qic117_cmd_t  command,
 				  int result_length);
@@ -80,7 +77,6 @@
 extern int ftape_report_status(int *status);
 extern int ftape_ready_wait(unsigned int timeout, int *status);
 extern int ftape_seek_head_to_track(unsigned int track);
-extern int ftape_in_error_state(int status);
 extern int ftape_set_data_rate(unsigned int new_rate, unsigned int qic_std);
 extern int ftape_report_error(unsigned int *error,
 			      qic117_cmd_t *command,
drivers/char/ftape/lowlevel/ftape-io.c renamed from drivers/char/ftape/lowlevel/ftape-io.c.old +2 -22
@@ -350,7 +350,7 @@
 	return result;
 }
 
-int ftape_parameter_wait(unsigned int parm, unsigned int timeout, int *status)
+static int ftape_parameter_wait(unsigned int parm, unsigned int timeout, int *status)
 {
 	int result;
 
@@ -503,16 +503,6 @@
 	TRACE_EXIT 0;
 }
 
-int ftape_in_error_state(int status)
-{
-	TRACE_FUN(ft_t_any);
-
-	if ((status & QIC_STATUS_READY) && (status & QIC_STATUS_ERROR)) {
-		TRACE_ABORT(1, ft_t_warn, "warning: error status set!");
-	}
-	TRACE_EXIT 0;
-}
-
 int ftape_report_configuration(qic_model *model,
 			       unsigned int *rate,
 			       int *qic_std,
@@ -617,7 +607,7 @@
 	TRACE_EXIT (result < 0) ? -EIO : 0;
 }
 
-int ftape_report_rom_version(int *version)
+static int ftape_report_rom_version(int *version)
 {
 
 	if (ftape_report_operation(version, QIC_REPORT_ROM_VERSION, 8) < 0) {
@@ -627,16 +617,6 @@
 	}
 }
 
-int ftape_report_signature(int *signature)
-{
-	int result;
-
-	result = ftape_command(28);
-	result = ftape_report_operation(signature, 9, 8);
-	result = ftape_command(30);
-	return (result < 0) ? -EIO : 0;
-}
-
 void ftape_report_vendor_id(unsigned int *id)
 {
 	int result;
drivers/char/ftape/lowlevel/ftape-proc.c renamed from drivers/char/ftape/lowlevel/ftape-proc.c.old +2 -2
@@ -174,8 +174,8 @@
 	return len;
 }
 
-int ftape_read_proc(char *page, char **start, off_t off,
-		    int count, int *eof, void *data)
+static int ftape_read_proc(char *page, char **start, off_t off,
+			   int count, int *eof, void *data)
 {
 	char *ptr = page;
 	size_t len;
drivers/char/ftape/lowlevel/ftape-rw.h renamed from drivers/char/ftape/lowlevel/ftape-rw.h.old +0 -1
@@ -101,7 +101,6 @@
 extern buffer_struct *ftape_get_buffer  (ft_buffer_queue_t pos);
 extern int            ftape_buffer_id   (ft_buffer_queue_t pos);
 extern void           ftape_reset_buffer(void);
-extern int  ftape_read_id(void);
 extern void ftape_tape_parameters(__u8 drive_configuration);
 extern int  ftape_wait_segment(buffer_state_enum state);
 extern int  ftape_dumb_stop(void);
drivers/char/ftape/lowlevel/ftape-rw.c renamed from drivers/char/ftape/lowlevel/ftape-rw.c.old +1 -1
@@ -301,7 +301,7 @@
 
 /*      Read Id of first sector passing tape head.
  */
-int ftape_read_id(void)
+static int ftape_read_id(void)
 {
 	int status;
 	__u8 out[2];
drivers/char/ftape/zftape/zftape-buffers.h renamed from drivers/char/ftape/zftape/zftape-buffers.h.old +0 -1
@@ -37,7 +37,6 @@
 extern int   zft_vmalloc_once(void *new, size_t size);
 extern int   zft_vcalloc_once(void *new, size_t size);
 extern int   zft_vmalloc_always(void *new, size_t size);
-extern int   zft_vcalloc_always(void *new, size_t size);
 extern void  zft_vfree(void *old, size_t size);
 extern void *zft_kmalloc(size_t size);
 extern void  zft_kfree(void *old, size_t size);
drivers/char/ftape/zftape/zftape-buffers.c renamed from drivers/char/ftape/zftape/zftape-buffers.c.old +0 -7
@@ -87,13 +87,6 @@
 	TRACE_ABORT(0, ft_t_noise,
 		    "allocated buffer @ %p, %d bytes", *(void **)new, size);
 }
-int zft_vcalloc_always(void *new, size_t size)
-{
-	TRACE_FUN(ft_t_flow);
-
-	zft_vfree(new, size);
-	TRACE_EXIT zft_vcalloc_once(new, size);
-}
 int zft_vmalloc_always(void *new, size_t size)
 {
 	TRACE_FUN(ft_t_flow);
drivers/char/ftape/zftape/zftape_syms.c renamed from drivers/char/ftape/zftape/zftape_syms.c.old +0 -1
@@ -35,7 +35,6 @@
 
 /* zftape-init.c */
 EXPORT_SYMBOL(zft_cmpr_register);
-EXPORT_SYMBOL(zft_cmpr_unregister);
 /* zftape-read.c */
 EXPORT_SYMBOL(zft_fetch_segment_fraction);
 /* zftape-buffers.c */
drivers/char/ftape/zftape/zftape-init.h renamed from drivers/char/ftape/zftape/zftape-init.h.old +0 -1
@@ -70,7 +70,6 @@
 /* zftape-init.c defined global functions.
  */
 extern int                  zft_cmpr_register(struct zft_cmpr_ops *new_ops);
-extern struct zft_cmpr_ops *zft_cmpr_unregister(void);
 extern int                  zft_cmpr_lock(int try_to_load);
 
 #endif
drivers/char/ftape/zftape/zftape-init.c renamed from drivers/char/ftape/zftape/zftape-init.c.old +0 -13
@@ -46,10 +46,6 @@
 #include "../zftape/zftape-ctl.h"
 #include "../zftape/zftape-buffers.h"
 
-char zft_src[] __initdata = "$Source: /homes/cvs/ftape-stacked/ftape/zftape/zftape-init.c,v $";
-char zft_rev[] __initdata = "$Revision: 1.8 $";
-char zft_dat[] __initdata = "$Date: 1997/11/06 00:48:56 $";
-
 MODULE_AUTHOR("(c) 1996, 1997 Claus-Justus Heine "
 	      "([email protected])");
 MODULE_DESCRIPTION(ZFTAPE_VERSION " - "
@@ -278,15 +274,6 @@
 	}
 }
 
-struct zft_cmpr_ops *zft_cmpr_unregister(void)
-{
-	struct zft_cmpr_ops *old_ops = zft_cmpr_ops;
-	TRACE_FUN(ft_t_flow);
-
-	zft_cmpr_ops = NULL;
-	TRACE_EXIT old_ops;
-}
-
 /*  lock the zft-compressor() module.
  */
 int zft_cmpr_lock(int try_to_load)
drivers/char/ftape/zftape/zftape-rw.h renamed from drivers/char/ftape/zftape/zftape-rw.h.old +0 -1
@@ -79,7 +79,6 @@
 extern int zft_deblock_segment;
 extern zft_status_enum zft_io_state;
 extern int zft_header_changed;
-extern int zft_bad_sector_map_changed;
 extern int zft_qic113; /* conform to old specs. and old zftape */
 extern int zft_use_compression;
 extern unsigned int zft_blk_sz;
drivers/char/ftape/zftape/zftape-rw.c renamed from drivers/char/ftape/zftape/zftape-rw.c.old +0 -1
@@ -45,7 +45,6 @@
 int zft_deblock_segment = -1;
 zft_status_enum zft_io_state = zft_idle;
 int zft_header_changed;
-int zft_bad_sector_map_changed;
 int zft_qic113; /* conform to old specs. and old zftape */
 int zft_use_compression;
 zft_position zft_pos = {
drivers/char/ftape/zftape/zftape-vtbl.h renamed from drivers/char/ftape/zftape/zftape-vtbl.h.old +0 -1
@@ -152,7 +152,6 @@
 /* exported functions */
 extern void  zft_init_vtbl             (void);
 extern void  zft_free_vtbl             (void);
-extern void  zft_new_vtbl_entry        (void);
 extern int   zft_extract_volume_headers(__u8 *buffer);
 extern int   zft_update_volume_table   (unsigned int segment);
 extern int   zft_open_volume           (zft_position *pos,
drivers/char/ftape/zftape/zftape-vtbl.c renamed from drivers/char/ftape/zftape/zftape-vtbl.c.old +2 -2
@@ -62,7 +62,7 @@
 static zft_volinfo  eot_vtbl;
 static zft_volinfo *cur_vtbl;
 
-inline void zft_new_vtbl_entry(void)
+static inline void zft_new_vtbl_entry(void)
 {
 	struct list_head *tmp = &zft_last_vtbl->node;
 	zft_volinfo *new = zft_kmalloc(sizeof(zft_volinfo));
@@ -248,7 +248,7 @@
  * that buffer already contains the old volume-table, so that vtbl
  * entries without the zft_volume flag set can savely be ignored.
  */
-void zft_create_volume_headers(__u8 *buffer)
+static void zft_create_volume_headers(__u8 *buffer)
 {   
 	__u8 *entry;
 	struct list_head *tmp;

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

----- End forwarded message -----