diff options
author | Kishon Vijay Abraham I <kishon@ti.com> | 2019-04-04 16:36:08 +0530 |
---|---|---|
committer | Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> | 2019-04-11 10:13:00 +0100 |
commit | fbca0b284bd02bf83c9813168d1a58b6ec54d1ca (patch) | |
tree | 7f99a5c3b8095fbd95eed9a87f9d3c080d677c69 | |
parent | ff7a5a0a8562434f114035a5a4cbbeec5cb6320c (diff) | |
download | lwn-fbca0b284bd02bf83c9813168d1a58b6ec54d1ca.tar.gz lwn-fbca0b284bd02bf83c9813168d1a58b6ec54d1ca.zip |
tools: PCI: Add 'h' in optstring of getopt()
'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 <kishon@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
-rw-r--r-- | tools/pci/pcitest.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/pci/pcitest.c b/tools/pci/pcitest.c index 310a7e4850f6..5fa5c2bdd427 100644 --- a/tools/pci/pcitest.c +++ b/tools/pci/pcitest.c @@ -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; @@ -207,7 +207,6 @@ int main(int argc, char **argv) case 's': test->size = strtoul(optarg, NULL, 0); continue; - case '?': case 'h': default: usage: @@ -225,6 +224,7 @@ usage: "\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; } |