From a8b85ea21b053145527a848b51b57f5c0cfa003e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= Date: Wed, 9 Sep 2015 16:47:29 +0300 Subject: [PATCH] tools/intel_display_poller: Make pipe name alphabetic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instead of raw numbers the user can now specify the pipe as 'a',b'... or 'A','B'... Signed-off-by: Ville Syrjälä --- tools/intel_display_poller.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tools/intel_display_poller.c b/tools/intel_display_poller.c index 8b66b53e..99fd5929 100644 --- a/tools/intel_display_poller.c +++ b/tools/intel_display_poller.c @@ -1010,7 +1010,17 @@ int main(int argc, char *argv[]) usage(argv[0]); break; case 'p': - pipe = atoi(optarg); + if (optarg[1] != '\0') + usage(argv[0]); + pipe = optarg[0]; + if (pipe >= 'a') + pipe -= 'a'; + else if (pipe >= 'A') + pipe -= 'A'; + else if (pipe >= '0') + pipe -= '0'; + else + usage(argv[0]); if (pipe < 0 || pipe > 2) usage(argv[0]); break;