Skip to content

Commit

Permalink
nuttx/uorb: Fix incompatible type error
Browse files Browse the repository at this point in the history
Related: b17c074

Log:
  Error: sensors/ms56xx_uorb.c:145:20: error: initialization of 'int (*)(struct sensor_lowerhalf_s *, struct file *, uint32_t *)' {aka 'int (*)(struct sensor_lowerhalf_s *, struct file *, unsigned int *)'} from incompatible pointer type 'int (*)(struct sensor_lowerhalf_s *, struct file *, long unsigned int *)' [-Werror=incompatible-pointer-types]
    145 |   .set_interval  = ms56xx_set_interval,
        |                    ^~~~~~~~~~~~~~~~~~~
  sensors/ms56xx_uorb.c:145:20: note: (near initialization for 'g_sensor_ops.set_interval')
  cc1: all warnings being treated as errors

Signed-off-by: wangjianyu3 <[email protected]>
  • Loading branch information
JianyuWang0623 committed Sep 19, 2024
1 parent bde2ac0 commit c71df76
Show file tree
Hide file tree
Showing 12 changed files with 38 additions and 38 deletions.
8 changes: 4 additions & 4 deletions drivers/sensors/adxl362_uorb.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ struct adxl362_sensor_s
float scale;
#ifdef CONFIG_SENSORS_ADXL362_POLL
bool enabled;
unsigned long interval;
uint32_t interval;
sem_t run;
#endif
};
Expand All @@ -134,7 +134,7 @@ static int adxl362_activate(FAR struct sensor_lowerhalf_s *lower,
bool enable);
static int adxl362_set_interval(FAR struct sensor_lowerhalf_s *lower,
FAR struct file *filep,
FAR unsigned long *period_us);
FAR uint32_t *period_us);
#ifndef CONFIG_SENSORS_ADXL362_POLL
static int adxl362_fetch(FAR struct sensor_lowerhalf_s *lower,
FAR struct file *filep,
Expand Down Expand Up @@ -447,7 +447,7 @@ static int adxl362_activate(FAR struct sensor_lowerhalf_s *lower,

static int adxl362_set_interval(FAR struct sensor_lowerhalf_s *lower,
FAR struct file *filep,
FAR unsigned long *period_us)
FAR uint32_t *period_us)
{
#ifdef CONFIG_SENSORS_ADXL362_POLL
FAR struct adxl362_sensor_s *priv = (FAR struct adxl362_sensor_s *)lower;
Expand All @@ -460,7 +460,7 @@ static int adxl362_set_interval(FAR struct sensor_lowerhalf_s *lower,

#ifndef CONFIG_SENSORS_ADXL362_POLL
/****************************************************************************
* Name: adxl362_set_interval
* Name: adxl362_fetch
****************************************************************************/

static int adxl362_fetch(FAR struct sensor_lowerhalf_s *lower,
Expand Down
6 changes: 3 additions & 3 deletions drivers/sensors/adxl372_uorb.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ struct adxl372_sensor_s
int devno;
#ifdef CONFIG_SENSORS_ADXL372_POLL
bool enabled;
unsigned long interval;
uint32_t interval;
sem_t run;
#endif
};
Expand All @@ -82,7 +82,7 @@ static int adxl372_activate(FAR struct sensor_lowerhalf_s *lower,
bool enable);
static int adxl372_set_interval(FAR struct sensor_lowerhalf_s *lower,
FAR struct file *filep,
FAR unsigned long *period_us);
FAR uint32_t *period_us);
#ifndef CONFIG_SENSORS_ADXL372_POLL
static int adxl372_fetch(FAR struct sensor_lowerhalf_s *lower,
FAR struct file *filep,
Expand Down Expand Up @@ -412,7 +412,7 @@ static int adxl372_activate(FAR struct sensor_lowerhalf_s *lower,

static int adxl372_set_interval(FAR struct sensor_lowerhalf_s *lower,
FAR struct file *filep,
FAR unsigned long *period_us)
FAR uint32_t *period_us)
{
#ifdef CONFIG_SENSORS_ADXL372_POLL
FAR struct adxl372_sensor_s *priv = (FAR struct adxl372_sensor_s *)lower;
Expand Down
6 changes: 3 additions & 3 deletions drivers/sensors/bh1749nuc_uorb.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ struct bh1749nuc_sensor_s
int gain;
FAR struct bh1749nuc_sensor_dev_s *dev;
#ifdef CONFIG_SENSORS_BH1749NUC_POLL
unsigned long interval;
uint32_t interval;
uint64_t last_update;
#endif
bool enabled;
Expand Down Expand Up @@ -93,7 +93,7 @@ static int bh1749nuc_fetch(FAR struct sensor_lowerhalf_s *lower,
#endif
static int bh1749nuc_set_interval(FAR struct sensor_lowerhalf_s *lower,
FAR struct file *filep,
FAR unsigned long *period_us);
FAR uint32_t *period_us);
static int bh1749nuc_control(FAR struct sensor_lowerhalf_s *lower,
FAR struct file *filep,
int cmd, unsigned long arg);
Expand Down Expand Up @@ -301,7 +301,7 @@ static int bh1749nuc_control(FAR struct sensor_lowerhalf_s *lower,

static int bh1749nuc_set_interval(FAR struct sensor_lowerhalf_s *lower,
FAR struct file *filep,
FAR unsigned long *interval)
FAR uint32_t *interval)
{
#ifdef CONFIG_SENSORS_BH1749NUC_POLL
FAR struct bh1749nuc_sensor_s *priv = NULL;
Expand Down
8 changes: 4 additions & 4 deletions drivers/sensors/bmi270_uorb.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ struct bmi270_sensor_s
FAR void *dev;
bool enabled;
#ifdef CONFIG_SENSORS_BMI270_POLL
unsigned long interval;
uint32_t interval;
#endif
struct bmi270_dev_s base;
};
Expand All @@ -93,7 +93,7 @@ static int bmi270_activate(FAR struct sensor_lowerhalf_s *lower,
bool enable);
static int bmi270_set_interval(FAR struct sensor_lowerhalf_s *lower,
FAR struct file *filep,
FAR unsigned long *period_us);
FAR uint32_t *period_us);
#ifndef CONFIG_SENSORS_BMI270_POLL
static int bmi270_fetch(FAR struct sensor_lowerhalf_s *lower,
FAR struct file *filep,
Expand Down Expand Up @@ -209,7 +209,7 @@ static int bmi270_activate(FAR struct sensor_lowerhalf_s *lower,

static int bmi270_set_interval(FAR struct sensor_lowerhalf_s *lower,
FAR struct file *filep,
FAR unsigned long *interval)
FAR uint32_t *interval)
{
#ifdef CONFIG_SENSORS_BMI270_POLL
FAR struct bmi270_sensor_s *priv = NULL;
Expand All @@ -224,7 +224,7 @@ static int bmi270_set_interval(FAR struct sensor_lowerhalf_s *lower,

#ifndef CONFIG_SENSORS_BMI270_POLL
/****************************************************************************
* Name: bmi270_set_interval
* Name: bmi270_fetch
****************************************************************************/

static int bmi270_fetch(FAR struct sensor_lowerhalf_s *lower,
Expand Down
6 changes: 3 additions & 3 deletions drivers/sensors/bmm150_uorb.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ struct bmm150_sensor_dev_s
uint32_t freq;
mutex_t lock;
#ifdef CONFIG_SENSORS_BMM150_POLL
unsigned long interval;
uint32_t interval;
uint64_t last_update;
sem_t run;
#endif
Expand All @@ -153,7 +153,7 @@ static int bmm150_fetch(FAR struct sensor_lowerhalf_s *lower,
#endif
static int bmm150_set_interval(FAR struct sensor_lowerhalf_s *lower,
FAR struct file *filep,
FAR unsigned long *period_us);
FAR uint32_t *period_us);

/* Helpers */

Expand Down Expand Up @@ -579,7 +579,7 @@ static int bmm150_fetch(FAR struct sensor_lowerhalf_s *lower,

static int bmm150_set_interval(FAR struct sensor_lowerhalf_s *lower,
FAR struct file *filep,
FAR unsigned long *interval)
FAR uint32_t *interval)
{
#ifdef CONFIG_SENSORS_BMM150_POLL
FAR struct bmm150_sensor_dev_s *dev =
Expand Down
6 changes: 3 additions & 3 deletions drivers/sensors/bmp180_uorb.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ struct bmp180_dev_uorb_s

struct sensor_lowerhalf_s lower; /* Lower half sensor driver. */
struct work_s work; /* Interrupt handler worker. */
unsigned long interval; /* Sensor acquisition interval. */
uint32_t interval; /* Sensor acquisition interval. */
struct bmp180_dev_s dev;
};
/****************************************************************************
Expand All @@ -57,7 +57,7 @@ struct bmp180_dev_uorb_s
static void bmp180_worker(FAR void *arg);
static int bmp180_set_interval(FAR struct sensor_lowerhalf_s *lower,
FAR struct file *filep,
FAR unsigned long *period_us);
FAR uint32_t *period_us);
static int bmp180_activate(FAR struct sensor_lowerhalf_s *lower,
FAR struct file *filep,
bool enable);
Expand Down Expand Up @@ -101,7 +101,7 @@ static const struct sensor_ops_s g_bmp180_ops =

static int bmp180_set_interval(FAR struct sensor_lowerhalf_s *lower,
FAR struct file *filep,
FAR unsigned long *period_us)
FAR uint32_t *period_us)
{
FAR struct bmp180_dev_uorb_s *priv = (FAR struct bmp180_dev_uorb_s *)lower;

Expand Down
4 changes: 2 additions & 2 deletions drivers/sensors/bmp280_uorb.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ static int bmp280_putreg8(FAR struct bmp280_dev_s *priv, uint8_t regaddr,

static int bmp280_set_interval(FAR struct sensor_lowerhalf_s *lower,
FAR struct file *filep,
FAR unsigned long *period_us);
FAR uint32_t *period_us);
static int bmp280_activate(FAR struct sensor_lowerhalf_s *lower,
FAR struct file *filep,
bool enable);
Expand Down Expand Up @@ -512,7 +512,7 @@ static uint32_t bmp280_compensate_press(FAR struct bmp280_dev_s *priv,

static int bmp280_set_interval(FAR struct sensor_lowerhalf_s *lower,
FAR struct file *filep,
FAR unsigned long *period_us)
FAR uint32_t *period_us)
{
FAR struct bmp280_dev_s *priv = container_of(lower,
FAR struct bmp280_dev_s,
Expand Down
6 changes: 3 additions & 3 deletions drivers/sensors/ds18b20_uorb.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ struct ds18b20_dev_s
struct onewire_config_s config; /* 1wire device configuration */
struct ds18b20_config_s reg; /* Sensor resolution */
#ifdef CONFIG_SENSORS_DS18B20_POLL
unsigned long interval; /* Polling interval */
uint32_t interval; /* Polling interval */
sem_t run; /* Locks sensor thread */
#endif
};
Expand All @@ -172,7 +172,7 @@ static int ds18b20_control(FAR struct sensor_lowerhalf_s *lower,
#ifdef CONFIG_SENSORS_DS18B20_POLL
static int ds18b20_set_interval(FAR struct sensor_lowerhalf_s *lower,
FAR struct file *filep,
FAR unsigned long *period_us);
FAR uint32_t *period_us);
#endif

/****************************************************************************
Expand Down Expand Up @@ -787,7 +787,7 @@ static int ds18b20_active(FAR struct sensor_lowerhalf_s *lower,
#ifdef CONFIG_SENSORS_DS18B20_POLL
static int ds18b20_set_interval(FAR struct sensor_lowerhalf_s *lower,
FAR struct file *filep,
FAR unsigned long *period_us)
FAR uint32_t *period_us)
{
FAR struct ds18b20_dev_s *priv = (FAR struct ds18b20_dev_s *)lower;
priv->interval = *period_us;
Expand Down
6 changes: 3 additions & 3 deletions drivers/sensors/hyt271_uorb.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ struct hyt271_dev_s
mutex_t lock_measure_cycle; /* Locks measure cycle */
uint32_t freq; /* I2C Frequency */
#ifdef CONFIG_SENSORS_HYT271_POLL
unsigned long interval; /* Polling interval */
uint32_t interval; /* Polling interval */
sem_t run; /* Locks sensor thread */
bool initial_read; /* Already read */
#endif
Expand All @@ -123,7 +123,7 @@ static int hyt271_control(FAR struct sensor_lowerhalf_s *lower,
#ifdef CONFIG_SENSORS_HYT271_POLL
static int hyt271_set_interval(FAR struct sensor_lowerhalf_s *lower,
FAR struct file *filep,
FAR unsigned long *period_us);
FAR uint32_t *period_us);
#endif

/****************************************************************************
Expand Down Expand Up @@ -758,7 +758,7 @@ static int hyt271_active(FAR struct sensor_lowerhalf_s *lower,
#ifdef CONFIG_SENSORS_HYT271_POLL
static int hyt271_set_interval(FAR struct sensor_lowerhalf_s *lower,
FAR struct file *filep,
FAR unsigned long *period_us)
FAR uint32_t *period_us)
{
FAR struct hyt271_sensor_s *priv = (FAR struct hyt271_sensor_s *)lower;
priv->dev->interval = *period_us;
Expand Down
8 changes: 4 additions & 4 deletions drivers/sensors/lsm9ds1_uorb.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ struct lsm9ds1_sensor_s
FAR void *dev;
#ifdef CONFIG_SENSORS_LSM9DS1_POLL
bool enabled;
unsigned long interval;
uint32_t interval;
#endif
struct lsm9ds1_dev_s base;
};
Expand All @@ -94,7 +94,7 @@ static int lsm9ds1_activate(FAR struct sensor_lowerhalf_s *lower,
bool enable);
static int lsm9ds1_set_interval(FAR struct sensor_lowerhalf_s *lower,
FAR struct file *filep,
FAR unsigned long *period_us);
FAR uint32_t *period_us);
#ifndef CONFIG_SENSORS_LSM9DS1_POLL
static int lsm9ds1_fetch(FAR struct sensor_lowerhalf_s *lower,
FAR struct file *filep,
Expand Down Expand Up @@ -193,7 +193,7 @@ static int lsm9ds1_activate(FAR struct sensor_lowerhalf_s *lower,

static int lsm9ds1_set_interval(FAR struct sensor_lowerhalf_s *lower,
FAR struct file *filep,
FAR unsigned long *interval)
FAR uint32_t *interval)
{
#ifdef CONFIG_SENSORS_LSM9DS1_POLL
FAR struct lsm9ds1_sensor_s *priv = NULL;
Expand Down Expand Up @@ -242,7 +242,7 @@ static int16_t lsm9ds1_data(int16_t data)

#ifndef CONFIG_SENSORS_LSM9DS1_POLL
/****************************************************************************
* Name: lsm9ds1_set_interval
* Name: lsm9ds1_fetch
****************************************************************************/

static int lsm9ds1_fetch(FAR struct sensor_lowerhalf_s *lower,
Expand Down
6 changes: 3 additions & 3 deletions drivers/sensors/mpu9250_uorb.c
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ struct mpu9250_sensor_s
bool enabled;
float scale;
float adj[3];
unsigned long interval;
uint32_t interval;
FAR void *dev; /* The pointer to common device data of mpu9250 */
};

Expand All @@ -340,7 +340,7 @@ struct mpu9250_dev_s

static int mpu9250_set_interval(FAR struct sensor_lowerhalf_s *lower,
FAR struct file *filep,
FAR unsigned long *period_us);
FAR uint32_t *period_us);
static int mpu9250_activate(FAR struct sensor_lowerhalf_s *lower,
FAR struct file *filep, bool enable);
static int mpu9250_control(FAR struct sensor_lowerhalf_s *lower,
Expand Down Expand Up @@ -434,7 +434,7 @@ static int mpu9250_activate(FAR struct sensor_lowerhalf_s *lower,

static int mpu9250_set_interval(FAR struct sensor_lowerhalf_s *lower,
FAR struct file *filep,
FAR unsigned long *interval)
FAR uint32_t *interval)
{
FAR struct mpu9250_sensor_s *priv = (FAR struct mpu9250_sensor_s *)lower;

Expand Down
6 changes: 3 additions & 3 deletions drivers/sensors/ms56xx_uorb.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ struct ms56xx_dev_s
enum ms56xx_model_e model; /* Model of MS56XX */
uint32_t freq; /* Bus Frequency I2C/SPI */
struct ms56xx_calib_s calib; /* Calib. params from ROM */
unsigned long interval; /* Polling interval */
uint32_t interval; /* Polling interval */
bool enabled; /* Enable/Disable MS56XX */
sem_t run; /* Locks measure cycle */
mutex_t lock; /* Manages exclusive to device */
Expand Down Expand Up @@ -125,7 +125,7 @@ static unsigned long ms56xx_curtime(void);

static int ms56xx_set_interval(FAR struct sensor_lowerhalf_s *lower,
FAR struct file *filep,
FAR unsigned long *period_us);
FAR uint32_t *period_us);
static int ms56xx_activate(FAR struct sensor_lowerhalf_s *lower,
FAR struct file *filep, bool enable);

Expand Down Expand Up @@ -614,7 +614,7 @@ static uint32_t ms56xx_compensate_press(FAR struct ms56xx_dev_s *priv,

static int ms56xx_set_interval(FAR struct sensor_lowerhalf_s *lower,
FAR struct file *filep,
FAR unsigned long *period_us)
FAR uint32_t *period_us)
{
FAR struct ms56xx_dev_s *priv = container_of(lower,
FAR struct ms56xx_dev_s,
Expand Down

0 comments on commit c71df76

Please sign in to comment.