file_operations: get back C89 compatible initializer

Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
This commit is contained in:
Petro Karashchenko
2022-01-10 16:51:17 +02:00
committed by Xiang Xiao
parent 2447b7bd9a
commit a743fed63d
120 changed files with 868 additions and 675 deletions
+5 -4
View File
@@ -202,11 +202,12 @@ static const struct file_operations g_adcops =
cxd56_adc_open, /* open */ cxd56_adc_open, /* open */
cxd56_adc_close, /* close */ cxd56_adc_close, /* close */
cxd56_adc_read, /* read */ cxd56_adc_read, /* read */
0, /* write */ NULL, /* write */
0, /* seek */ NULL, /* seek */
cxd56_adc_ioctl, /* ioctl */ cxd56_adc_ioctl, /* ioctl */
#ifndef CONFIG_DISABLE_POLL NULL /* poll */
0, /* poll */ #ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
, NULL /* unlink */
#endif #endif
}; };
+3 -5
View File
@@ -96,11 +96,9 @@ static const struct file_operations g_chargerops =
charger_close, /* close */ charger_close, /* close */
charger_read, /* read */ charger_read, /* read */
charger_write, /* write */ charger_write, /* write */
0, /* seek */ NULL, /* seek */
charger_ioctl /* ioctl */ charger_ioctl, /* ioctl */
#ifndef CONFIG_DISABLE_POLL NULL /* poll */
, NULL /* poll */
#endif
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS #ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
, NULL /* unlink */ , NULL /* unlink */
#endif #endif
+3 -5
View File
@@ -81,11 +81,9 @@ static const struct file_operations g_gaugeops =
gauge_close, /* close */ gauge_close, /* close */
gauge_read, /* read */ gauge_read, /* read */
gauge_write, /* write */ gauge_write, /* write */
0, /* seek */ NULL, /* seek */
gauge_ioctl /* ioctl */ gauge_ioctl, /* ioctl */
#ifndef CONFIG_DISABLE_POLL NULL /* poll */
, NULL /* poll */
#endif
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS #ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
, NULL /* unlink */ , NULL /* unlink */
#endif #endif
+5 -8
View File
@@ -76,11 +76,9 @@ static ssize_t cxd56_geofence_read(FAR struct file *filep,
static int cxd56_geofence_ioctl(FAR struct file *filep, static int cxd56_geofence_ioctl(FAR struct file *filep,
int cmd, int cmd,
unsigned long arg); unsigned long arg);
#ifndef CONFIG_DISABLE_POLL
static int cxd56_geofence_poll(FAR struct file *filep, static int cxd56_geofence_poll(FAR struct file *filep,
FAR struct pollfd *fds, FAR struct pollfd *fds,
bool setup); bool setup);
#endif
/* ioctl command functions */ /* ioctl command functions */
@@ -106,11 +104,12 @@ static const struct file_operations g_geofencefops =
cxd56_geofence_open, /* open */ cxd56_geofence_open, /* open */
cxd56_geofence_close, /* close */ cxd56_geofence_close, /* close */
cxd56_geofence_read, /* read */ cxd56_geofence_read, /* read */
0, /* write */ NULL, /* write */
0, /* seek */ NULL, /* seek */
cxd56_geofence_ioctl, /* ioctl */ cxd56_geofence_ioctl, /* ioctl */
#ifndef CONFIG_DISABLE_POLL cxd56_geofence_poll /* poll */
cxd56_geofence_poll, /* poll */ #ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
, NULL /* unlink */
#endif #endif
}; };
@@ -607,7 +606,6 @@ static int cxd56_geofence_ioctl(FAR struct file *filep, int cmd,
* *
****************************************************************************/ ****************************************************************************/
#ifndef CONFIG_DISABLE_POLL
static int cxd56_geofence_poll(FAR struct file *filep, static int cxd56_geofence_poll(FAR struct file *filep,
FAR struct pollfd *fds, FAR struct pollfd *fds,
bool setup) bool setup)
@@ -674,7 +672,6 @@ errout:
nxsem_post(&priv->devsem); nxsem_post(&priv->devsem);
return ret; return ret;
} }
#endif
/**************************************************************************** /****************************************************************************
* Name: cxd56_geofence_register * Name: cxd56_geofence_register
+4 -7
View File
@@ -293,10 +293,8 @@ static ssize_t cxd56_gnss_write(FAR struct file *filep,
FAR const char *buffer, size_t buflen); FAR const char *buffer, size_t buflen);
static int cxd56_gnss_ioctl(FAR struct file *filep, int cmd, static int cxd56_gnss_ioctl(FAR struct file *filep, int cmd,
unsigned long arg); unsigned long arg);
#ifndef CONFIG_DISABLE_POLL
static int cxd56_gnss_poll(FAR struct file *filep, FAR struct pollfd *fds, static int cxd56_gnss_poll(FAR struct file *filep, FAR struct pollfd *fds,
bool setup); bool setup);
#endif
static int8_t cxd56_gnss_select_notifytype(off_t fpos, uint32_t *offset); static int8_t cxd56_gnss_select_notifytype(off_t fpos, uint32_t *offset);
static int cxd56_gnss_cpufifo_api(FAR struct file *filep, static int cxd56_gnss_cpufifo_api(FAR struct file *filep,
@@ -315,10 +313,11 @@ static const struct file_operations g_gnssfops =
cxd56_gnss_close, /* close */ cxd56_gnss_close, /* close */
cxd56_gnss_read, /* read */ cxd56_gnss_read, /* read */
cxd56_gnss_write, /* write */ cxd56_gnss_write, /* write */
0, /* seek */ NULL, /* seek */
cxd56_gnss_ioctl, /* ioctl */ cxd56_gnss_ioctl, /* ioctl */
#ifndef CONFIG_DISABLE_POLL cxd56_gnss_poll /* poll */
cxd56_gnss_poll, /* poll */ #ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
, NULL /* unlink */
#endif #endif
}; };
@@ -2899,7 +2898,6 @@ static int cxd56_gnss_ioctl(FAR struct file *filep, int cmd,
* *
****************************************************************************/ ****************************************************************************/
#ifndef CONFIG_DISABLE_POLL
static int cxd56_gnss_poll(FAR struct file *filep, FAR struct pollfd *fds, static int cxd56_gnss_poll(FAR struct file *filep, FAR struct pollfd *fds,
bool setup) bool setup)
{ {
@@ -2965,7 +2963,6 @@ errout:
nxsem_post(&priv->devsem); nxsem_post(&priv->devsem);
return ret; return ret;
} }
#endif
/**************************************************************************** /****************************************************************************
* Name: cxd56_gnss_register * Name: cxd56_gnss_register
+7 -9
View File
@@ -66,17 +66,15 @@ static struct rng_dev_s g_rngdev;
static const struct file_operations g_rngops = static const struct file_operations g_rngops =
{ {
0, /* open */ NULL, /* open */
0, /* close */ NULL, /* close */
x86_rngread, /* read */ x86_rngread, /* read */
0, /* write */ NULL, /* write */
0, /* seek */ NULL, /* seek */
0 /* ioctl */ NULL, /* ioctl */
#ifndef CONFIG_DISABLE_POLL NULL /* poll */
, 0 /* poll */
#endif
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS #ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
, 0 /* unlink */ , NULL /* unlink */
#endif #endif
}; };
+3
View File
@@ -122,6 +122,9 @@ static const struct file_operations g_audioops =
NULL, /* seek */ NULL, /* seek */
audio_ioctl, /* ioctl */ audio_ioctl, /* ioctl */
NULL /* poll */ NULL /* poll */
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
, NULL /* unlink */
#endif
}; };
/**************************************************************************** /****************************************************************************
@@ -171,12 +171,12 @@ static const struct file_operations g_ak09912fops =
ak09912_close, /* close */ ak09912_close, /* close */
ak09912_read, /* read */ ak09912_read, /* read */
ak09912_write, /* write */ ak09912_write, /* write */
0, /* seek */ NULL, /* seek */
ak09912_ioctl, /* ioctl */ ak09912_ioctl, /* ioctl */
#ifndef CONFIG_DISABLE_POLL NULL /* poll */
0, /* poll */ #ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
, NULL /* unlink */
#endif #endif
0 /* unlink */
}; };
/* Take XYZ data, temperature and Status 2 register. /* Take XYZ data, temperature and Status 2 register.
@@ -181,12 +181,12 @@ static const struct file_operations g_apds9930alsfops =
apds9930_close_als, /* close */ apds9930_close_als, /* close */
apds9930_read_als, /* read */ apds9930_read_als, /* read */
apds9930_write, /* write */ apds9930_write, /* write */
0, /* seek */ NULL, /* seek */
apds9930_ioctl_als, /* ioctl */ apds9930_ioctl_als, /* ioctl */
#ifndef CONFIG_DISABLE_POLL NULL /* poll */
0, /* poll */ #ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
, NULL /* unlink */
#endif #endif
0 /* unlink */
}; };
/* Proximity sensor */ /* Proximity sensor */
@@ -197,12 +197,12 @@ static const struct file_operations g_apds9930psfops =
apds9930_close_ps, /* close */ apds9930_close_ps, /* close */
apds9930_read_ps, /* read */ apds9930_read_ps, /* read */
apds9930_write, /* write */ apds9930_write, /* write */
0, /* seek */ NULL, /* seek */
apds9930_ioctl_ps, /* ioctl */ apds9930_ioctl_ps, /* ioctl */
#ifndef CONFIG_DISABLE_POLL NULL /* poll */
0, /* poll */ #ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
, NULL /* unlink */
#endif #endif
0 /* unlink */
}; };
/* SCU instructions for pick ambient light sensing data. */ /* SCU instructions for pick ambient light sensing data. */
@@ -103,12 +103,12 @@ static const struct file_operations g_bh1721fvcfops =
bh1721fvc_close, /* close */ bh1721fvc_close, /* close */
bh1721fvc_read, /* read */ bh1721fvc_read, /* read */
bh1721fvc_write, /* write */ bh1721fvc_write, /* write */
0, /* seek */ NULL, /* seek */
bh1721fvc_ioctl, /* ioctl */ bh1721fvc_ioctl, /* ioctl */
#ifndef CONFIG_DISABLE_POLL NULL /* poll */
0, /* poll */ #ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
, NULL /* unlink */
#endif #endif
0 /* unlink */
}; };
/* Take ambient light data. */ /* Take ambient light data. */
@@ -126,12 +126,12 @@ static const struct file_operations g_bh1745nucfops =
bh1745nuc_close, /* close */ bh1745nuc_close, /* close */
bh1745nuc_read, /* read */ bh1745nuc_read, /* read */
bh1745nuc_write, /* write */ bh1745nuc_write, /* write */
0, /* seek */ NULL, /* seek */
bh1745nuc_ioctl, /* ioctl */ bh1745nuc_ioctl, /* ioctl */
#ifndef CONFIG_DISABLE_POLL NULL /* poll */
0, /* poll */ #ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
, NULL /* unlink */
#endif #endif
0 /* unlink */
}; };
/* Take color data. */ /* Take color data. */
@@ -125,12 +125,12 @@ static const struct file_operations g_bm1383glvfops =
bm1383glv_close, /* close */ bm1383glv_close, /* close */
bm1383glv_read, /* read */ bm1383glv_read, /* read */
bm1383glv_write, /* write */ bm1383glv_write, /* write */
0, /* seek */ NULL, /* seek */
bm1383glv_ioctl, /* ioctl */ bm1383glv_ioctl, /* ioctl */
#ifndef CONFIG_DISABLE_POLL NULL /* poll */
0, /* poll */ #ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
, NULL /* unlink */
#endif #endif
0 /* unlink */
}; };
/* Device is not BM1383AGLV but BM1383GLV */ /* Device is not BM1383AGLV but BM1383GLV */
@@ -139,12 +139,12 @@ static const struct file_operations g_bm1422gmvfops =
bm1422gmv_close, /* close */ bm1422gmv_close, /* close */
bm1422gmv_read, /* read */ bm1422gmv_read, /* read */
bm1422gmv_write, /* write */ bm1422gmv_write, /* write */
0, /* seek */ NULL, /* seek */
bm1422gmv_ioctl, /* ioctl */ bm1422gmv_ioctl, /* ioctl */
#ifndef CONFIG_DISABLE_POLL NULL /* poll */
0, /* poll */ #ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
, NULL /* unlink */
#endif #endif
0 /* unlink */
}; };
/* Take XYZ data. */ /* Take XYZ data. */
@@ -130,12 +130,12 @@ static const struct file_operations g_kx022fops =
kx022_close, /* close */ kx022_close, /* close */
kx022_read, /* read */ kx022_read, /* read */
kx022_write, /* write */ kx022_write, /* write */
0, /* seek */ NULL, /* seek */
kx022_ioctl, /* ioctl */ kx022_ioctl, /* ioctl */
#ifndef CONFIG_DISABLE_POLL NULL /* poll */
0, /* poll */ #ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
, NULL /* unlink */
#endif #endif
0 /* unlink */
}; };
/* Take XYZ data. */ /* Take XYZ data. */
@@ -176,12 +176,12 @@ static const struct file_operations g_lt1pa01alsfops =
lt1pa01_close_als, /* close */ lt1pa01_close_als, /* close */
lt1pa01_read_als, /* read */ lt1pa01_read_als, /* read */
lt1pa01_write, /* write */ lt1pa01_write, /* write */
0, /* seek */ NULL, /* seek */
lt1pa01_ioctl_als, /* ioctl */ lt1pa01_ioctl_als, /* ioctl */
#ifndef CONFIG_DISABLE_POLL NULL /* poll */
0, /* poll */ #ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
, NULL /* unlink */
#endif #endif
0 /* unlink */
}; };
/* Proximity sensor */ /* Proximity sensor */
@@ -192,12 +192,12 @@ static const struct file_operations g_lt1pa01proxfops =
lt1pa01_close_prox, /* close */ lt1pa01_close_prox, /* close */
lt1pa01_read_prox, /* read */ lt1pa01_read_prox, /* read */
lt1pa01_write, /* write */ lt1pa01_write, /* write */
0, /* seek */ NULL, /* seek */
lt1pa01_ioctl_prox, /* ioctl */ lt1pa01_ioctl_prox, /* ioctl */
#ifndef CONFIG_DISABLE_POLL NULL /* poll */
0, /* poll */ #ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
, NULL /* unlink */
#endif #endif
0 /* unlink */
}; };
/* SCU instructions for pick ambient light sensing data. */ /* SCU instructions for pick ambient light sensing data. */
@@ -164,12 +164,12 @@ static const struct file_operations g_rpr0521rsalsfops =
rpr0521rs_close_als, /* close */ rpr0521rs_close_als, /* close */
rpr0521rs_read_als, /* read */ rpr0521rs_read_als, /* read */
rpr0521rs_write, /* write */ rpr0521rs_write, /* write */
0, /* seek */ NULL, /* seek */
rpr0521rs_ioctl_als, /* ioctl */ rpr0521rs_ioctl_als, /* ioctl */
#ifndef CONFIG_DISABLE_POLL NULL /* poll */
0, /* poll */ #ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
, NULL /* unlink */
#endif #endif
0 /* unlink */
}; };
/* Proximity sensor */ /* Proximity sensor */
@@ -180,12 +180,12 @@ static const struct file_operations g_rpr0521rspsfops =
rpr0521rs_close_ps, /* close */ rpr0521rs_close_ps, /* close */
rpr0521rs_read_ps, /* read */ rpr0521rs_read_ps, /* read */
rpr0521rs_write, /* write */ rpr0521rs_write, /* write */
0, /* seek */ NULL, /* seek */
rpr0521rs_ioctl_ps, /* ioctl */ rpr0521rs_ioctl_ps, /* ioctl */
#ifndef CONFIG_DISABLE_POLL NULL /* poll */
0, /* poll */ #ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
, NULL /* unlink */
#endif #endif
0 /* unlink */
}; };
/* SCU instructions for pick ambient light sensing data. */ /* SCU instructions for pick ambient light sensing data. */
+2 -2
View File
@@ -91,8 +91,8 @@ static const struct file_operations g_adc_fops =
adc_open, /* open */ adc_open, /* open */
adc_close, /* close */ adc_close, /* close */
adc_read, /* read */ adc_read, /* read */
0, /* write */ NULL, /* write */
0, /* seek */ NULL, /* seek */
adc_ioctl, /* ioctl */ adc_ioctl, /* ioctl */
adc_poll /* poll */ adc_poll /* poll */
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS #ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
+10 -7
View File
@@ -101,13 +101,16 @@ static int ads1242_ioctl(FAR struct file *filep, int cmd,
static const struct file_operations g_ads1242_fops = static const struct file_operations g_ads1242_fops =
{ {
ads1242_open, ads1242_open, /* open */
ads1242_close, ads1242_close, /* close */
ads1242_read, ads1242_read, /* read */
ads1242_write, ads1242_write, /* write */
NULL, NULL, /* seek */
ads1242_ioctl, ads1242_ioctl, /* ioctl */
NULL NULL /* poll */
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
, NULL /* unlink */
#endif
}; };
/**************************************************************************** /****************************************************************************
+10 -7
View File
@@ -86,13 +86,16 @@ static int dac_ioctl(FAR struct file *filep, int cmd, unsigned long arg);
static const struct file_operations dac_fops = static const struct file_operations dac_fops =
{ {
dac_open, dac_open, /* open */
dac_close, dac_close, /* close */
dac_read, dac_read, /* read */
dac_write, dac_write, /* write */
NULL, NULL, /* seek */
dac_ioctl, dac_ioctl, /* ioctl */
NULL NULL /* poll */
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
, NULL /* unlink */
#endif
}; };
/**************************************************************************** /****************************************************************************
+8 -8
View File
@@ -108,15 +108,15 @@ static inline int mfrc522_attachirq(FAR struct mfrc522_dev_s *dev,
static const struct file_operations g_mfrc522fops = static const struct file_operations g_mfrc522fops =
{ {
mfrc522_open, mfrc522_open, /* open */
mfrc522_close, mfrc522_close, /* close */
mfrc522_read, mfrc522_read, /* read */
mfrc522_write, mfrc522_write, /* write */
NULL, NULL, /* seek */
mfrc522_ioctl, mfrc522_ioctl, /* ioctl */
NULL NULL /* poll */
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS #ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
, NULL , NULL /* unlink */
#endif #endif
}; };
+8 -8
View File
@@ -104,15 +104,15 @@ static inline int pn532_attachirq(FAR struct pn532_dev_s *dev, xcpt_t isr);
static const struct file_operations g_pn532fops = static const struct file_operations g_pn532fops =
{ {
_open, _open, /* open */
_close, _close, /* close */
_read, _read, /* read */
_write, _write, /* write */
NULL, NULL, /* seek */
_ioctl, _ioctl, /* ioctl */
NULL NULL /* poll */
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS #ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
, NULL , NULL /* unlink */
#endif #endif
}; };
+6
View File
@@ -239,6 +239,9 @@ static const struct file_operations ee24xx_fops =
ee24xx_seek, /* seek */ ee24xx_seek, /* seek */
ee24xx_ioctl, /* ioctl */ ee24xx_ioctl, /* ioctl */
NULL /* poll */ NULL /* poll */
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
, NULL /* unlink */
#endif
}; };
#ifdef CONFIG_AT24CS_UUID #ifdef CONFIG_AT24CS_UUID
@@ -251,6 +254,9 @@ static const struct file_operations at24cs_uuid_fops =
NULL, /* seek */ NULL, /* seek */
NULL, /* ioctl */ NULL, /* ioctl */
NULL /* poll */ NULL /* poll */
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
, NULL /* unlink */
#endif
}; };
#endif #endif
+3
View File
@@ -276,6 +276,9 @@ static const struct file_operations ee25xx_fops =
ee25xx_seek, /* seek */ ee25xx_seek, /* seek */
ee25xx_ioctl, /* ioctl */ ee25xx_ioctl, /* ioctl */
NULL /* poll */ NULL /* poll */
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
, NULL /* unlink */
#endif
}; };
/**************************************************************************** /****************************************************************************
+3
View File
@@ -88,6 +88,9 @@ static const struct file_operations g_efuseops =
NULL, /* seek */ NULL, /* seek */
efuse_ioctl, /* ioctl */ efuse_ioctl, /* ioctl */
NULL /* poll */ NULL /* poll */
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
, NULL /* unlink */
#endif
}; };
/**************************************************************************** /****************************************************************************
+4 -1
View File
@@ -111,7 +111,10 @@ static const struct file_operations i2schar_fops =
i2schar_write, /* write */ i2schar_write, /* write */
NULL, /* seek */ NULL, /* seek */
i2schar_ioctl, /* ioctl */ i2schar_ioctl, /* ioctl */
NULL, /* poll */ NULL /* poll */
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
, NULL /* unlink */
#endif
}; };
/**************************************************************************** /****************************************************************************
+5 -2
View File
@@ -119,10 +119,13 @@ static const struct file_operations ads7843e_fops =
ads7843e_open, /* open */ ads7843e_open, /* open */
ads7843e_close, /* close */ ads7843e_close, /* close */
ads7843e_read, /* read */ ads7843e_read, /* read */
0, /* write */ NULL, /* write */
0, /* seek */ NULL, /* seek */
ads7843e_ioctl, /* ioctl */ ads7843e_ioctl, /* ioctl */
ads7843e_poll /* poll */ ads7843e_poll /* poll */
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
, NULL /* unlink */
#endif
}; };
/* If only a single ADS7843E device is supported, then the driver state /* If only a single ADS7843E device is supported, then the driver state
+5 -2
View File
@@ -142,10 +142,13 @@ static const struct file_operations ajoy_fops =
ajoy_open, /* open */ ajoy_open, /* open */
ajoy_close, /* close */ ajoy_close, /* close */
ajoy_read, /* read */ ajoy_read, /* read */
0, /* write */ NULL, /* write */
0, /* seek */ NULL, /* seek */
ajoy_ioctl, /* ioctl */ ajoy_ioctl, /* ioctl */
ajoy_poll /* poll */ ajoy_poll /* poll */
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
, NULL /* unlink */
#endif
}; };
/**************************************************************************** /****************************************************************************
+3
View File
@@ -142,6 +142,9 @@ static const struct file_operations btn_fops =
NULL, /* seek */ NULL, /* seek */
btn_ioctl, /* ioctl */ btn_ioctl, /* ioctl */
btn_poll /* poll */ btn_poll /* poll */
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
, NULL /* unlink */
#endif
}; };
/**************************************************************************** /****************************************************************************
+3
View File
@@ -225,6 +225,9 @@ static const struct file_operations g_mbr3108_fileops =
NULL, /* seek */ NULL, /* seek */
NULL, /* ioctl */ NULL, /* ioctl */
mbr3108_poll /* poll */ mbr3108_poll /* poll */
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
, NULL /* unlink */
#endif
}; };
/**************************************************************************** /****************************************************************************
+5 -2
View File
@@ -142,10 +142,13 @@ static const struct file_operations djoy_fops =
djoy_open, /* open */ djoy_open, /* open */
djoy_close, /* close */ djoy_close, /* close */
djoy_read, /* read */ djoy_read, /* read */
0, /* write */ NULL, /* write */
0, /* seek */ NULL, /* seek */
djoy_ioctl, /* ioctl */ djoy_ioctl, /* ioctl */
djoy_poll /* poll */ djoy_poll /* poll */
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
, NULL /* unlink */
#endif
}; };
/**************************************************************************** /****************************************************************************
+3 -3
View File
@@ -112,12 +112,12 @@ static const struct file_operations max11802_fops =
max11802_open, /* open */ max11802_open, /* open */
max11802_close, /* close */ max11802_close, /* close */
max11802_read, /* read */ max11802_read, /* read */
0, /* write */ NULL, /* write */
0, /* seek */ NULL, /* seek */
max11802_ioctl, /* ioctl */ max11802_ioctl, /* ioctl */
max11802_poll /* poll */ max11802_poll /* poll */
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS #ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
, 0 /* unlink */ , NULL /* unlink */
#endif #endif
}; };
+5 -2
View File
@@ -276,10 +276,13 @@ static const struct file_operations mxt_fops =
mxt_open, /* open */ mxt_open, /* open */
mxt_close, /* close */ mxt_close, /* close */
mxt_read, /* read */ mxt_read, /* read */
0, /* write */ NULL, /* write */
0, /* seek */ NULL, /* seek */
mxt_ioctl, /* ioctl */ mxt_ioctl, /* ioctl */
mxt_poll /* poll */ mxt_poll /* poll */
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
, NULL /* unlink */
#endif
}; };
/**************************************************************************** /****************************************************************************
+10 -7
View File
@@ -248,13 +248,16 @@ static int spq10kbd_poll(FAR struct file *filep, FAR struct pollfd *fds,
static const struct file_operations g_hidkbd_fops = static const struct file_operations g_hidkbd_fops =
{ {
spq10kbd_open, /* open */ spq10kbd_open, /* open */
spq10kbd_close, /* close */ spq10kbd_close, /* close */
spq10kbd_read, /* read */ spq10kbd_read, /* read */
spq10kbd_write, /* write */ spq10kbd_write, /* write */
NULL, /* seek */ NULL, /* seek */
NULL, /* ioctl */ NULL, /* ioctl */
spq10kbd_poll /* poll */ spq10kbd_poll /* poll */
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
, NULL /* unlink */
#endif
}; };
/**************************************************************************** /****************************************************************************
+3
View File
@@ -125,6 +125,9 @@ static const struct file_operations g_stmpe811fops =
NULL, /* seek */ NULL, /* seek */
stmpe811_ioctl, /* ioctl */ stmpe811_ioctl, /* ioctl */
stmpe811_poll /* poll */ stmpe811_poll /* poll */
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
, NULL /* unlink */
#endif
}; };
/**************************************************************************** /****************************************************************************
+10 -7
View File
@@ -87,13 +87,16 @@ static int touch_poll(FAR struct file *filep, FAR struct pollfd *fds,
static const struct file_operations g_touch_fops = static const struct file_operations g_touch_fops =
{ {
touch_open, touch_open, /* open */
touch_close, touch_close, /* close */
touch_read, touch_read, /* read */
NULL, NULL, /* write */
NULL, NULL, /* seek */
touch_ioctl, touch_ioctl, /* ioctl */
touch_poll touch_poll /* poll */
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
, NULL /* unlink */
#endif
}; };
/**************************************************************************** /****************************************************************************
+5 -2
View File
@@ -205,10 +205,13 @@ static const struct file_operations tsc2007_fops =
tsc2007_open, /* open */ tsc2007_open, /* open */
tsc2007_close, /* close */ tsc2007_close, /* close */
tsc2007_read, /* read */ tsc2007_read, /* read */
0, /* write */ NULL, /* write */
0, /* seek */ NULL, /* seek */
tsc2007_ioctl, /* ioctl */ tsc2007_ioctl, /* ioctl */
tsc2007_poll /* poll */ tsc2007_poll /* poll */
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
, NULL /* unlink */
#endif
}; };
/* If only a single TSC2007 device is supported, then the driver state /* If only a single TSC2007 device is supported, then the driver state
+2 -2
View File
@@ -160,9 +160,9 @@ static const struct file_operations g_ht16k33fops =
ht16k33_write, /* write */ ht16k33_write, /* write */
ht16k33_seek, /* seek */ ht16k33_seek, /* seek */
ht16k33_ioctl, /* ioctl */ ht16k33_ioctl, /* ioctl */
NULL, /* poll */ NULL /* poll */
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS #ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
NULL /* unlink */ , NULL /* unlink */
#endif #endif
}; };
+2 -2
View File
@@ -123,9 +123,9 @@ static const struct file_operations g_pcf8574_lcd_fops =
pcf8574_lcd_write, /* write */ pcf8574_lcd_write, /* write */
pcf8574_lcd_seek, /* seek */ pcf8574_lcd_seek, /* seek */
pcf8574_lcd_ioctl, /* ioctl */ pcf8574_lcd_ioctl, /* ioctl */
pcf8574lcd_poll, /* poll */ pcf8574lcd_poll /* poll */
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS #ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
pcf8574_lcd_unlink /* unlink */ , pcf8574_lcd_unlink /* unlink */
#endif #endif
}; };
+2 -2
View File
@@ -116,9 +116,9 @@ static const struct file_operations g_st7032fops =
st7032_write, /* write */ st7032_write, /* write */
st7032_seek, /* seek */ st7032_seek, /* seek */
st7032_ioctl, /* ioctl */ st7032_ioctl, /* ioctl */
NULL, /* poll */ NULL /* poll */
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS #ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
NULL /* unlink */ , NULL /* unlink */
#endif #endif
}; };
+2 -2
View File
@@ -89,9 +89,9 @@ static const struct file_operations g_max7219fops =
max7219_write, /* write */ max7219_write, /* write */
NULL, /* seek */ NULL, /* seek */
NULL, /* ioctl */ NULL, /* ioctl */
NULL, /* poll */ NULL /* poll */
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS #ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
NULL /* unlink */ , NULL /* unlink */
#endif #endif
}; };
+5 -2
View File
@@ -86,9 +86,12 @@ static const struct file_operations g_ncp5623c_fileops =
ncp5623c_close, /* close */ ncp5623c_close, /* close */
ncp5623c_read, /* read */ ncp5623c_read, /* read */
ncp5623c_write, /* write */ ncp5623c_write, /* write */
0, /* seek */ NULL, /* seek */
ncp5623c_ioctl, /* ioctl */ ncp5623c_ioctl, /* ioctl */
0 /* poll */ NULL /* poll */
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
, NULL /* unlink */
#endif
}; };
/**************************************************************************** /****************************************************************************
+7 -4
View File
@@ -68,11 +68,14 @@ static const struct file_operations g_pca9635pw_fileops =
{ {
pca9635pw_open, /* open */ pca9635pw_open, /* open */
pca9635pw_close, /* close */ pca9635pw_close, /* close */
0, /* read */ NULL, /* read */
0, /* write */ NULL, /* write */
0, /* seek */ NULL, /* seek */
pca9635pw_ioctl, /* ioctl */ pca9635pw_ioctl, /* ioctl */
0 /* poll */ NULL /* poll */
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
, NULL /* unlink */
#endif
}; };
/**************************************************************************** /****************************************************************************
+2 -2
View File
@@ -131,9 +131,9 @@ static const struct file_operations g_ws2812fops =
ws2812_write, /* write */ ws2812_write, /* write */
ws2812_seek, /* seek */ ws2812_seek, /* seek */
NULL, /* ioctl */ NULL, /* ioctl */
NULL, /* poll */ NULL /* poll */
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS #ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
NULL /* unlink */ , NULL /* unlink */
#endif #endif
}; };
+3
View File
@@ -58,6 +58,9 @@ static const struct file_operations g_loop_fops =
NULL, /* seek */ NULL, /* seek */
loop_ioctl, /* ioctl */ loop_ioctl, /* ioctl */
NULL /* poll */ NULL /* poll */
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
, NULL /* unlink */
#endif
}; };
/**************************************************************************** /****************************************************************************
+1 -2
View File
@@ -139,8 +139,7 @@ static const struct file_operations g_consoleops =
lwlconsole_ioctl, /* ioctl */ lwlconsole_ioctl, /* ioctl */
NULL /* poll */ NULL /* poll */
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS #ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
, , NULL /* unlink */
NULL /* unlink */
#endif #endif
}; };
+3
View File
@@ -82,6 +82,9 @@ static const struct file_operations g_cordicops =
NULL, /* seek */ NULL, /* seek */
cordic_ioctl, /* ioctl */ cordic_ioctl, /* ioctl */
NULL /* poll */ NULL /* poll */
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
, NULL /* unlink */
#endif
}; };
/**************************************************************************** /****************************************************************************
+5 -1
View File
@@ -62,8 +62,12 @@ static const struct file_operations g_altmdmfops =
altmdm_close, /* close */ altmdm_close, /* close */
altmdm_read, /* read */ altmdm_read, /* read */
altmdm_write, /* write */ altmdm_write, /* write */
0, /* seek */ NULL, /* seek */
altmdm_ioctl, /* ioctl */ altmdm_ioctl, /* ioctl */
NULL /* poll */
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
, NULL /* unlink */
#endif
}; };
/**************************************************************************** /****************************************************************************
+6 -3
View File
@@ -108,13 +108,16 @@ static int ubxmdm_poll (FAR struct file * filep,
static const struct file_operations ubxmdm_fops = static const struct file_operations ubxmdm_fops =
{ {
0, /* open */ NULL, /* open */
0, /* close */ NULL, /* close */
ubxmdm_read, /* read */ ubxmdm_read, /* read */
ubxmdm_write, /* write */ ubxmdm_write, /* write */
0, /* seek */ NULL, /* seek */
ubxmdm_ioctl, /* ioctl */ ubxmdm_ioctl, /* ioctl */
ubxmdm_poll /* poll */ ubxmdm_poll /* poll */
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
, NULL /* unlink */
#endif
}; };
/**************************************************************************** /****************************************************************************
+5 -2
View File
@@ -119,10 +119,13 @@ static const struct file_operations mtdconfig_fops =
mtdconfig_open, /* open */ mtdconfig_open, /* open */
mtdconfig_close, /* close */ mtdconfig_close, /* close */
mtdconfig_read, /* read */ mtdconfig_read, /* read */
0, /* write */ NULL, /* write */
0, /* seek */ NULL, /* seek */
mtdconfig_ioctl, /* ioctl */ mtdconfig_ioctl, /* ioctl */
mtdconfig_poll /* poll */ mtdconfig_poll /* poll */
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
, NULL /* unlink */
#endif
}; };
/**************************************************************************** /****************************************************************************
+132 -109
View File
@@ -462,6 +462,9 @@ static const struct file_operations g_fops =
NULL, /* seek */ NULL, /* seek */
smart_loop_ioctl, /* ioctl */ smart_loop_ioctl, /* ioctl */
NULL /* poll */ NULL /* poll */
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
, NULL /* unlink */
#endif
}; };
#endif /* CONFIG_SMART_DEV_LOOP */ #endif /* CONFIG_SMART_DEV_LOOP */
@@ -2676,7 +2679,9 @@ err_out:
static void smart_erase_block_if_empty(FAR struct smart_struct_s *dev, static void smart_erase_block_if_empty(FAR struct smart_struct_s *dev,
uint16_t block, uint8_t forceerase) uint16_t block, uint8_t forceerase)
{ {
uint16_t freecount, releasecount, prerelease; uint16_t freecount;
uint16_t releasecount;
uint16_t prerelease;
#ifdef CONFIG_MTD_SMART_PACK_COUNTS #ifdef CONFIG_MTD_SMART_PACK_COUNTS
releasecount = smart_get_count(dev, dev->releasecount, block); releasecount = smart_get_count(dev, dev->releasecount, block);
@@ -2771,10 +2776,15 @@ static void smart_erase_block_if_empty(FAR struct smart_struct_s *dev,
static int smart_relocate_static_data(FAR struct smart_struct_s *dev, static int smart_relocate_static_data(FAR struct smart_struct_s *dev,
uint16_t block) uint16_t block)
{ {
uint16_t freecount, x, sector, minblock; uint16_t freecount;
uint16_t nextsector, newsector, mincount; uint16_t x;
int ret; uint16_t sector;
FAR struct smart_sect_header_s *header; uint16_t minblock;
uint16_t nextsector;
uint16_t newsector;
uint16_t mincount;
int ret;
FAR struct smart_sect_header_s *header;
#ifdef CONFIG_MTD_SMART_ENABLE_CRC #ifdef CONFIG_MTD_SMART_ENABLE_CRC
FAR struct smart_allocsector_s *allocsector; FAR struct smart_allocsector_s *allocsector;
#endif #endif
@@ -3012,7 +3022,7 @@ errout:
#ifdef CONFIG_MTD_SMART_ENABLE_CRC #ifdef CONFIG_MTD_SMART_ENABLE_CRC
static crc_t smart_calc_sector_crc(FAR struct smart_struct_s *dev) static crc_t smart_calc_sector_crc(FAR struct smart_struct_s *dev)
{ {
crc_t crc = 0; crc_t crc = 0;
#ifdef CONFIG_SMART_CRC_8 #ifdef CONFIG_SMART_CRC_8
@@ -3085,12 +3095,13 @@ static crc_t smart_calc_sector_crc(FAR struct smart_struct_s *dev)
static inline int smart_llformat(FAR struct smart_struct_s *dev, static inline int smart_llformat(FAR struct smart_struct_s *dev,
unsigned long arg) unsigned long arg)
{ {
FAR struct smart_sect_header_s *sectorheader; FAR struct smart_sect_header_s *sectorheader;
size_t wrcount; size_t wrcount;
int x; int x;
int ret; int ret;
uint8_t sectsize, prerelease; uint8_t sectsize;
uint16_t sectorsize; uint8_t prerelease;
uint16_t sectorsize;
finfo("Entry\n"); finfo("Entry\n");
@@ -3305,12 +3316,12 @@ static inline int smart_llformat(FAR struct smart_struct_s *dev,
****************************************************************************/ ****************************************************************************/
static int smart_relocate_sector(FAR struct smart_struct_s *dev, static int smart_relocate_sector(FAR struct smart_struct_s *dev,
uint16_t oldsector, uint16_t newsector) uint16_t oldsector, uint16_t newsector)
{ {
size_t offset; size_t offset;
FAR struct smart_sect_header_s *header; FAR struct smart_sect_header_s *header;
uint8_t newstatus; uint8_t newstatus;
int ret; int ret;
header = (FAR struct smart_sect_header_s *) dev->rwbuffer; header = (FAR struct smart_sect_header_s *) dev->rwbuffer;
@@ -3445,14 +3456,15 @@ errout:
static int smart_relocate_block(FAR struct smart_struct_s *dev, static int smart_relocate_block(FAR struct smart_struct_s *dev,
uint16_t block) uint16_t block)
{ {
uint16_t newsector, oldrelease; uint16_t newsector;
int x; uint16_t oldrelease;
int ret; int x;
FAR struct smart_sect_header_s *header; int ret;
uint8_t prerelease; FAR struct smart_sect_header_s *header;
uint16_t freecount; uint8_t prerelease;
uint16_t freecount;
#if defined(CONFIG_SMART_LOCAL_CHECKFREE) && defined(CONFIG_DEBUG_FS) #if defined(CONFIG_SMART_LOCAL_CHECKFREE) && defined(CONFIG_DEBUG_FS)
uint16_t releasecount; uint16_t releasecount;
#endif #endif
#ifdef CONFIG_MTD_SMART_ENABLE_CRC #ifdef CONFIG_MTD_SMART_ENABLE_CRC
FAR struct smart_allocsector_s *allocsector; FAR struct smart_allocsector_s *allocsector;
@@ -3704,18 +3716,22 @@ errout:
static int smart_findfreephyssector(FAR struct smart_struct_s *dev, static int smart_findfreephyssector(FAR struct smart_struct_s *dev,
uint8_t canrelocate) uint8_t canrelocate)
{ {
uint16_t count, allocfreecount, allocblock; uint16_t count;
uint16_t allocfreecount;
uint16_t allocblock;
#ifdef CONFIG_MTD_SMART_WEAR_LEVEL #ifdef CONFIG_MTD_SMART_WEAR_LEVEL
uint16_t wornfreecount, wornblock; uint16_t wornfreecount;
uint8_t wearlevel, wornlevel; uint16_t wornblock;
uint8_t maxwearlevel; uint8_t wearlevel;
uint8_t wornlevel;
uint8_t maxwearlevel;
#endif #endif
uint16_t physicalsector; uint16_t physicalsector;
uint16_t block; uint16_t block;
uint32_t readaddr; uint32_t readaddr;
struct smart_sect_header_s header; struct smart_sect_header_s header;
int ret; int ret;
uint16_t i; uint16_t i;
/* Determine which erase block we should allocate the new /* Determine which erase block we should allocate the new
* sector from. This is based on the number of free sectors * sector from. This is based on the number of free sectors
@@ -3982,13 +3998,13 @@ retry:
static int smart_garbagecollect(FAR struct smart_struct_s *dev) static int smart_garbagecollect(FAR struct smart_struct_s *dev)
{ {
uint16_t collectblock; uint16_t collectblock;
uint16_t releasemax; uint16_t releasemax;
bool collect = TRUE; bool collect = TRUE;
int x; int x;
int ret; int ret;
#ifdef CONFIG_MTD_SMART_PACK_COUNTS #ifdef CONFIG_MTD_SMART_PACK_COUNTS
uint8_t count; uint8_t count;
#endif #endif
while (collect) while (collect)
@@ -4115,11 +4131,13 @@ errout:
#ifdef CONFIG_MTD_SMART_WEAR_LEVEL #ifdef CONFIG_MTD_SMART_WEAR_LEVEL
static int smart_write_wearstatus(struct smart_struct_s *dev) static int smart_write_wearstatus(struct smart_struct_s *dev)
{ {
uint16_t sector; uint16_t sector;
uint16_t remaining, towrite; uint16_t remaining;
uint16_t towrite;
struct smart_read_write_s req; struct smart_read_write_s req;
int ret; int ret;
uint8_t buffer[8], write_buffer = 0; uint8_t buffer[8];
uint8_t write_buffer = 0;
sector = 0; sector = 0;
remaining = dev->geo.neraseblocks >> 1; remaining = dev->geo.neraseblocks >> 1;
@@ -4235,8 +4253,10 @@ errout:
static inline int smart_read_wearstatus(FAR struct smart_struct_s *dev) static inline int smart_read_wearstatus(FAR struct smart_struct_s *dev)
{ {
struct smart_read_write_s req; struct smart_read_write_s req;
uint16_t sector, physsector; uint16_t sector;
uint16_t remaining, toread; uint16_t physsector;
uint16_t remaining;
uint16_t toread;
uint8_t buffer[8]; uint8_t buffer[8];
int ret; int ret;
@@ -4385,9 +4405,9 @@ errout:
static int smart_write_alloc_sector(FAR struct smart_struct_s *dev, static int smart_write_alloc_sector(FAR struct smart_struct_s *dev,
uint16_t logical, uint16_t physical) uint16_t logical, uint16_t physical)
{ {
int ret = 1; int ret = 1;
uint8_t sectsize; uint8_t sectsize;
FAR struct smart_sect_header_s *header; FAR struct smart_sect_header_s *header;
memset(dev->rwbuffer, CONFIG_SMARTFS_ERASEDSTATE, dev->sectorsize); memset(dev->rwbuffer, CONFIG_SMARTFS_ERASEDSTATE, dev->sectorsize);
header = (FAR struct smart_sect_header_s *) dev->rwbuffer; header = (FAR struct smart_sect_header_s *) dev->rwbuffer;
@@ -4464,8 +4484,8 @@ static int smart_write_alloc_sector(FAR struct smart_struct_s *dev,
#ifdef CONFIG_MTD_SMART_ENABLE_CRC #ifdef CONFIG_MTD_SMART_ENABLE_CRC
static int smart_validate_crc(FAR struct smart_struct_s *dev) static int smart_validate_crc(FAR struct smart_struct_s *dev)
{ {
crc_t crc; crc_t crc;
FAR struct smart_sect_header_s *header; FAR struct smart_sect_header_s *header;
/* Calculate CRC on data region of the sector */ /* Calculate CRC on data region of the sector */
@@ -4519,19 +4539,21 @@ static int smart_validate_crc(FAR struct smart_struct_s *dev)
static int smart_writesector(FAR struct smart_struct_s *dev, static int smart_writesector(FAR struct smart_struct_s *dev,
unsigned long arg) unsigned long arg)
{ {
int ret; int ret;
bool needsrelocate = FALSE; bool needsrelocate = FALSE;
uint32_t mtdblock; uint32_t mtdblock;
uint16_t physsector, oldphyssector, block; uint16_t physsector;
FAR struct smart_read_write_s *req; uint16_t oldphyssector;
FAR struct smart_sect_header_s *header; uint16_t block;
size_t offset; FAR struct smart_read_write_s *req;
uint8_t byte; FAR struct smart_sect_header_s *header;
size_t offset;
uint8_t byte;
#if defined(CONFIG_MTD_SMART_WEAR_LEVEL) || !defined(CONFIG_MTD_SMART_ENABLE_CRC) #if defined(CONFIG_MTD_SMART_WEAR_LEVEL) || !defined(CONFIG_MTD_SMART_ENABLE_CRC)
uint16_t x; uint16_t x;
#endif #endif
#ifdef CONFIG_MTD_SMART_ENABLE_CRC #ifdef CONFIG_MTD_SMART_ENABLE_CRC
FAR struct smart_allocsector_s *allocsector; FAR struct smart_allocsector_s *allocsector;
#endif #endif
finfo("Entry\n"); finfo("Entry\n");
@@ -4932,15 +4954,15 @@ errout:
static int smart_readsector(FAR struct smart_struct_s *dev, static int smart_readsector(FAR struct smart_struct_s *dev,
unsigned long arg) unsigned long arg)
{ {
int ret; int ret;
uint16_t physsector; uint16_t physsector;
FAR struct smart_read_write_s *req; FAR struct smart_read_write_s *req;
#ifdef CONFIG_MTD_SMART_ENABLE_CRC #ifdef CONFIG_MTD_SMART_ENABLE_CRC
#if SMART_STATUS_VERSION == 1 #if SMART_STATUS_VERSION == 1
FAR struct smart_sect_header_s *header; FAR struct smart_sect_header_s *header;
#endif #endif
#else #else
uint32_t readaddr; uint32_t readaddr;
struct smart_sect_header_s header; struct smart_sect_header_s header;
#endif #endif
@@ -5085,12 +5107,12 @@ errout:
static inline int smart_allocsector(FAR struct smart_struct_s *dev, static inline int smart_allocsector(FAR struct smart_struct_s *dev,
unsigned long requested) unsigned long requested)
{ {
uint16_t logsector = 0xffff; /* Logical sector number selected */ uint16_t logsector = 0xffff; /* Logical sector number selected */
uint16_t physicalsector; /* The selected physical sector */ uint16_t physicalsector; /* The selected physical sector */
#ifndef CONFIG_MTD_SMART_ENABLE_CRC #ifndef CONFIG_MTD_SMART_ENABLE_CRC
int ret; int ret;
#endif #endif
int x; int x;
/* Validate that we have enough sectors available to perform an /* Validate that we have enough sectors available to perform an
* allocation. We have to ensure we keep enough reserved sectors * allocation. We have to ensure we keep enough reserved sectors
@@ -5334,12 +5356,12 @@ static inline int smart_allocsector(FAR struct smart_struct_s *dev,
static inline int smart_freesector(FAR struct smart_struct_s *dev, static inline int smart_freesector(FAR struct smart_struct_s *dev,
unsigned long logicalsector) unsigned long logicalsector)
{ {
int ret; int ret;
int readaddr; int readaddr;
uint16_t physsector; uint16_t physsector;
uint16_t block; uint16_t block;
struct smart_sect_header_s header; struct smart_sect_header_s header;
size_t offset; size_t offset;
/* Check if the logical sector is within bounds */ /* Check if the logical sector is within bounds */
@@ -5445,7 +5467,7 @@ errout:
static int smart_ioctl(FAR struct inode *inode, int cmd, unsigned long arg) static int smart_ioctl(FAR struct inode *inode, int cmd, unsigned long arg)
{ {
FAR struct smart_struct_s *dev ; FAR struct smart_struct_s *dev;
int ret; int ret;
#if defined(CONFIG_FS_PROCFS) && !defined(CONFIG_FS_PROCFS_EXCLUDE_SMARTFS) #if defined(CONFIG_FS_PROCFS) && !defined(CONFIG_FS_PROCFS_EXCLUDE_SMARTFS)
FAR struct mtd_smart_procfs_data_s *procfs_data; FAR struct mtd_smart_procfs_data_s *procfs_data;
@@ -5647,15 +5669,15 @@ static int smart_fsck_crc(FAR struct smart_struct_s *dev,
static int smart_fsck_file(FAR struct smart_struct_s *dev, static int smart_fsck_file(FAR struct smart_struct_s *dev,
FAR uint8_t *checkmap, uint16_t logsector) FAR uint8_t *checkmap, uint16_t logsector)
{ {
int ret = OK; int ret = OK;
ssize_t size; ssize_t size;
uint32_t readaddress; uint32_t readaddress;
FAR struct smart_sect_header_s *header; FAR struct smart_sect_header_s *header;
FAR struct smart_chain_header_s *chain; FAR struct smart_chain_header_s *chain;
FAR uint8_t *usedmap; FAR uint8_t *usedmap;
size_t mapsize; size_t mapsize;
uint16_t physsector; uint16_t physsector;
int i; int i;
if (logsector >= dev->totalsectors) if (logsector >= dev->totalsectors)
{ {
@@ -5770,22 +5792,22 @@ static int smart_fsck_file(FAR struct smart_struct_s *dev,
static int smart_fsck_directory(FAR struct smart_struct_s *dev, static int smart_fsck_directory(FAR struct smart_struct_s *dev,
FAR uint8_t *checkmap, uint16_t logsector) FAR uint8_t *checkmap, uint16_t logsector)
{ {
int ret = OK; int ret = OK;
int relocate = 0; int relocate = 0;
ssize_t size; ssize_t size;
FAR uint8_t *rwbuffer; FAR uint8_t *rwbuffer;
FAR struct smart_sect_header_s *header; FAR struct smart_sect_header_s *header;
FAR struct smart_chain_header_s *chain; FAR struct smart_chain_header_s *chain;
FAR struct smart_entry_header_s *entry; FAR struct smart_entry_header_s *entry;
uint16_t entrysector; uint16_t entrysector;
uint16_t physsector; uint16_t physsector;
uint16_t nextsector; uint16_t nextsector;
uint16_t newsector; uint16_t newsector;
int entrysize; int entrysize;
FAR uint8_t *bottom; FAR uint8_t *bottom;
FAR uint8_t *cur; FAR uint8_t *cur;
#ifdef CONFIG_DEBUG_FS_INFO #ifdef CONFIG_DEBUG_FS_INFO
char entryname[dev->namesize + 1]; char entryname[dev->namesize + 1];
#endif #endif
if ((logsector < SMART_FIRST_DIR_SECTOR) || if ((logsector < SMART_FIRST_DIR_SECTOR) ||
@@ -6027,14 +6049,14 @@ errout:
static int smart_fsck(FAR struct smart_struct_s *dev) static int smart_fsck(FAR struct smart_struct_s *dev)
{ {
uint16_t logsector; uint16_t logsector;
#ifndef CONFIG_MTD_SMART_MINIMIZE_RAM #ifndef CONFIG_MTD_SMART_MINIMIZE_RAM
uint16_t physsector; uint16_t physsector;
#endif #endif
FAR uint8_t *checkmap; FAR uint8_t *checkmap;
size_t mapsize; size_t mapsize;
uint8_t rootdirentries; uint8_t rootdirentries;
int x; int x;
finfo("Entry\n"); finfo("Entry\n");
@@ -6118,7 +6140,7 @@ int smart_initialize(int minor, FAR struct mtd_dev_s *mtd,
{ {
FAR struct smart_struct_s *dev; FAR struct smart_struct_s *dev;
int ret = -ENOMEM; int ret = -ENOMEM;
uint32_t totalsectors; uint32_t totalsectors;
#ifdef CONFIG_SMARTFS_MULTI_ROOT_DIRS #ifdef CONFIG_SMARTFS_MULTI_ROOT_DIRS
FAR struct smart_multiroot_device_s *rootdirdev = NULL; FAR struct smart_multiroot_device_s *rootdirdev = NULL;
#endif #endif
@@ -6310,9 +6332,10 @@ static int smart_losetup(int minor, FAR const char *filename,
int sectsize, int erasesize, off_t offset, bool readonly) int sectsize, int erasesize, off_t offset, bool readonly)
{ {
FAR struct mtd_dev_s *mtd; FAR struct mtd_dev_s *mtd;
struct stat sb; struct stat sb;
int x, ret; int x;
char devpath[20]; int ret;
char devpath[20];
/* Try to create a filemtd device using the filename provided */ /* Try to create a filemtd device using the filename provided */

Some files were not shown because too many files have changed in this diff Show More