Skip to content

Commit 761552a

Browse files
committed
Get rid of substituting -p platform with ./platform-debugcc
This is very cheesy and frankly, unnecessary.
1 parent d15bea7 commit 761552a

File tree

1 file changed

+2
-32
lines changed

1 file changed

+2
-32
lines changed

debugcc.c

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -207,32 +207,6 @@ static const struct debugcc_platform *find_platform(const char *name)
207207
return NULL;
208208
}
209209

210-
/**
211-
* match_platform() - match platform with executable name
212-
* @argv: argv[0] of the executable
213-
*
214-
* Return: A debugcc_platform when a match is found, otherwise NULL
215-
*
216-
* Matches %s-debugcc against the registered platforms
217-
*/
218-
static const struct debugcc_platform *match_platform(const char *argv)
219-
{
220-
const struct debugcc_platform **p;
221-
const char *name;
222-
size_t len;
223-
224-
for (p = platforms; *p; p++) {
225-
name = (*p)->name;
226-
227-
len = strlen(name);
228-
229-
if (!strncmp(name, argv, len) && !strcmp(argv + len, "-debugcc"))
230-
return *p;
231-
}
232-
233-
return NULL;
234-
}
235-
236210
static const struct measure_clk *find_clock(const struct debugcc_platform *platform,
237211
const char *name)
238212
{
@@ -309,7 +283,6 @@ static void usage(void)
309283
const struct debugcc_platform **p;
310284

311285
fprintf(stderr, "debugcc <-p platform> [-b blk] <-a | -l | clk>\n");
312-
fprintf(stderr, "<platform>-debugcc [-b blk] <-a | -l | clk>\n");
313286

314287
fprintf(stderr, "available platforms:");
315288
for (p = platforms; *p; p++)
@@ -350,11 +323,8 @@ int main(int argc, char **argv)
350323
}
351324
}
352325

353-
if (!platform) {
354-
platform = match_platform(argv[0]);
355-
if (!platform)
356-
usage();
357-
}
326+
if (!platform)
327+
usage();
358328

359329
if (do_list_clocks) {
360330
list_clocks_block(platform, block_name);

0 commit comments

Comments
 (0)