[ 1984813 ] Bus driver cleanup, remove unnecessary sanity checking (Hartley Sweeten)

git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@1284 b68d4a1b-bc3d-0410-92ed-d4ac073336b7
master
Arnim Läuger 17 years ago
parent ab3a945764
commit 32dc74e986

@ -1,3 +1,19 @@
2008-06-16 Arnim Laeuger <arniml@users.sourceforge.net>
* src/cmd/initbus.c (cmd_initbus_run),
src/cmd/initbus.c, src/bus/bf548_ezkit.c, src/bus/fjmem.c,
src/bus/ppc405ep.c, src/bus/sh7727.c, src/bus/prototype.c,
src/bus/sa1110.c, src/bus/ppc440gx_ebc8.c, src/bus/tx4925.c,
src/bus/sh7750r.c, src/bus/pxa2x0.c, src/bus/bf533_stamp.c,
src/bus/bf533_ezkit.c, src/bus/bf537_stamp.c, src/bus/ixp425.c,
src/bus/avr32.c, src/bus/h7202.c, src/bus/zefant-xs3.c,
src/bus/mpc824x.c, src/bus/bcm1250.c, src/bus/sharc21065l.c,
src/bus/au1500.c, src/bus/lh7a400.c, src/bus/sh7751r.c,
src/bus/mpc5200.c, src/bus/jopcyc.c, src/bus/bf561_ezkit.c,
src/bus/slsup3.c, src/bus/s3c4510x.c, src/bus/ejtag.c:
[ 1984813 ] Bus driver cleanup, remove unnecessary sanity checking
(Hartley Sweeten)
2008-06-11 Arnim Laeuger <arniml@users.sourceforge.net>
* po/fr.po, po/rw.po, po/sk.po: updated

@ -72,10 +72,6 @@ static bus_t *au1500_bus_new( chain_t *chain, char *cmd_params[] )
int i;
int failed = 0;
if (!chain || !chain->parts || chain->parts->len <= chain->active_part || chain->active_part < 0)
return NULL;
bus = calloc( 1, sizeof (bus_t) );
if (!bus)
return NULL;

@ -487,10 +487,6 @@ avr32_bus_new (chain_t * chain, char *cmd_params[])
char *param;
unsigned int mode;
if (!chain || !chain->parts ||
chain->parts->len <= chain->active_part || chain->active_part < 0)
return NULL;
part = chain->parts->parts[chain->active_part];
param = cmd_params[2];

@ -71,9 +71,6 @@ bcm1250_bus_new( chain_t *chain, char *cmd_params[] )
int i;
int failed = 0;
if (!chain || !chain->parts || chain->parts->len <= chain->active_part || chain->active_part < 0)
return NULL;
bus = calloc( 1, sizeof (bus_t) );
if (!bus)
return NULL;

@ -78,9 +78,6 @@ bf533_ezkit_bus_new( chain_t *chain, char *cmd_params[] )
int i;
int failed = 0;
if (!chain || !chain->parts || chain->parts->len <= chain->active_part || chain->active_part < 0)
return NULL;
bus = calloc( 1, sizeof (bus_t) );
if (!bus)
return NULL;

@ -78,9 +78,6 @@ bf533_stamp_bus_new( chain_t *chain, char *cmd_params[] )
int i;
int failed = 0;
if (!chain || !chain->parts || chain->parts->len <= chain->active_part || chain->active_part < 0)
return NULL;
bus = calloc( 1, sizeof (bus_t) );
if (!bus)
return NULL;

@ -78,9 +78,6 @@ bf537_stamp_bus_new_1( chain_t *chain, char *cmd_params[] )
int i;
int failed = 0;
if (!chain || !chain->parts || chain->parts->len <= chain->active_part || chain->active_part < 0)
return NULL;
bus = calloc( 1, sizeof (bus_t) );
if (!bus)
return NULL;

@ -73,9 +73,6 @@ bf548_ezkit_bus_new( chain_t *chain, char *cmd_params[] )
int i;
int failed = 0;
if (!chain || !chain->parts || chain->parts->len <= chain->active_part || chain->active_part < 0)
return NULL;
bus = calloc( 1, sizeof (bus_t) );
if (!bus)
return NULL;

@ -78,9 +78,6 @@ bf561_ezkit_bus_new( chain_t *chain, char *cmd_params[] )
int i;
int failed = 0;
if (!chain || !chain->parts || chain->parts->len <= chain->active_part || chain->active_part < 0)
return NULL;
bus = calloc( 1, sizeof (bus_t) );
if (!bus)
return NULL;

@ -82,9 +82,6 @@ ejtag_bus_new( chain_t *chain, char *cmd_params[] )
{
bus_t *bus;
if (!chain || !chain->parts || chain->parts->len <= chain->active_part || chain->active_part < 0)
return NULL;
bus = calloc( 1, sizeof (bus_t) );
if (!bus)
return NULL;

@ -361,13 +361,6 @@ fjmem_bus_new( chain_t *chain, char *params[] )
int fjmem_reg_len = 0;
int idx;
if (!chain || !chain->parts || chain->parts->len <= chain->active_part || chain->active_part < 0)
return NULL;
if (chain->active_part >= chain->parts->len) {
printf( _("%s: no active part\n"), "fjmem" );
return NULL;
}
part = chain->parts->parts[chain->active_part];
/* parse parameters */

@ -68,9 +68,6 @@ h7202_bus_new( chain_t *chain, char *cmd_params[] )
int i;
int failed = 0;
if (!chain || !chain->parts || chain->parts->len <= chain->active_part || chain->active_part < 0)
return NULL;
bus = calloc( 1, sizeof (bus_t) );
if (!bus)
return NULL;

@ -68,9 +68,6 @@ ixp425_bus_new( chain_t *chain, char *cmd_params[] )
int i;
int failed = 0;
if (!chain || !chain->parts || chain->parts->len <= chain->active_part || chain->active_part < 0)
return NULL;
bus = calloc( 1, sizeof (bus_t) );
if (!bus)
return NULL;

@ -145,9 +145,6 @@ jopcyc_bus_new( chain_t *chain, char *cmd_params[] )
int failed = 0;
component_t *comp;
if (!chain || !chain->parts || chain->parts->len <= chain->active_part || chain->active_part < 0)
return NULL;
bus = calloc( 1, sizeof (bus_t) );
if (!bus)
return NULL;

@ -84,9 +84,6 @@ lh7a400_bus_new( chain_t *chain, char *cmd_params[] )
int i;
int failed = 0;
if (!chain || !chain->parts || chain->parts->len <= chain->active_part || chain->active_part < 0)
return NULL;
bus = calloc( 1, sizeof (bus_t) );
if (!bus)
return NULL;

@ -73,9 +73,6 @@ mpc5200_bus_new( chain_t *chain, char *cmd_params[] )
int i;
int failed = 0;
if (!chain || !chain->parts || chain->parts->len <= chain->active_part || chain->active_part < 0)
return NULL;
bus = calloc( 1, sizeof (bus_t) );
if (!bus)
return NULL;

@ -145,11 +145,6 @@ mpc824x_bus_new( chain_t *chain, char *cmd_params[] )
// REVBITS = 0;
if (!chain || !chain->parts || chain->parts->len <= chain->active_part || chain->active_part < 0)
return NULL;
bus = calloc( 1, sizeof (bus_t) );
if (!bus)
return NULL;

@ -66,9 +66,6 @@ ppc405ep_bus_new( chain_t *chain, char *cmd_params[] )
int i;
int failed = 0;
if (!chain || !chain->parts || (chain->parts->len <= chain->active_part) || (chain->active_part < 0))
return NULL;
bus = calloc( 1, sizeof (bus_t) );
if (!bus)
return NULL;

@ -68,9 +68,6 @@ ppc440gx_ebc8_bus_new( chain_t *chain, char *cmd_params[] )
int i;
int failed = 0;
if (!chain || !chain->parts || (chain->parts->len <= chain->active_part) || (chain->active_part < 0))
return NULL;
bus = calloc( 1, sizeof (bus_t) );
if (!bus)
return NULL;

@ -102,9 +102,6 @@ prototype_bus_new( chain_t *chain, char *cmd_params[] )
int failed = 0;
int ashift = -1;
if (!chain || !chain->parts || (chain->parts->len <= chain->active_part) || (chain->active_part < 0))
return NULL;
bus = calloc( 1, sizeof (bus_t) );
if (!bus)
return NULL;

@ -152,9 +152,6 @@ pxa2xx_bus_new_common(bus_t * bus)
#ifdef PREPATCHNEVER
bus_t *bus;
if (!chain || !chain->parts || chain->parts->len <= chain->active_part || chain->active_part < 0)
return NULL;
bus = calloc( 1, sizeof (bus_t) );
if (!bus)
return NULL;

@ -113,9 +113,6 @@ s3c4510_bus_new( chain_t *chain, char *cmd_params[] )
int i;
int failed = 0;
if (!chain || !chain->parts || chain->parts->len <= chain->active_part || chain->active_part < 0)
return NULL;
bus = calloc( 1, sizeof (bus_t) );
if (!bus)
return NULL;

@ -73,9 +73,6 @@ sa1110_bus_new( chain_t *chain, char *cmd_params[] )
int i;
int failed = 0;
if (!chain || !chain->parts || chain->parts->len <= chain->active_part || chain->active_part < 0)
return NULL;
bus = calloc( 1, sizeof (bus_t) );
if (!bus)
return NULL;

@ -74,9 +74,6 @@ sh7727_bus_new( chain_t *chain, char *cmd_params[] )
int i;
int failed = 0;
if (!chain || !chain->parts || chain->parts->len <= chain->active_part || chain->active_part < 0)
return NULL;
bus = calloc( 1, sizeof (bus_t) );
if (!bus)
return NULL;

@ -74,9 +74,6 @@ sh7750r_bus_new( chain_t *chain, char *cmd_params[] )
int i;
int failed = 0;
if (!chain || !chain->parts || chain->parts->len <= chain->active_part || chain->active_part < 0)
return NULL;
bus = calloc( 1, sizeof (bus_t) );
if (!bus)
return NULL;

@ -72,9 +72,6 @@ sh7751r_bus_new( chain_t *chain, char *cmd_params[] )
int i;
int failed = 0;
if (!chain || !chain->parts || chain->parts->len <= chain->active_part || chain->active_part < 0)
return NULL;
bus = calloc( 1, sizeof (bus_t) );
if (!bus)
return NULL;

@ -76,9 +76,6 @@ static bus_t *sharc_21065L_bus_new( chain_t *chain, char *cmd_params[] )
int i;
int failed = 0;
if (!chain || !chain->parts || chain->parts->len <= chain->active_part || chain->active_part < 0)
return NULL;
bus = calloc( 1, sizeof (bus_t) );
if (!bus)
return NULL;

@ -101,9 +101,6 @@ slsup3_bus_new( chain_t *chain, char *cmd_params[] )
int i;
int failed = 0;
if (!chain || !chain->parts || chain->parts->len <= chain->active_part || chain->active_part < 0)
return NULL;
bus = calloc( 1, sizeof (bus_t) );
if (!bus)
return NULL;

@ -82,9 +82,6 @@ tx4925_bus_new( chain_t *chain, char *cmd_params[] )
int i;
int failed = 0;
if (!chain || !chain->parts || chain->parts->len <= chain->active_part || chain->active_part < 0)
return NULL;
bus = calloc( 1, sizeof (bus_t) );
if (!bus)
return NULL;

@ -164,9 +164,6 @@ zefant_xs3_bus_new( chain_t *chain, char *cmd_params[] )
component_t *comp;
int idx;
if (!chain || !chain->parts || chain->parts->len <= chain->active_part || chain->active_part < 0)
return NULL;
bus = calloc( 1, sizeof (bus_t) );
if (!bus)
return NULL;

@ -47,7 +47,7 @@ cmd_initbus_run( chain_t *chain, char *params[] )
return 1;
}
if (chain->active_part >= chain->parts->len) {
if (chain->active_part >= chain->parts->len || chain->active_part < 0) {
printf( _("%s: no active part\n"), "initbus" );
return 1;
}

Loading…
Cancel
Save