acassis commented on code in PR #17824:
URL: https://github.com/apache/nuttx/pull/17824#discussion_r2681913994
##########
drivers/sensors/sensor.c:
##########
@@ -613,7 +613,7 @@ static int sensor_open(FAR struct file *filep)
goto errout_with_lock;
}
- if (lower->ops->open)
+ if ((filep->f_oflags & O_DIRECT) == 0 && lower->ops->open)
Review Comment:
Please include comment explaining the idea. Why do you need to check if
O_DIRECT flag is set?
##########
drivers/sensors/sensor.c:
##########
@@ -622,31 +622,28 @@ static int sensor_open(FAR struct file *filep)
}
}
- if ((filep->f_oflags & O_DIRECT) == 0)
+ if (filep->f_oflags & O_RDOK)
Review Comment:
Also it is good to have a comment before this block
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]