diff --git a/drivers/sensors/gnss_uorb.c b/drivers/sensors/gnss_uorb.c index 257543e88e..1567fb00e0 100644 --- a/drivers/sensors/gnss_uorb.c +++ b/drivers/sensors/gnss_uorb.c @@ -168,7 +168,8 @@ static int gnss_activate(FAR struct sensor_lowerhalf_s *lower, int ret = OK; nxmutex_lock(&upper->lock); - if ((upper->crefs == 255 && enable) || (upper->crefs == 0 && !enable)) + if ((upper->crefs == UINT8_MAX && enable) || + (upper->crefs == 0 && !enable)) { ret = -EINVAL; } @@ -233,7 +234,7 @@ static int gnss_open(FAR struct file *filep) } nxmutex_lock(&upper->lock); - if (upper->crefs >= 255) + if (upper->crefs >= UINT8_MAX) { ret = -EMFILE; kmm_free(user);