summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2005-11-07 09:41:28 +0000
committerMarcel Holtmann <marcel@holtmann.org>2005-11-07 09:41:28 +0000
commitff1e0556d0a88335924aea13cfbce67de82d9c19 (patch)
treef5c6b7a210773b3eb4909341f610496814e2b85e
parent226949879e3ed5578d678c817a955bd38597eddb (diff)
Fix parsing of the PS key identifier
-rw-r--r--tools/bccmd.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/tools/bccmd.c b/tools/bccmd.c
index 902555e5..50de4f17 100644
--- a/tools/bccmd.c
+++ b/tools/bccmd.c
@@ -424,6 +424,10 @@ static int cmd_psget(int dd, int argc, char *argv[])
OPT_PSKEY(1, &stores, &reset, NULL);
if (strncasecmp(argv[0], "0x", 2)) {
+ pskey = atoi(argv[0]);
+ type = CSR_TYPE_COMPLEX;
+ size = sizeof(array);
+
for (i = 0; storage[i].pskey; i++) {
if (strcasecmp(storage[i].str, argv[0]))
continue;
@@ -433,9 +437,6 @@ static int cmd_psget(int dd, int argc, char *argv[])
size = storage[i].type;
break;
}
- pskey = atoi(argv[0]);
- type = CSR_TYPE_COMPLEX;
- size = sizeof(array);
} else {
pskey = strtol(argv[0] + 2, NULL, 16);
type = CSR_TYPE_COMPLEX;
@@ -511,6 +512,10 @@ static int cmd_psset(int dd, int argc, char *argv[])
OPT_PSKEY(2, &stores, &reset, NULL);
if (strncasecmp(argv[0], "0x", 2)) {
+ pskey = atoi(argv[0]);
+ type = CSR_TYPE_COMPLEX;
+ size = sizeof(array);
+
for (i = 0; storage[i].pskey; i++) {
if (strcasecmp(storage[i].str, argv[0]))
continue;
@@ -520,9 +525,6 @@ static int cmd_psset(int dd, int argc, char *argv[])
size = storage[i].type;
break;
}
- pskey = atoi(argv[0]);
- type = CSR_TYPE_COMPLEX;
- size = sizeof(array);
} else {
pskey = strtol(argv[0] + 2, NULL, 16);
type = CSR_TYPE_COMPLEX;
@@ -601,6 +603,8 @@ static int cmd_psclr(int dd, int argc, char *argv[])
OPT_PSKEY(1, &stores, &reset, NULL);
if (strncasecmp(argv[0], "0x", 2)) {
+ pskey = atoi(argv[0]);
+
for (i = 0; storage[i].pskey; i++) {
if (strcasecmp(storage[i].str, argv[0]))
continue;
@@ -608,7 +612,6 @@ static int cmd_psclr(int dd, int argc, char *argv[])
pskey = storage[i].pskey;
break;
}
- pskey = atoi(argv[0]);
} else
pskey = strtol(argv[0] + 2, NULL, 16);