Skip to content

Commit

Permalink
tools: PCI: Add 'h' in optstring of getopt()
Browse files Browse the repository at this point in the history
'h' is a valid option character for the pcitest tool used to print
the pcitest usage.

Add 'h' in optstring of getopt() in order to get rid of "pcitest:
invalid option -- 'h'" warning.

While at that remove unncessary case '?'.

Signed-off-by: Kishon Vijay Abraham I <[email protected]>
Signed-off-by: Sekhar Nori <[email protected]>
Signed-off-by: Lorenzo Pieralisi <[email protected]>
  • Loading branch information
kishon authored and Lorenzo Pieralisi committed Apr 11, 2019
1 parent ff7a5a0 commit fbca0b2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/pci/pcitest.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ int main(int argc, char **argv)
/* set default endpoint device */
test->device = "/dev/pci-endpoint-test.0";

while ((c = getopt(argc, argv, "D:b:m:x:i:Ilrwcs:")) != EOF)
while ((c = getopt(argc, argv, "D:b:m:x:i:Ilhrwcs:")) != EOF)
switch (c) {
case 'D':
test->device = optarg;
Expand Down Expand Up @@ -207,7 +207,6 @@ int main(int argc, char **argv)
case 's':
test->size = strtoul(optarg, NULL, 0);
continue;
case '?':
case 'h':
default:
usage:
Expand All @@ -225,6 +224,7 @@ int main(int argc, char **argv)
"\t-w Write buffer test\n"
"\t-c Copy buffer test\n"
"\t-s <size> Size of buffer {default: 100KB}\n",
"\t-h Print this help message\n",
argv[0]);
return -EINVAL;
}
Expand Down

0 comments on commit fbca0b2

Please sign in to comment.