Use toupper to simplify serial number check
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Change-Id: Ib9c7c68339fc42780b84e7f7ca8bf0ac0757e617
Reviewed-on: https://review.coreboot.org/c/em100/+/48727
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: ron minnich <rminnich@gmail.com>
diff --git a/em100.c b/em100.c
index 90ea803..67ac43c 100644
--- a/em100.c
+++ b/em100.c
@@ -17,6 +17,7 @@
#include <strings.h>
#include <getopt.h>
#include <unistd.h>
+#include <ctype.h>
#include <dirent.h>
#include <errno.h>
#include <sys/stat.h>
@@ -911,10 +912,8 @@
firmware_is_dpfw = 1;
break;
case 'x':
- if (((optarg[0] == 'D' || optarg[0] == 'd') &&
- (optarg[1] == 'P' || optarg[1] == 'p')) ||
- ((optarg[0] == 'E' || optarg[0] == 'e') &&
- (optarg[1] == 'M' || optarg[1] == 'm')))
+ if ((toupper(optarg[0]) == 'D' && toupper(optarg[1]) == 'P') ||
+ (toupper(optarg[0]) == 'E' && toupper(optarg[1]) == 'M'))
sscanf(optarg + 2, "%d", &serial_number);
else
sscanf(optarg, "%d:%d", &bus, &device);