From 3ab62370cbbe126ef79e96af252e49e2bf357fbc Mon Sep 17 00:00:00 2001 From: wangjianyu3 Date: Thu, 19 Sep 2024 16:36:10 +0800 Subject: [PATCH] nuttx/uorb: Fix initialization error of variable of type `struct sensor_ops_s` Related change: .flush : 403469336f27568e64a04bbab8c9a1bb68e61f75 .get_info : 703bb7e7b3a1207951bf4f10dfab34c263c18fd9 Error Log: 1153 Building NuttX... 1154Error: sensors/bme680_uorb.c:428:3: error: initialization of 'int (*)(struct sensor_lowerhalf_s *, struct file *, long unsigned int)' from incompatible pointer type 'int (*)(struct sensor_lowerhalf_s *, struct file *, int, long unsigned int)' [-Werror=incompatible-pointer-types] 1155 428 | bme680_control /* control */ 1156 | ^~~~~~~~~~~~~~ Signed-off-by: wangjianyu3 --- drivers/sensors/adxl362_uorb.c | 2 ++ drivers/sensors/adxl372_uorb.c | 2 ++ drivers/sensors/bh1749nuc_uorb.c | 2 ++ drivers/sensors/bme680_uorb.c | 2 ++ drivers/sensors/bmi270_uorb.c | 2 ++ drivers/sensors/bmm150_uorb.c | 2 ++ drivers/sensors/lsm9ds1_uorb.c | 2 ++ drivers/sensors/ltr308_uorb.c | 2 ++ drivers/sensors/mpu9250_uorb.c | 2 ++ 9 files changed, 18 insertions(+) diff --git a/drivers/sensors/adxl362_uorb.c b/drivers/sensors/adxl362_uorb.c index b1842e5bee..9fd1bdfb93 100644 --- a/drivers/sensors/adxl362_uorb.c +++ b/drivers/sensors/adxl362_uorb.c @@ -157,9 +157,11 @@ static const struct sensor_ops_s g_adxl362_accel_ops = #else adxl362_fetch, #endif + NULL, /* flush */ NULL, /* selftest */ NULL, /* set_calibvalue */ NULL, /* calibrate */ + NULL, /* get_info */ NULL, /* control */ }; diff --git a/drivers/sensors/adxl372_uorb.c b/drivers/sensors/adxl372_uorb.c index cbfe7a0f43..04c11efb34 100644 --- a/drivers/sensors/adxl372_uorb.c +++ b/drivers/sensors/adxl372_uorb.c @@ -105,9 +105,11 @@ static const struct sensor_ops_s g_adxl372_accel_ops = #else adxl372_fetch, #endif + NULL, /* flush */ NULL, /* selftest */ NULL, /* set_calibvalue */ NULL, /* calibrate */ + NULL /* get_info */ NULL /* control */ }; diff --git a/drivers/sensors/bh1749nuc_uorb.c b/drivers/sensors/bh1749nuc_uorb.c index 53f3debb84..aa5ff1f159 100644 --- a/drivers/sensors/bh1749nuc_uorb.c +++ b/drivers/sensors/bh1749nuc_uorb.c @@ -114,9 +114,11 @@ static const struct sensor_ops_s g_bh1749nuc_sensor_ops = #else bh1749nuc_fetch, #endif + NULL, /* flush */ NULL, /* selftest */ NULL, /* set_calibvalue */ NULL, /* calibrate */ + NULL, /* get_info */ bh1749nuc_control }; diff --git a/drivers/sensors/bme680_uorb.c b/drivers/sensors/bme680_uorb.c index 6392734e11..14d6dcc00d 100644 --- a/drivers/sensors/bme680_uorb.c +++ b/drivers/sensors/bme680_uorb.c @@ -422,9 +422,11 @@ static const struct sensor_ops_s g_sensor_ops = NULL, /* set_interval */ NULL, /* batch */ NULL, /* fetch */ + NULL, /* flush */ NULL, /* selftest */ NULL, /* set_calibvalue */ bme680_calibrate, /* calibrate */ + NULL, /* get_info */ bme680_control /* control */ }; diff --git a/drivers/sensors/bmi270_uorb.c b/drivers/sensors/bmi270_uorb.c index 25b1f8431d..95e0923752 100644 --- a/drivers/sensors/bmi270_uorb.c +++ b/drivers/sensors/bmi270_uorb.c @@ -126,9 +126,11 @@ static const struct sensor_ops_s g_sensor_ops = #else bmi270_fetch, #endif + NULL, /* flush */ NULL, /* selftest */ NULL, /* set_calibvalue */ NULL, /* calibrate */ + NULL, /* get_info */ bmi270_control }; diff --git a/drivers/sensors/bmm150_uorb.c b/drivers/sensors/bmm150_uorb.c index 30ce9b5509..001ad036aa 100644 --- a/drivers/sensors/bmm150_uorb.c +++ b/drivers/sensors/bmm150_uorb.c @@ -180,9 +180,11 @@ static const struct sensor_ops_s g_bmm150_sensor_ops = #else bmm150_fetch, #endif + NULL, /* flush */ NULL, /* selftest */ NULL, /* set_calibvalue */ NULL, /* calibrate */ + NULL, /* get_info */ NULL, /* control */ }; diff --git a/drivers/sensors/lsm9ds1_uorb.c b/drivers/sensors/lsm9ds1_uorb.c index df8879b394..062e61757c 100644 --- a/drivers/sensors/lsm9ds1_uorb.c +++ b/drivers/sensors/lsm9ds1_uorb.c @@ -129,9 +129,11 @@ static const struct sensor_ops_s g_sensor_ops = #else .fetch = lsm9ds1_fetch, #endif + NULL, /* flush */ NULL, /* selftest */ NULL, /* set_calibvalue */ NULL, /* calibrate */ + NULL, /* get_info */ .control = lsm9ds1_control }; diff --git a/drivers/sensors/ltr308_uorb.c b/drivers/sensors/ltr308_uorb.c index 2ff8ace35d..125c138371 100644 --- a/drivers/sensors/ltr308_uorb.c +++ b/drivers/sensors/ltr308_uorb.c @@ -97,9 +97,11 @@ static const struct sensor_ops_s g_sensor_ops = NULL, /* set_interval */ NULL, /* batch */ NULL, /* fetch */ + NULL, /* flush */ NULL, /* selftest */ NULL, /* set_calibvalue */ ltr308_calibrate, /* calibrate */ + NULL, /* get_info */ NULL /* control */ }; diff --git a/drivers/sensors/mpu9250_uorb.c b/drivers/sensors/mpu9250_uorb.c index a8697852b7..894c2842af 100644 --- a/drivers/sensors/mpu9250_uorb.c +++ b/drivers/sensors/mpu9250_uorb.c @@ -374,9 +374,11 @@ static const struct sensor_ops_s g_mpu9250_ops = mpu9250_set_interval, /* set_interval */ NULL, /* batch */ NULL, /* fetch */ + NULL, /* flush */ NULL, /* selftest */ NULL, /* set_calibvalue */ NULL, /* calibrate */ + NULL, /* get_info */ mpu9250_control /* control */ };