v01d commented on a change in pull request #2369: URL: https://github.com/apache/incubator-nuttx/pull/2369#discussion_r528357663
########## File path: drivers/sensors/sensor.c ########## @@ -651,22 +682,22 @@ int sensor_register(FAR struct sensor_lowerhalf_s *lower, int devno) { if (!lower->buffer_size) { - lower->buffer_size = g_sensor_info[lower->type].esize; + lower->buffer_size = esize; + } + else + { + lower->buffer_size = ROUNDUP(lower->buffer_size, esize); } lower->push_event = sensor_push_event; } else { lower->notify_event = sensor_notify_event; + lower->buffer_size = 0; Review comment: Ok. Seems strange to me to allow partial writes of a fixed struct. Would make more sense to me to specify the number of elements and the element size. But that is unrelated to this PR. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org