[#17] Update version check to use #defines

pull/18/head
Doug Potts 2023-09-06 08:35:07 -04:00
parent f67b4b3620
commit 238e7105be
1 changed files with 3 additions and 3 deletions

View File

@ -57,8 +57,8 @@
#define KO_DESC "Netdevice driver for Intrepid CAN/Ethernet devices" #define KO_DESC "Netdevice driver for Intrepid CAN/Ethernet devices"
#define KO_MAJOR 3 #define KO_MAJOR 3
#define KO_MINOR 0 #define KO_MINOR 1
#define KO_PATCH 2 #define KO_PATCH 0
#define KO_VERSION str(KO_MAJOR) "." str(KO_MINOR) "." str(KO_PATCH) #define KO_VERSION str(KO_MAJOR) "." str(KO_MINOR) "." str(KO_PATCH)
#define KO_VERSION_INT (KO_MAJOR << 16) | (KO_MINOR << 8) | KO_PATCH #define KO_VERSION_INT (KO_MAJOR << 16) | (KO_MINOR << 8) | KO_PATCH
@ -976,7 +976,7 @@ static long intrepid_dev_ioctl(struct file *fp, unsigned int cmd, unsigned long
ret = KO_VERSION_INT; ret = KO_VERSION_INT;
break; break;
case SIOCGCLIENTVEROK: case SIOCGCLIENTVEROK:
if (VER_MAJ_FROM_INT(arg) == 3 && VER_MIN_FROM_INT(arg) == 0 && VER_PATCH_FROM_INT(arg) >= 0) if (VER_MAJ_FROM_INT(arg) == KO_MAJOR && VER_MIN_FROM_INT(arg) == KO_MINOR && VER_PATCH_FROM_INT(arg) >= 0)
ret = 0; /* ok to start */ ret = 0; /* ok to start */
else else
ret = 1; ret = 1;