v01d commented on a change in pull request #2369:
URL: https://github.com/apache/incubator-nuttx/pull/2369#discussion_r528347287



##########
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:
       I'm not following why do you need an extra function with an extra 
parameter when the lower half struct already gives this information directly. 
Isn't actually `lower->buffer_size` what is needed?




----------------------------------------------------------------
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


Reply via email to