On Sat, Oct 31, 2009 at 7:12 AM, David Brownell <davi...@pacbell.net> wrote:
> On Friday 30 October 2009, Øyvind Harboe wrote:
>> Deleted unused fn's in interfaces. Unused fn's will be copy & pasted
>> around the code, get rid of it.
>>
>> Keeping it in a dev branch until after 0.3.
>>
>> See head of:
>>
>> http://repo.or.cz/w/openocd/oharboe.git?a=shortlog;h=refs/heads/remove_pre_debug
>
> Seems OK to me ...
>
> Similar idea:  target->quit().

I looked over the current quit target implementation. Not
used. All default implementations do nothing. If we
go ahead and do something here, then we would of
course add a default no-op for the quit interface fn
without touching all the target files.

Remove it?

How about attached patch?

-- 
Øyvind Harboe
http://www.zylin.com/zy1000.html
ARM7 ARM9 ARM11 XScale Cortex
JTAG debugger and flash programmer
From b0f24d5fc6f2e15aff0904362ee3ff18a264bb4b Mon Sep 17 00:00:00 2001
From: =?utf-8?q?=C3=98yvind=20Harboe?= <oyvind.har...@zylin.com>
Date: Sat, 31 Oct 2009 13:57:18 +0100
Subject: [PATCH] target: remove unused interface fn that clutters code
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit

The quit entry point was not being invoked. Just a source
of confusion at this point. XScale ran 100x reset upon
quit, but that code made no sense, wasn't commented
and never invoke.

Signed-off-by: Øyvind Harboe <oyvind.har...@zylin.com>
---
 src/target/arm11.c       |    7 -------
 src/target/arm11.h       |    1 -
 src/target/arm720t.c     |    6 ------
 src/target/arm7tdmi.c    |    7 -------
 src/target/arm920t.c     |    7 -------
 src/target/arm926ejs.c   |    6 ------
 src/target/arm966e.c     |    7 -------
 src/target/arm9tdmi.c    |    7 -------
 src/target/avrt.c        |    8 --------
 src/target/cortex_a8.c   |    1 -
 src/target/cortex_m3.c   |    6 ------
 src/target/fa526.c       |    7 -------
 src/target/feroceon.c    |    7 -------
 src/target/mips_m4k.c    |    7 -------
 src/target/target_type.h |    1 -
 src/target/xscale.c      |    7 -------
 16 files changed, 0 insertions(+), 92 deletions(-)

diff --git a/src/target/arm11.c b/src/target/arm11.c
index 289d64c..1e82b93 100644
--- a/src/target/arm11.c
+++ b/src/target/arm11.c
@@ -97,7 +97,6 @@ target_type_t arm11_target =
 	ARM11_HANDLER(target_create),
 	ARM11_HANDLER(init_target),
 	ARM11_HANDLER(examine),
-	ARM11_HANDLER(quit),
 };
 
 int arm11_regs_arch_type = -1;
@@ -1904,12 +1903,6 @@ int arm11_examine(struct target_s *target)
 	return ERROR_OK;
 }
 
-int arm11_quit(void)
-{
-	FNC_INFO_NOTIMPLEMENTED;
-
-	return ERROR_OK;
-}
 
 /** Load a register that is marked !valid in the register cache */
 int arm11_get_reg(reg_t *reg)
diff --git a/src/target/arm11.h b/src/target/arm11.h
index 9afff23..67320de 100644
--- a/src/target/arm11.h
+++ b/src/target/arm11.h
@@ -230,7 +230,6 @@ int arm11_run_algorithm(struct target_s *target, int num_mem_params, mem_param_t
 int arm11_register_commands(struct command_context_s *cmd_ctx);
 int arm11_target_create(struct target_s *target, Jim_Interp *interp);
 int arm11_init_target(struct command_context_s *cmd_ctx, struct target_s *target);
-int arm11_quit(void);
 
 /* helpers */
 int arm11_build_reg_cache(target_t *target);
diff --git a/src/target/arm720t.c b/src/target/arm720t.c
index 6ed66cd..c18291a 100644
--- a/src/target/arm720t.c
+++ b/src/target/arm720t.c
@@ -41,7 +41,6 @@ int arm720t_handle_cp15_command(struct command_context_s *cmd_ctx, char *cmd, ch
 /* forward declarations */
 int arm720t_target_create(struct target_s *target,Jim_Interp *interp);
 int arm720t_init_target(struct command_context_s *cmd_ctx, struct target_s *target);
-int arm720t_quit(void);
 int arm720t_arch_state(struct target_s *target);
 int arm720t_read_memory(struct target_s *target, uint32_t address, uint32_t size, uint32_t count, uint8_t *buffer);
 int arm720t_write_memory(struct target_s *target, uint32_t address, uint32_t size, uint32_t count, uint8_t *buffer);
@@ -88,7 +87,6 @@ target_type_t arm720t_target =
 	.target_create = arm720t_target_create,
 	.init_target = arm720t_init_target,
 	.examine = arm7tdmi_examine,
-	.quit = arm720t_quit,
 	.mrc = arm720t_mrc,
 	.mcr = arm720t_mcr,
 
@@ -469,10 +467,6 @@ int arm720t_init_target(struct command_context_s *cmd_ctx, struct target_s *targ
 	return ERROR_OK;
 }
 
-int arm720t_quit(void)
-{
-	return ERROR_OK;
-}
 
 int arm720t_init_arch_info(target_t *target, arm720t_common_t *arm720t, jtag_tap_t *tap)
 {
diff --git a/src/target/arm7tdmi.c b/src/target/arm7tdmi.c
index 0e978c2..e0282cf 100644
--- a/src/target/arm7tdmi.c
+++ b/src/target/arm7tdmi.c
@@ -38,7 +38,6 @@
 /* forward declarations */
 
 int arm7tdmi_target_create(struct target_s *target,Jim_Interp *interp);
-int arm7tdmi_quit(void);
 
 /* target function declarations */
 int arm7tdmi_poll(struct target_s *target);
@@ -80,7 +79,6 @@ target_type_t arm7tdmi_target =
 	.target_create  = arm7tdmi_target_create,
 	.init_target = arm7tdmi_init_target,
 	.examine = arm7tdmi_examine,
-	.quit = arm7tdmi_quit
 };
 
 int arm7tdmi_examine_debug_reason(target_t *target)
@@ -758,11 +756,6 @@ int arm7tdmi_init_target(struct command_context_s *cmd_ctx, struct target_s *tar
 	return ERROR_OK;
 }
 
-int arm7tdmi_quit(void)
-{
-	return ERROR_OK;
-}
-
 int arm7tdmi_init_arch_info(target_t *target, arm7tdmi_common_t *arm7tdmi, jtag_tap_t *tap)
 {
 	armv4_5_common_t *armv4_5;
diff --git a/src/target/arm920t.c b/src/target/arm920t.c
index 2531d9b..420963b 100644
--- a/src/target/arm920t.c
+++ b/src/target/arm920t.c
@@ -43,7 +43,6 @@ int arm920t_handle_read_mmu_command(struct command_context_s *cmd_ctx, char *cmd
 /* forward declarations */
 int arm920t_target_create(struct target_s *target, Jim_Interp *interp);
 int arm920t_init_target(struct command_context_s *cmd_ctx, struct target_s *target);
-int arm920t_quit(void);
 
 #define ARM920T_CP15_PHYS_ADDR(x, y, z) ((x << 5) | (y << 1) << (z))
 
@@ -85,7 +84,6 @@ target_type_t arm920t_target =
 	.target_create = arm920t_target_create,
 	.init_target = arm920t_init_target,
 	.examine = arm9tdmi_examine,
-	.quit = arm920t_quit
 };
 
 int arm920t_read_cp15_physical(target_t *target, int reg_addr, uint32_t *value)
@@ -660,11 +658,6 @@ int arm920t_init_target(struct command_context_s *cmd_ctx, struct target_s *targ
 	return ERROR_OK;
 }
 
-int arm920t_quit(void)
-{
-	return ERROR_OK;
-}
-
 int arm920t_init_arch_info(target_t *target, arm920t_common_t *arm920t, jtag_tap_t *tap)
 {
 	arm9tdmi_common_t *arm9tdmi = &arm920t->arm9tdmi_common;
diff --git a/src/target/arm926ejs.c b/src/target/arm926ejs.c
index 53f7980..1e24346 100644
--- a/src/target/arm926ejs.c
+++ b/src/target/arm926ejs.c
@@ -740,11 +740,6 @@ static int arm926ejs_init_target(struct command_context_s *cmd_ctx,
 	return ERROR_OK;
 }
 
-static int arm926ejs_quit(void)
-{
-	return ERROR_OK;
-}
-
 int arm926ejs_init_arch_info(target_t *target, arm926ejs_common_t *arm926ejs,
 		jtag_tap_t *tap)
 {
@@ -976,7 +971,6 @@ target_type_t arm926ejs_target =
 	.target_create = arm926ejs_target_create,
 	.init_target = arm926ejs_init_target,
 	.examine = arm9tdmi_examine,
-	.quit = arm926ejs_quit,
 	.virt2phys = arm926ejs_virt2phys,
 	.mmu = arm926ejs_mmu,
 
diff --git a/src/target/arm966e.c b/src/target/arm966e.c
index badcd4f..c06562c 100644
--- a/src/target/arm966e.c
+++ b/src/target/arm966e.c
@@ -35,7 +35,6 @@
 /* forward declarations */
 int arm966e_target_create(struct target_s *target, Jim_Interp *interp);
 int arm966e_init_target(struct command_context_s *cmd_ctx, struct target_s *target);
-int arm966e_quit(void);
 
 target_type_t arm966e_target =
 {
@@ -73,7 +72,6 @@ target_type_t arm966e_target =
 	.target_create = arm966e_target_create,
 	.init_target = arm966e_init_target,
 	.examine = arm9tdmi_examine,
-	.quit = arm966e_quit,
 };
 
 int arm966e_init_target(struct command_context_s *cmd_ctx, struct target_s *target)
@@ -83,11 +81,6 @@ int arm966e_init_target(struct command_context_s *cmd_ctx, struct target_s *targ
 	return ERROR_OK;
 }
 
-int arm966e_quit(void)
-{
-	return ERROR_OK;
-}
-
 int arm966e_init_arch_info(target_t *target, arm966e_common_t *arm966e, jtag_tap_t *tap)
 {
 	arm9tdmi_common_t *arm9tdmi = &arm966e->arm9tdmi_common;
diff --git a/src/target/arm9tdmi.c b/src/target/arm9tdmi.c
index e3c6ca3..b031647 100644
--- a/src/target/arm9tdmi.c
+++ b/src/target/arm9tdmi.c
@@ -47,7 +47,6 @@
 
 /* forward declarations */
 static int arm9tdmi_target_create(struct target_s *target, Jim_Interp *interp);
-static int arm9tdmi_quit(void);
 
 target_type_t arm9tdmi_target =
 {
@@ -85,7 +84,6 @@ target_type_t arm9tdmi_target =
 	.target_create = arm9tdmi_target_create,
 	.init_target = arm9tdmi_init_target,
 	.examine = arm9tdmi_examine,
-	.quit = arm9tdmi_quit
 };
 
 static arm9tdmi_vector_t arm9tdmi_vectors[] =
@@ -859,11 +857,6 @@ int arm9tdmi_init_target(struct command_context_s *cmd_ctx, struct target_s *tar
 	return ERROR_OK;
 }
 
-static int arm9tdmi_quit(void)
-{
-	return ERROR_OK;
-}
-
 int arm9tdmi_init_arch_info(target_t *target, arm9tdmi_common_t *arm9tdmi, jtag_tap_t *tap)
 {
 	armv4_5_common_t *armv4_5;
diff --git a/src/target/avrt.c b/src/target/avrt.c
index 2b73c32..d3e6282 100644
--- a/src/target/avrt.c
+++ b/src/target/avrt.c
@@ -34,7 +34,6 @@ int avr_register_commands(struct command_context_s *cmd_ctx);
 /* forward declarations */
 int avr_target_create(struct target_s *target, Jim_Interp *interp);
 int avr_init_target(struct command_context_s *cmd_ctx, struct target_s *target);
-int avr_quit(void);
 
 int avr_arch_state(struct target_s *target);
 int avr_poll(target_t *target);
@@ -95,7 +94,6 @@ target_type_t avr_target =
 	.register_commands = avr_register_commands,
 	.target_create = avr_target_create,
 	.init_target = avr_init_target,
-	.quit = avr_quit,
 /*
 	.virt2phys = avr_virt2phys,
 	.mmu = avr_mmu
@@ -124,12 +122,6 @@ int avr_init_target(struct command_context_s *cmd_ctx, struct target_s *target)
 	return ERROR_OK;
 }
 
-int avr_quit(void)
-{
-	LOG_DEBUG("%s", __FUNCTION__);
-	return ERROR_OK;
-}
-
 int avr_arch_state(struct target_s *target)
 {
 	LOG_DEBUG("%s", __FUNCTION__);
diff --git a/src/target/cortex_a8.c b/src/target/cortex_a8.c
index 025a468..0befbef 100644
--- a/src/target/cortex_a8.c
+++ b/src/target/cortex_a8.c
@@ -106,7 +106,6 @@ target_type_t cortexa8_target =
 	.target_create = cortex_a8_target_create,
 	.init_target = cortex_a8_init_target,
 	.examine = cortex_a8_examine,
-	.quit = NULL
 };
 
 /*
diff --git a/src/target/cortex_m3.c b/src/target/cortex_m3.c
index 1c59f02..f04cfad 100644
--- a/src/target/cortex_m3.c
+++ b/src/target/cortex_m3.c
@@ -1500,11 +1500,6 @@ static int cortex_m3_examine(struct target_s *target)
 	return ERROR_OK;
 }
 
-static int cortex_m3_quit(void)
-{
-	return ERROR_OK;
-}
-
 static int cortex_m3_dcc_read(swjdp_common_t *swjdp, uint8_t *value, uint8_t *ctrl)
 {
 	uint16_t dcrdr;
@@ -1846,6 +1841,5 @@ target_type_t cortexm3_target =
 	.target_create = cortex_m3_target_create,
 	.init_target = cortex_m3_init_target,
 	.examine = cortex_m3_examine,
-	.quit = cortex_m3_quit
 };
 
diff --git a/src/target/fa526.c b/src/target/fa526.c
index eee9e50..673d59b 100644
--- a/src/target/fa526.c
+++ b/src/target/fa526.c
@@ -36,7 +36,6 @@
 
 int fa526_target_create(struct target_s *target, Jim_Interp *interp);
 int fa526_init_target(struct command_context_s *cmd_ctx, struct target_s *target);
-int fa526_quit(void);
 
 target_type_t fa526_target =
 {
@@ -74,7 +73,6 @@ target_type_t fa526_target =
 	.target_create = fa526_target_create,
 	.init_target = fa526_init_target,
 	.examine = arm9tdmi_examine,
-	.quit = fa526_quit
 };
 
 void fa526_change_to_arm(target_t *target, uint32_t *r0, uint32_t *pc)
@@ -423,8 +421,3 @@ int fa526_init_target(struct command_context_s *cmd_ctx, struct target_s *target
 	arm9tdmi_init_target(cmd_ctx, target);
 	return ERROR_OK;
 }
-
-int fa526_quit(void)
-{
-	return ERROR_OK;
-}
diff --git a/src/target/feroceon.c b/src/target/feroceon.c
index f084201..e1dc068 100644
--- a/src/target/feroceon.c
+++ b/src/target/feroceon.c
@@ -583,11 +583,6 @@ int feroceon_init_target(struct command_context_s *cmd_ctx, struct target_s *tar
 	return ERROR_OK;
 }
 
-int feroceon_quit(void)
-{
-	return ERROR_OK;
-}
-
 void feroceon_common_setup(struct target_s *target)
 {
 	armv4_5_common_t *armv4_5 = target->arch_info;
@@ -715,7 +710,6 @@ target_type_t feroceon_target =
 	.target_create = feroceon_target_create,
 	.init_target = feroceon_init_target,
 	.examine = feroceon_examine,
-	.quit = feroceon_quit
 };
 
 target_type_t dragonite_target =
@@ -754,6 +748,5 @@ target_type_t dragonite_target =
 	.target_create = dragonite_target_create,
 	.init_target = feroceon_init_target,
 	.examine = feroceon_examine,
-	.quit = feroceon_quit
 };
 
diff --git a/src/target/mips_m4k.c b/src/target/mips_m4k.c
index 6458c26..07731a0 100644
--- a/src/target/mips_m4k.c
+++ b/src/target/mips_m4k.c
@@ -41,7 +41,6 @@ int mips_m4k_read_memory(struct target_s *target, uint32_t address, uint32_t siz
 int mips_m4k_write_memory(struct target_s *target, uint32_t address, uint32_t size, uint32_t count, uint8_t *buffer);
 int mips_m4k_register_commands(struct command_context_s *cmd_ctx);
 int mips_m4k_init_target(struct command_context_s *cmd_ctx, struct target_s *target);
-int mips_m4k_quit(void);
 int mips_m4k_target_create(struct target_s *target, Jim_Interp *interp);
 
 int mips_m4k_examine(struct target_s *target);
@@ -85,7 +84,6 @@ target_type_t mips_m4k_target =
 	.target_create = mips_m4k_target_create,
 	.init_target = mips_m4k_init_target,
 	.examine = mips_m4k_examine,
-	.quit = mips_m4k_quit
 };
 
 int mips_m4k_examine_debug_reason(target_t *target)
@@ -919,11 +917,6 @@ int mips_m4k_init_target(struct command_context_s *cmd_ctx, struct target_s *tar
 	return ERROR_OK;
 }
 
-int mips_m4k_quit(void)
-{
-	return ERROR_OK;
-}
-
 int mips_m4k_init_arch_info(target_t *target, mips_m4k_common_t *mips_m4k, jtag_tap_t *tap)
 {
 	mips32_common_t *mips32 = &mips_m4k->mips32_common;
diff --git a/src/target/target_type.h b/src/target/target_type.h
index 83baa25..dd469db 100644
--- a/src/target/target_type.h
+++ b/src/target/target_type.h
@@ -178,7 +178,6 @@ struct target_type_s
 	 * before the JTAG chain has been examined/verified
 	 * */
 	int (*init_target)(struct command_context_s *cmd_ctx, struct target_s *target);
-	int (*quit)(void);
 
 	/* translate from virtual to physical address. Default implementation is successful
 	 * no-op(i.e. virtual==physical).
diff --git a/src/target/xscale.c b/src/target/xscale.c
index ee9d88d..cc4176b 100644
--- a/src/target/xscale.c
+++ b/src/target/xscale.c
@@ -2919,12 +2919,6 @@ static int xscale_init_target(struct command_context_s *cmd_ctx,
 	return ERROR_OK;
 }
 
-static int xscale_quit(void)
-{
-	jtag_add_runtest(100, TAP_RESET);
-	return ERROR_OK;
-}
-
 static int xscale_init_arch_info(target_t *target,
 		xscale_common_t *xscale, jtag_tap_t *tap, const char *variant)
 {
@@ -3734,7 +3728,6 @@ target_type_t xscale_target =
 	.register_commands = xscale_register_commands,
 	.target_create = xscale_target_create,
 	.init_target = xscale_init_target,
-	.quit = xscale_quit,
 
 	.virt2phys = xscale_virt2phys,
 	.mmu = xscale_mmu
-- 
1.6.0.4

_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to