diff --git a/arch/arm/src/cxd56xx/cxd56_geofence.c b/arch/arm/src/cxd56xx/cxd56_geofence.c index 5570df9ab19b2..9c9330756a5d5 100644 --- a/arch/arm/src/cxd56xx/cxd56_geofence.c +++ b/arch/arm/src/cxd56xx/cxd56_geofence.c @@ -106,8 +106,8 @@ static const struct file_operations g_geofencefops = NULL, /* write */ NULL, /* seek */ cxd56_geofence_ioctl, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ cxd56_geofence_poll /* poll */ }; diff --git a/arch/arm/src/cxd56xx/cxd56_gnss.c b/arch/arm/src/cxd56xx/cxd56_gnss.c index 82381d3d0b67d..1cbef74c0918f 100644 --- a/arch/arm/src/cxd56xx/cxd56_gnss.c +++ b/arch/arm/src/cxd56xx/cxd56_gnss.c @@ -317,8 +317,8 @@ static const struct file_operations g_gnssfops = cxd56_gnss_write, /* write */ NULL, /* seek */ cxd56_gnss_ioctl, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ cxd56_gnss_poll /* poll */ }; diff --git a/arch/arm/src/cxd56xx/cxd56_hostif.c b/arch/arm/src/cxd56xx/cxd56_hostif.c index 790506052c31e..0cb04ee3dca73 100644 --- a/arch/arm/src/cxd56xx/cxd56_hostif.c +++ b/arch/arm/src/cxd56xx/cxd56_hostif.c @@ -145,8 +145,8 @@ static const struct file_operations g_hif_fops = hif_write, /* write */ hif_seek, /* seek */ hif_ioctl, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ hif_poll /* poll */ #ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS , hif_unlink /* unlink */ diff --git a/arch/arm/src/sama5/sam_tsd.c b/arch/arm/src/sama5/sam_tsd.c index 378613179ac17..9b7137218e7a2 100644 --- a/arch/arm/src/sama5/sam_tsd.c +++ b/arch/arm/src/sama5/sam_tsd.c @@ -249,8 +249,8 @@ static const struct file_operations g_tsdops = NULL, /* write */ NULL, /* seek */ sam_tsd_ioctl, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ sam_tsd_poll /* poll */ }; diff --git a/boards/arm/sam34/sam4l-xplained/src/sam_slcd.c b/boards/arm/sam34/sam4l-xplained/src/sam_slcd.c index 359d3352b897b..7e0ac91777265 100644 --- a/boards/arm/sam34/sam4l-xplained/src/sam_slcd.c +++ b/boards/arm/sam34/sam4l-xplained/src/sam_slcd.c @@ -296,8 +296,8 @@ static const struct file_operations g_slcdops = slcd_write, /* write */ NULL, /* seek */ slcd_ioctl, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ slcd_poll /* poll */ }; diff --git a/boards/arm/stm32/mikroe-stm32f4/src/stm32_touchscreen.c b/boards/arm/stm32/mikroe-stm32f4/src/stm32_touchscreen.c index ffce500f3c2c8..fc698f8e23ce0 100644 --- a/boards/arm/stm32/mikroe-stm32f4/src/stm32_touchscreen.c +++ b/boards/arm/stm32/mikroe-stm32f4/src/stm32_touchscreen.c @@ -268,8 +268,8 @@ static const struct file_operations tc_fops = NULL, /* write */ NULL, /* seek */ tc_ioctl, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ tc_poll /* poll */ }; diff --git a/boards/arm/stm32/stm32ldiscovery/src/stm32_lcd.c b/boards/arm/stm32/stm32ldiscovery/src/stm32_lcd.c index f44f4ad9b1d04..64afa285ee204 100644 --- a/boards/arm/stm32/stm32ldiscovery/src/stm32_lcd.c +++ b/boards/arm/stm32/stm32ldiscovery/src/stm32_lcd.c @@ -346,8 +346,8 @@ static const struct file_operations g_slcdops = slcd_write, /* write */ NULL, /* seek */ slcd_ioctl, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ slcd_poll /* poll */ }; diff --git a/boards/mips/pic32mx/pic32mx7mmb/src/pic32_touchscreen.c b/boards/mips/pic32mx/pic32mx7mmb/src/pic32_touchscreen.c index 9c30839a2858a..9047e176aead7 100644 --- a/boards/mips/pic32mx/pic32mx7mmb/src/pic32_touchscreen.c +++ b/boards/mips/pic32mx/pic32mx7mmb/src/pic32_touchscreen.c @@ -249,8 +249,8 @@ static const struct file_operations tc_fops = NULL, /* write */ NULL, /* seek */ tc_ioctl, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ tc_poll /* poll */ }; diff --git a/boards/mips/pic32mx/sure-pic32mx/src/pic32mx_lcd1602.c b/boards/mips/pic32mx/sure-pic32mx/src/pic32mx_lcd1602.c index 682feabfc137c..0495e09f114e8 100644 --- a/boards/mips/pic32mx/sure-pic32mx/src/pic32mx_lcd1602.c +++ b/boards/mips/pic32mx/sure-pic32mx/src/pic32mx_lcd1602.c @@ -181,8 +181,8 @@ static const struct file_operations g_lcdops = lcd_write, /* write */ NULL, /* seek */ lcd_ioctl, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ lcd_poll /* poll */ }; diff --git a/crypto/cryptodev.c b/crypto/cryptodev.c index 749e2c0120c50..69229e350f966 100644 --- a/crypto/cryptodev.c +++ b/crypto/cryptodev.c @@ -125,8 +125,8 @@ static const struct file_operations g_cryptofops = cryptof_write, /* write */ NULL, /* seek */ cryptof_ioctl, /* ioctl */ + NULL, /* mmap */ NULL, /* truncate */ - NULL, /* mmap */ cryptof_poll /* poll */ }; @@ -138,8 +138,8 @@ static const struct file_operations g_cryptoops = NULL, /* write */ NULL, /* seek */ cryptoioctl, /* ioctl */ + NULL, /* mmap */ NULL, /* truncate */ - NULL, /* mmap */ NULL /* poll */ }; diff --git a/drivers/analog/adc.c b/drivers/analog/adc.c index dd60763a69dac..8c83476d10bb2 100644 --- a/drivers/analog/adc.c +++ b/drivers/analog/adc.c @@ -72,8 +72,8 @@ static const struct file_operations g_adc_fops = NULL, /* write */ NULL, /* seek */ adc_ioctl, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ adc_poll /* poll */ }; diff --git a/drivers/analog/comp.c b/drivers/analog/comp.c index 551da7b9ea05f..35445b656c85d 100644 --- a/drivers/analog/comp.c +++ b/drivers/analog/comp.c @@ -65,8 +65,8 @@ static const struct file_operations comp_fops = NULL, /* write */ NULL, /* seek */ comp_ioctl, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ comp_poll /* poll */ }; diff --git a/drivers/bch/bchdev_driver.c b/drivers/bch/bchdev_driver.c index 9069d935963c5..861c683ac47a1 100644 --- a/drivers/bch/bchdev_driver.c +++ b/drivers/bch/bchdev_driver.c @@ -78,8 +78,8 @@ const struct file_operations bch_fops = bch_write, /* write */ bch_seek, /* seek */ bch_ioctl, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ bch_poll /* poll */ #ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS , bch_unlink /* unlink */ diff --git a/drivers/can/can.c b/drivers/can/can.c index d4b26573e2ff4..6885732fd39c0 100644 --- a/drivers/can/can.c +++ b/drivers/can/can.c @@ -135,8 +135,8 @@ static const struct file_operations g_canops = can_write, /* write */ NULL, /* seek */ can_ioctl, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ can_poll /* poll */ }; diff --git a/drivers/crypto/dev_urandom.c b/drivers/crypto/dev_urandom.c index 89e8fc2e98028..8d3affd56988b 100644 --- a/drivers/crypto/dev_urandom.c +++ b/drivers/crypto/dev_urandom.c @@ -100,8 +100,8 @@ static const struct file_operations g_urand_fops = devurand_write, /* write */ NULL, /* seek */ NULL, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ devurand_poll /* poll */ }; diff --git a/drivers/i2c/i2c_driver.c b/drivers/i2c/i2c_driver.c index 57fedcb2a6fc4..d6e05a4bde057 100644 --- a/drivers/i2c/i2c_driver.c +++ b/drivers/i2c/i2c_driver.c @@ -99,8 +99,8 @@ static const struct file_operations i2cdrvr_fops = i2cdrvr_write, /* write */ NULL, /* seek */ i2cdrvr_ioctl, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ NULL /* poll */ #ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS , i2cdrvr_unlink /* unlink */ diff --git a/drivers/input/ads7843e.c b/drivers/input/ads7843e.c index 8a825e28207b0..bed02ac0cf173 100644 --- a/drivers/input/ads7843e.c +++ b/drivers/input/ads7843e.c @@ -122,8 +122,8 @@ static const struct file_operations ads7843e_fops = NULL, /* write */ NULL, /* seek */ ads7843e_ioctl, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ ads7843e_poll /* poll */ }; diff --git a/drivers/input/ajoystick.c b/drivers/input/ajoystick.c index 9c71938431602..78fc1feafe8f2 100644 --- a/drivers/input/ajoystick.c +++ b/drivers/input/ajoystick.c @@ -135,8 +135,8 @@ static const struct file_operations ajoy_fops = NULL, /* write */ NULL, /* seek */ ajoy_ioctl, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ ajoy_poll /* poll */ }; diff --git a/drivers/input/button_upper.c b/drivers/input/button_upper.c index b461a7d893e90..ebdf134f9e5b0 100644 --- a/drivers/input/button_upper.c +++ b/drivers/input/button_upper.c @@ -133,8 +133,8 @@ static const struct file_operations btn_fops = btn_write, /* write */ NULL, /* seek */ btn_ioctl, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ btn_poll /* poll */ }; diff --git a/drivers/input/cypress_mbr3108.c b/drivers/input/cypress_mbr3108.c index 59a7b2d3629b3..893296c9c9f93 100644 --- a/drivers/input/cypress_mbr3108.c +++ b/drivers/input/cypress_mbr3108.c @@ -224,8 +224,8 @@ static const struct file_operations g_mbr3108_fileops = mbr3108_write, /* write */ NULL, /* seek */ NULL, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ mbr3108_poll /* poll */ }; diff --git a/drivers/input/djoystick.c b/drivers/input/djoystick.c index 8ab905b13750b..fcff04fb6c6f1 100644 --- a/drivers/input/djoystick.c +++ b/drivers/input/djoystick.c @@ -135,8 +135,8 @@ static const struct file_operations djoy_fops = NULL, /* write */ NULL, /* seek */ djoy_ioctl, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ djoy_poll /* poll */ }; diff --git a/drivers/input/ft5x06.c b/drivers/input/ft5x06.c index 6b85c17144ece..aeea190c0a240 100644 --- a/drivers/input/ft5x06.c +++ b/drivers/input/ft5x06.c @@ -176,8 +176,8 @@ static const struct file_operations ft5x06_fops = NULL, /* write */ NULL, /* seek */ ft5x06_ioctl, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ ft5x06_poll /* poll */ }; diff --git a/drivers/input/keyboard_upper.c b/drivers/input/keyboard_upper.c index e4282dbf6a4e3..7dfa28bfcba37 100644 --- a/drivers/input/keyboard_upper.c +++ b/drivers/input/keyboard_upper.c @@ -88,8 +88,8 @@ static const struct file_operations g_keyboard_fops = keyboard_write, /* write */ NULL, /* seek */ NULL, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ keyboard_poll /* poll */ }; diff --git a/drivers/input/max11802.c b/drivers/input/max11802.c index e2757482cd8ab..a4aec28f79d6c 100644 --- a/drivers/input/max11802.c +++ b/drivers/input/max11802.c @@ -115,8 +115,8 @@ static const struct file_operations max11802_fops = NULL, /* write */ NULL, /* seek */ max11802_ioctl, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ max11802_poll /* poll */ }; diff --git a/drivers/input/mxt.c b/drivers/input/mxt.c index 3f8ac456b73e9..1ac9a7f88c0e0 100644 --- a/drivers/input/mxt.c +++ b/drivers/input/mxt.c @@ -280,8 +280,8 @@ static const struct file_operations mxt_fops = NULL, /* write */ NULL, /* seek */ mxt_ioctl, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ mxt_poll /* poll */ }; diff --git a/drivers/input/spq10kbd.c b/drivers/input/spq10kbd.c index 250dcf942f82f..deb78284ff28e 100644 --- a/drivers/input/spq10kbd.c +++ b/drivers/input/spq10kbd.c @@ -255,8 +255,8 @@ static const struct file_operations g_hidkbd_fops = spq10kbd_write, /* write */ NULL, /* seek */ NULL, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ spq10kbd_poll /* poll */ }; diff --git a/drivers/input/stmpe811_tsc.c b/drivers/input/stmpe811_tsc.c index c87cb7b1b2327..9a88393820dfa 100644 --- a/drivers/input/stmpe811_tsc.c +++ b/drivers/input/stmpe811_tsc.c @@ -124,8 +124,8 @@ static const struct file_operations g_stmpe811fops = NULL, /* write */ NULL, /* seek */ stmpe811_ioctl, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ stmpe811_poll /* poll */ }; diff --git a/drivers/input/touchscreen_upper.c b/drivers/input/touchscreen_upper.c index 5a987d7b81fcc..3bedb950365d1 100644 --- a/drivers/input/touchscreen_upper.c +++ b/drivers/input/touchscreen_upper.c @@ -90,8 +90,8 @@ static const struct file_operations g_touch_fops = touch_write, /* write */ NULL, /* seek */ touch_ioctl, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ touch_poll /* poll */ }; diff --git a/drivers/input/tsc2007.c b/drivers/input/tsc2007.c index 8a65d862b8966..20c292b2fc7e4 100644 --- a/drivers/input/tsc2007.c +++ b/drivers/input/tsc2007.c @@ -209,8 +209,8 @@ static const struct file_operations tsc2007_fops = NULL, /* write */ NULL, /* seek */ tsc2007_ioctl, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ tsc2007_poll /* poll */ }; diff --git a/drivers/lcd/ft80x.c b/drivers/lcd/ft80x.c index c75aaeea4b044..fe1ec684e5ec2 100644 --- a/drivers/lcd/ft80x.c +++ b/drivers/lcd/ft80x.c @@ -134,8 +134,8 @@ static const struct file_operations g_ft80x_fops = ft80x_write, /* write */ NULL, /* seek */ ft80x_ioctl, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ NULL /* poll */ #ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS , ft80x_unlink /* unlink */ diff --git a/drivers/lcd/pcf8574_lcd_backpack.c b/drivers/lcd/pcf8574_lcd_backpack.c index 0a0ec4dbf2ccb..011d888a5b720 100644 --- a/drivers/lcd/pcf8574_lcd_backpack.c +++ b/drivers/lcd/pcf8574_lcd_backpack.c @@ -117,8 +117,8 @@ static const struct file_operations g_pcf8574_lcd_fops = pcf8574_lcd_write, /* write */ pcf8574_lcd_seek, /* seek */ pcf8574_lcd_ioctl, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ pcf8574_lcd_poll /* poll */ #ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS , pcf8574_lcd_unlink /* unlink */ diff --git a/drivers/lcd/tda19988.c b/drivers/lcd/tda19988.c index 16a00010895fd..a3fa9f9ca48f6 100644 --- a/drivers/lcd/tda19988.c +++ b/drivers/lcd/tda19988.c @@ -170,8 +170,8 @@ static const struct file_operations tda19988_fops = tda19988_write, /* write */ tda19988_seek, /* seek */ tda19988_ioctl, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ tda19988_poll /* poll */ #ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS , tda19988_unlink /* unlink */ diff --git a/drivers/misc/dev_null.c b/drivers/misc/dev_null.c index 8a063a8a99283..6f1b78fc54cfc 100644 --- a/drivers/misc/dev_null.c +++ b/drivers/misc/dev_null.c @@ -57,8 +57,8 @@ static const struct file_operations devnull_fops = devnull_write, /* write */ NULL, /* seek */ NULL, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ devnull_poll /* poll */ }; diff --git a/drivers/misc/dev_zero.c b/drivers/misc/dev_zero.c index 63b9c4185d07e..59720922f53cf 100644 --- a/drivers/misc/dev_zero.c +++ b/drivers/misc/dev_zero.c @@ -57,8 +57,8 @@ static const struct file_operations devzero_fops = devzero_write, /* write */ NULL, /* seek */ NULL, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ devzero_poll /* poll */ }; diff --git a/drivers/misc/rpmsgdev.c b/drivers/misc/rpmsgdev.c index 81e49744470ba..4023b44501e82 100644 --- a/drivers/misc/rpmsgdev.c +++ b/drivers/misc/rpmsgdev.c @@ -165,8 +165,8 @@ const struct file_operations g_rpmsgdev_ops = rpmsgdev_write, /* write */ rpmsgdev_seek, /* seek */ rpmsgdev_ioctl, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ rpmsgdev_poll /* poll */ }; diff --git a/drivers/modem/alt1250/alt1250.c b/drivers/modem/alt1250/alt1250.c index 7e76bd199fb3d..b8481cdb08246 100644 --- a/drivers/modem/alt1250/alt1250.c +++ b/drivers/modem/alt1250/alt1250.c @@ -77,8 +77,8 @@ static const struct file_operations g_alt1250fops = NULL, /* write */ NULL, /* seek */ alt1250_ioctl, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ alt1250_poll, /* poll */ }; static uint8_t g_recvbuff[ALTCOM_RX_PKT_SIZE_MAX]; diff --git a/drivers/modem/u-blox.c b/drivers/modem/u-blox.c index 9a9f1de90d223..dbcbb5513709c 100644 --- a/drivers/modem/u-blox.c +++ b/drivers/modem/u-blox.c @@ -114,8 +114,8 @@ static const struct file_operations ubxmdm_fops = ubxmdm_write, /* write */ NULL, /* seek */ ubxmdm_ioctl, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ ubxmdm_poll /* poll */ }; diff --git a/drivers/mtd/mtd_config.c b/drivers/mtd/mtd_config.c index fb6659fdf9e6c..0da348c2fec51 100644 --- a/drivers/mtd/mtd_config.c +++ b/drivers/mtd/mtd_config.c @@ -119,8 +119,8 @@ static const struct file_operations mtdconfig_fops = NULL, /* write */ NULL, /* seek */ mtdconfig_ioctl, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ mtdconfig_poll /* poll */ }; diff --git a/drivers/net/telnet.c b/drivers/net/telnet.c index 32c88f200acfe..63e8ef5ef3d72 100644 --- a/drivers/net/telnet.c +++ b/drivers/net/telnet.c @@ -190,8 +190,8 @@ static const struct file_operations g_telnet_fops = telnet_write, /* write */ NULL, /* seek */ telnet_ioctl, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ telnet_poll /* poll */ }; diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 81fa0b1d9c58e..47d32be57d2a8 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c @@ -219,8 +219,8 @@ static const struct file_operations g_tun_file_ops = tun_write, /* write */ NULL, /* seek */ tun_ioctl, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ tun_poll /* poll */ }; diff --git a/drivers/pipes/fifo.c b/drivers/pipes/fifo.c index 283f1614ff8f1..938708c41e2d1 100644 --- a/drivers/pipes/fifo.c +++ b/drivers/pipes/fifo.c @@ -47,8 +47,8 @@ static const struct file_operations g_fifo_fops = pipecommon_write, /* write */ NULL, /* seek */ pipecommon_ioctl, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ pipecommon_poll /* poll */ #ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS , pipecommon_unlink /* unlink */ diff --git a/drivers/pipes/pipe.c b/drivers/pipes/pipe.c index 5bc8716d5bfee..1993597347772 100644 --- a/drivers/pipes/pipe.c +++ b/drivers/pipes/pipe.c @@ -61,8 +61,8 @@ static const struct file_operations g_pipe_fops = pipecommon_write, /* write */ NULL, /* seek */ pipecommon_ioctl, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ pipecommon_poll /* poll */ }; diff --git a/drivers/power/battery/battery_charger.c b/drivers/power/battery/battery_charger.c index bc005ca7be0e3..b2b18da2d60ac 100644 --- a/drivers/power/battery/battery_charger.c +++ b/drivers/power/battery/battery_charger.c @@ -91,8 +91,8 @@ static const struct file_operations g_batteryops = bat_charger_write, /* write */ NULL, /* seek */ bat_charger_ioctl, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ bat_charger_poll /* poll */ }; diff --git a/drivers/power/battery/battery_gauge.c b/drivers/power/battery/battery_gauge.c index 395ad51a84797..b0cbccda0b98d 100644 --- a/drivers/power/battery/battery_gauge.c +++ b/drivers/power/battery/battery_gauge.c @@ -93,8 +93,8 @@ static const struct file_operations g_batteryops = bat_gauge_write, /* write */ NULL, /* seek */ bat_gauge_ioctl, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ bat_gauge_poll /* poll */ }; diff --git a/drivers/power/battery/battery_monitor.c b/drivers/power/battery/battery_monitor.c index 447f14d1ec030..49faab7d25b98 100644 --- a/drivers/power/battery/battery_monitor.c +++ b/drivers/power/battery/battery_monitor.c @@ -92,8 +92,8 @@ static const struct file_operations g_batteryops = bat_monitor_write, /* write */ NULL, /* seek */ bat_monitor_ioctl, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ bat_monitor_poll /* poll */ }; diff --git a/drivers/rc/lirc_dev.c b/drivers/rc/lirc_dev.c index b63540e01fe39..0cb65fc3c4b31 100644 --- a/drivers/rc/lirc_dev.c +++ b/drivers/rc/lirc_dev.c @@ -103,8 +103,8 @@ static const struct file_operations g_lirc_fops = lirc_write, /* write */ NULL, /* seek */ lirc_ioctl, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ lirc_poll /* poll */ }; diff --git a/drivers/sensors/aht10.c b/drivers/sensors/aht10.c index 514e0c96eb275..33c9fdbb25530 100644 --- a/drivers/sensors/aht10.c +++ b/drivers/sensors/aht10.c @@ -116,8 +116,8 @@ static const struct file_operations g_aht10fops = aht10_write, /* write */ NULL, /* seek */ aht10_ioctl, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ NULL /* poll */ #ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS , aht10_unlink /* unlink */ diff --git a/drivers/sensors/hc_sr04.c b/drivers/sensors/hc_sr04.c index 16001191498e6..859f36a16b6ce 100644 --- a/drivers/sensors/hc_sr04.c +++ b/drivers/sensors/hc_sr04.c @@ -90,8 +90,8 @@ static const struct file_operations g_hcsr04ops = hcsr04_write, /* write */ NULL, /* seek */ hcsr04_ioctl, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ hcsr04_poll /* poll */ }; diff --git a/drivers/sensors/hdc1008.c b/drivers/sensors/hdc1008.c index 44f83ed33b818..9e95abb78f864 100644 --- a/drivers/sensors/hdc1008.c +++ b/drivers/sensors/hdc1008.c @@ -161,8 +161,8 @@ static const struct file_operations g_hdc1008fops = hdc1008_write, /* write */ NULL, /* seek */ hdc1008_ioctl, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ NULL /* poll */ #ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS , hdc1008_unlink /* unlink */ diff --git a/drivers/sensors/hts221.c b/drivers/sensors/hts221.c index 44e7c9a1f4158..830b1c59f61a6 100644 --- a/drivers/sensors/hts221.c +++ b/drivers/sensors/hts221.c @@ -157,8 +157,8 @@ static const struct file_operations g_humidityops = hts221_write, /* write */ NULL, /* seek */ hts221_ioctl, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ hts221_poll /* poll */ }; diff --git a/drivers/sensors/lis2dh.c b/drivers/sensors/lis2dh.c index 554390cc4c27f..f1fcf2597d7d2 100644 --- a/drivers/sensors/lis2dh.c +++ b/drivers/sensors/lis2dh.c @@ -154,8 +154,8 @@ static const struct file_operations g_lis2dhops = lis2dh_write, /* write */ NULL, /* seek */ lis2dh_ioctl, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ lis2dh_poll /* poll */ }; diff --git a/drivers/sensors/max44009.c b/drivers/sensors/max44009.c index 7de5801722582..dd9c7eba45206 100644 --- a/drivers/sensors/max44009.c +++ b/drivers/sensors/max44009.c @@ -112,8 +112,8 @@ static const struct file_operations g_alsops = max44009_write, /* write */ NULL, /* seek */ max44009_ioctl, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ max44009_poll /* poll */ }; diff --git a/drivers/sensors/scd30.c b/drivers/sensors/scd30.c index 54317a85f0cb3..b1d56c7076913 100644 --- a/drivers/sensors/scd30.c +++ b/drivers/sensors/scd30.c @@ -182,8 +182,8 @@ static const struct file_operations g_scd30fops = scd30_write, /* write */ NULL, /* seek */ scd30_ioctl, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ NULL /* poll */ #ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS , scd30_unlink /* unlink */ diff --git a/drivers/sensors/scd41.c b/drivers/sensors/scd41.c index 74288c4f5b69d..c8a771390b75e 100644 --- a/drivers/sensors/scd41.c +++ b/drivers/sensors/scd41.c @@ -190,8 +190,8 @@ static const struct file_operations g_scd41fops = scd41_write, /* write */ NULL, /* seek */ scd41_ioctl, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ NULL /* poll */ #ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS , scd41_unlink /* unlink */ diff --git a/drivers/sensors/sensor.c b/drivers/sensors/sensor.c index 1143592db14ef..b10e568310633 100644 --- a/drivers/sensors/sensor.c +++ b/drivers/sensors/sensor.c @@ -167,8 +167,8 @@ static const struct file_operations g_sensor_fops = sensor_write, /* write */ NULL, /* seek */ sensor_ioctl, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ sensor_poll /* poll */ }; diff --git a/drivers/sensors/sgp30.c b/drivers/sensors/sgp30.c index e9ad20336e1d3..bc7e528ca5e4d 100644 --- a/drivers/sensors/sgp30.c +++ b/drivers/sensors/sgp30.c @@ -159,8 +159,8 @@ static const struct file_operations g_sgp30fops = sgp30_write, /* write */ NULL, /* seek */ sgp30_ioctl, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ NULL /* poll */ #ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS , sgp30_unlink /* unlink */ diff --git a/drivers/sensors/sht21.c b/drivers/sensors/sht21.c index e3146638135ff..806aa6053ba6b 100644 --- a/drivers/sensors/sht21.c +++ b/drivers/sensors/sht21.c @@ -131,8 +131,8 @@ static const struct file_operations g_sht21fops = sht21_write, /* write */ NULL, /* seek */ sht21_ioctl, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ NULL /* poll */ #ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS , sht21_unlink /* unlink */ diff --git a/drivers/sensors/sht3x.c b/drivers/sensors/sht3x.c index ffcb146ce2a70..604d78b54a480 100644 --- a/drivers/sensors/sht3x.c +++ b/drivers/sensors/sht3x.c @@ -170,8 +170,8 @@ static const struct file_operations g_sht3xfops = sht3x_write, /* write */ NULL, /* seek */ sht3x_ioctl, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ NULL /* poll */ #ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS , sht3x_unlink /* unlink */ diff --git a/drivers/sensors/sps30.c b/drivers/sensors/sps30.c index 37f7f010c0efa..b5434e5700c23 100644 --- a/drivers/sensors/sps30.c +++ b/drivers/sensors/sps30.c @@ -175,8 +175,8 @@ static const struct file_operations g_sps30fops = sps30_write, /* write */ NULL, /* seek */ sps30_ioctl, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ NULL /* poll */ #ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS , sps30_unlink /* unlink */ diff --git a/drivers/sensors/usensor.c b/drivers/sensors/usensor.c index e0d1dda2a5174..9f472e24e54b9 100644 --- a/drivers/sensors/usensor.c +++ b/drivers/sensors/usensor.c @@ -81,8 +81,8 @@ static const struct file_operations g_usensor_fops = usensor_write, /* write */ NULL, /* seek */ usensor_ioctl, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ NULL, /* poll */ }; diff --git a/drivers/serial/pty.c b/drivers/serial/pty.c index c06cb6fd26e07..6fa78a0b66b45 100644 --- a/drivers/serial/pty.c +++ b/drivers/serial/pty.c @@ -127,8 +127,8 @@ static const struct file_operations g_pty_fops = pty_write, /* write */ NULL, /* seek */ pty_ioctl, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ pty_poll /* poll */ #ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS , pty_unlink /* unlink */ diff --git a/drivers/serial/serial.c b/drivers/serial/serial.c index 0fdabee16e114..d68c8a89a66a2 100644 --- a/drivers/serial/serial.c +++ b/drivers/serial/serial.c @@ -126,8 +126,8 @@ static const struct file_operations g_serialops = uart_write, /* write */ NULL, /* seek */ uart_ioctl, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ uart_poll /* poll */ }; diff --git a/drivers/serial/uart_bth4.c b/drivers/serial/uart_bth4.c index 97e9717ae3591..7042dec187f3c 100644 --- a/drivers/serial/uart_bth4.c +++ b/drivers/serial/uart_bth4.c @@ -90,8 +90,8 @@ static const struct file_operations g_uart_bth4_ops = uart_bth4_write, /* write */ NULL, /* seek */ uart_bth4_ioctl, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ uart_bth4_poll /* poll */ }; diff --git a/drivers/spi/spi_driver.c b/drivers/spi/spi_driver.c index 583344d72d4ba..7dadf3f4aa1c3 100644 --- a/drivers/spi/spi_driver.c +++ b/drivers/spi/spi_driver.c @@ -99,8 +99,8 @@ static const struct file_operations spidrvr_fops = spidrvr_write, /* write */ NULL, /* seek */ spidrvr_ioctl, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ NULL /* poll */ #ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS , spidrvr_unlink /* unlink */ diff --git a/drivers/spi/spi_slave_driver.c b/drivers/spi/spi_slave_driver.c index c2eaff7672399..bcf454379a671 100644 --- a/drivers/spi/spi_slave_driver.c +++ b/drivers/spi/spi_slave_driver.c @@ -127,8 +127,8 @@ static const struct file_operations g_spislavefops = spi_slave_write, /* write */ NULL, /* seek */ NULL, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ NULL /* poll */ #ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS , spi_slave_unlink /* unlink */ diff --git a/drivers/syslog/ramlog.c b/drivers/syslog/ramlog.c index b87765e24d2a9..38c5c5392b124 100644 --- a/drivers/syslog/ramlog.c +++ b/drivers/syslog/ramlog.c @@ -114,8 +114,8 @@ static const struct file_operations g_ramlogfops = ramlog_file_write, /* write */ NULL, /* seek */ ramlog_file_ioctl, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ ramlog_file_poll /* poll */ }; diff --git a/drivers/timers/rtc.c b/drivers/timers/rtc.c index b77405bd1ade0..14abf542ababe 100644 --- a/drivers/timers/rtc.c +++ b/drivers/timers/rtc.c @@ -129,8 +129,8 @@ static const struct file_operations rtc_fops = rtc_write, /* write */ NULL, /* seek */ rtc_ioctl, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ NULL /* poll */ #ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS , rtc_unlink /* unlink */ diff --git a/drivers/usbdev/adb.c b/drivers/usbdev/adb.c index 0639df30c70a3..4c870425535df 100755 --- a/drivers/usbdev/adb.c +++ b/drivers/usbdev/adb.c @@ -254,8 +254,8 @@ static const struct file_operations g_adb_fops = adb_char_write, /* write */ NULL, /* seek */ NULL, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ adb_char_poll /* poll */ }; diff --git a/drivers/usbhost/usbhost_cdcmbim.c b/drivers/usbhost/usbhost_cdcmbim.c index 94834835835b4..d4919c0f674b0 100644 --- a/drivers/usbhost/usbhost_cdcmbim.c +++ b/drivers/usbhost/usbhost_cdcmbim.c @@ -347,8 +347,8 @@ static const struct file_operations cdcwdm_fops = cdcwdm_write, /* write */ NULL, /* seek */ NULL, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ cdcwdm_poll /* poll */ }; diff --git a/drivers/usbhost/usbhost_hidkbd.c b/drivers/usbhost/usbhost_hidkbd.c index bd470ccdea53c..73d062c8b5966 100644 --- a/drivers/usbhost/usbhost_hidkbd.c +++ b/drivers/usbhost/usbhost_hidkbd.c @@ -341,8 +341,8 @@ static const struct file_operations g_hidkbd_fops = usbhost_write, /* write */ NULL, /* seek */ NULL, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ usbhost_poll /* poll */ }; diff --git a/drivers/usbhost/usbhost_hidmouse.c b/drivers/usbhost/usbhost_hidmouse.c index 8b1351bb710d9..1a582df775fc4 100644 --- a/drivers/usbhost/usbhost_hidmouse.c +++ b/drivers/usbhost/usbhost_hidmouse.c @@ -391,8 +391,8 @@ static const struct file_operations g_hidmouse_fops = usbhost_write, /* write */ NULL, /* seek */ NULL, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ usbhost_poll /* poll */ }; diff --git a/drivers/usbhost/usbhost_xboxcontroller.c b/drivers/usbhost/usbhost_xboxcontroller.c index 0cb83a238cdb0..d90f02e2ceb93 100644 --- a/drivers/usbhost/usbhost_xboxcontroller.c +++ b/drivers/usbhost/usbhost_xboxcontroller.c @@ -296,8 +296,8 @@ static const struct file_operations g_xboxcontroller_fops = usbhost_write, /* write */ NULL, /* seek */ usbhost_ioctl, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ usbhost_poll /* poll */ }; diff --git a/drivers/usbmisc/fusb301.c b/drivers/usbmisc/fusb301.c index 12db5b430d9fd..ec4c061f86a52 100644 --- a/drivers/usbmisc/fusb301.c +++ b/drivers/usbmisc/fusb301.c @@ -94,8 +94,8 @@ static const struct file_operations g_fusb301ops = fusb301_write, /* write */ NULL, /* seek */ fusb301_ioctl, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ fusb301_poll /* poll */ }; diff --git a/drivers/usbmisc/fusb303.c b/drivers/usbmisc/fusb303.c index b90cde464052c..e633cf54ca183 100644 --- a/drivers/usbmisc/fusb303.c +++ b/drivers/usbmisc/fusb303.c @@ -128,8 +128,8 @@ static const struct file_operations g_fusb303ops = fusb303_write, /* write */ NULL, /* seek */ fusb303_ioctl, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ fusb303_poll /* poll */ }; diff --git a/drivers/usrsock/usrsock_dev.c b/drivers/usrsock/usrsock_dev.c index cdefc5e70bf23..d2cb9adc9b626 100644 --- a/drivers/usrsock/usrsock_dev.c +++ b/drivers/usrsock/usrsock_dev.c @@ -103,8 +103,8 @@ static const struct file_operations g_usrsockdevops = usrsockdev_write, /* write */ usrsockdev_seek, /* seek */ NULL, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ usrsockdev_poll /* poll */ }; diff --git a/drivers/video/fb.c b/drivers/video/fb.c index bea9c54d65ed5..9a0a764ca767e 100644 --- a/drivers/video/fb.c +++ b/drivers/video/fb.c @@ -88,8 +88,8 @@ static const struct file_operations fb_fops = fb_write, /* write */ fb_seek, /* seek */ fb_ioctl, /* ioctl */ - NULL, /* truncate */ fb_mmap, /* mmap */ + NULL, /* truncate */ fb_poll /* poll */ }; @@ -686,7 +686,8 @@ static int fb_mmap(FAR struct file *filep, FAR struct mm_map_entry_s *map) /* Return the address corresponding to the start of frame buffer. */ - if (map->offset + map->length <= fb->fblen) + if (map->offset >= 0 && map->offset < fb->fblen && + map->length && map->offset + map->length <= fb->fblen) { map->vaddr = (FAR char *)fb->fbmem + map->offset; ret = OK; diff --git a/drivers/video/video.c b/drivers/video/video.c index 2309909c89eb3..3c45408603eab 100644 --- a/drivers/video/video.c +++ b/drivers/video/video.c @@ -287,7 +287,6 @@ static const struct file_operations g_video_fops = video_write, /* write */ NULL, /* seek */ video_ioctl, /* ioctl */ - NULL, /* truncate */ video_mmap, /* mmap */ }; @@ -1583,6 +1582,12 @@ static size_t get_bufsize(FAR video_format_t *vf) } } +static size_t get_heapsize(FAR video_type_inf_t *type_inf) +{ + return type_inf->bufinf.container_size * + get_bufsize(&type_inf->fmt[VIDEO_FMT_MAIN]); +} + static int video_try_fmt(FAR struct video_mng_s *priv, FAR struct v4l2_format *v4l2) { @@ -3196,13 +3201,16 @@ static int video_ioctl(FAR struct file *filep, int cmd, unsigned long arg) static int video_mmap(FAR struct file *filep, FAR struct mm_map_entry_s *map) { - FAR struct inode *inode = filep->f_inode; - FAR video_mng_t *priv = (FAR video_mng_t *)inode->i_private; - int ret = -EINVAL; + FAR struct inode *inode = filep->f_inode; + FAR video_mng_t *priv = (FAR video_mng_t *)inode->i_private; + FAR video_type_inf_t *type_inf = &priv->video_inf; + size_t heapsize = get_heapsize(type_inf); + int ret = -EINVAL; - if (map) + if (map->offset >= 0 && map->offset < heapsize && + map->length && map->offset + map->length <= heapsize) { - map->vaddr = priv->video_inf.bufheap + map->offset; + map->vaddr = type_inf->bufheap + map->offset; ret = OK; } diff --git a/drivers/wireless/cc1101.c b/drivers/wireless/cc1101.c index a3fcc638c4771..91d0e434b7b3e 100644 --- a/drivers/wireless/cc1101.c +++ b/drivers/wireless/cc1101.c @@ -305,8 +305,8 @@ static const struct file_operations g_cc1101ops = cc1101_file_write, /* write */ NULL, /* seek */ NULL, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ cc1101_file_poll /* poll */ }; diff --git a/drivers/wireless/gs2200m.c b/drivers/wireless/gs2200m.c index 2d5f193dd43d5..10ca3b5988bfd 100644 --- a/drivers/wireless/gs2200m.c +++ b/drivers/wireless/gs2200m.c @@ -231,8 +231,8 @@ static const struct file_operations g_gs2200m_fops = gs2200m_write, /* write */ NULL, /* seek */ gs2200m_ioctl, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ gs2200m_poll /* poll */ }; diff --git a/drivers/wireless/lpwan/sx127x/sx127x.c b/drivers/wireless/lpwan/sx127x/sx127x.c index f6862cab20d86..35ee13b4a6c63 100644 --- a/drivers/wireless/lpwan/sx127x/sx127x.c +++ b/drivers/wireless/lpwan/sx127x/sx127x.c @@ -451,8 +451,8 @@ static const struct file_operations sx127x_fops = sx127x_write, /* write */ NULL, /* seek */ sx127x_ioctl, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ sx127x_poll /* poll */ }; diff --git a/drivers/wireless/nrf24l01.c b/drivers/wireless/nrf24l01.c index 3bf57677e931e..9eea16cc99b18 100644 --- a/drivers/wireless/nrf24l01.c +++ b/drivers/wireless/nrf24l01.c @@ -239,8 +239,8 @@ static const struct file_operations nrf24l01_fops = nrf24l01_write, /* write */ NULL, /* seek */ nrf24l01_ioctl, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ nrf24l01_poll /* poll */ }; diff --git a/fs/binfs/fs_binfs.c b/fs/binfs/fs_binfs.c index 758d8c31f7cf9..a03e81c7e1fdf 100644 --- a/fs/binfs/fs_binfs.c +++ b/fs/binfs/fs_binfs.c @@ -109,8 +109,8 @@ const struct mountpt_operations binfs_operations = NULL, /* write */ NULL, /* seek */ binfs_ioctl, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ NULL, /* sync */ binfs_dup, /* dup */ diff --git a/fs/cromfs/fs_cromfs.c b/fs/cromfs/fs_cromfs.c index c80584871bf05..f1d03e3dfc56c 100644 --- a/fs/cromfs/fs_cromfs.c +++ b/fs/cromfs/fs_cromfs.c @@ -184,8 +184,8 @@ const struct mountpt_operations cromfs_operations = NULL, /* write */ NULL, /* seek */ cromfs_ioctl, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ NULL, /* sync */ cromfs_dup, /* dup */ diff --git a/fs/fat/fs_fat32.c b/fs/fat/fs_fat32.c index 5086868e18276..f2ac86a9281a4 100644 --- a/fs/fat/fs_fat32.c +++ b/fs/fat/fs_fat32.c @@ -115,8 +115,8 @@ const struct mountpt_operations fat_operations = fat_write, /* write */ fat_seek, /* seek */ fat_ioctl, /* ioctl */ - fat_truncate, /* truncate */ NULL, /* mmap */ + fat_truncate, /* truncate */ fat_sync, /* sync */ fat_dup, /* dup */ fat_fstat, /* fstat */ diff --git a/fs/hostfs/hostfs.c b/fs/hostfs/hostfs.c index 1bb795fe545e0..dc9b53e1124f8 100644 --- a/fs/hostfs/hostfs.c +++ b/fs/hostfs/hostfs.c @@ -142,8 +142,8 @@ const struct mountpt_operations hostfs_operations = hostfs_write, /* write */ hostfs_seek, /* seek */ hostfs_ioctl, /* ioctl */ - hostfs_ftruncate, /* ftruncate */ NULL, /* mmap */ + hostfs_ftruncate, /* ftruncate */ hostfs_sync, /* sync */ hostfs_dup, /* dup */ diff --git a/fs/littlefs/lfs_vfs.c b/fs/littlefs/lfs_vfs.c index 22b55e50484ed..fc42d68bc8ae3 100644 --- a/fs/littlefs/lfs_vfs.c +++ b/fs/littlefs/lfs_vfs.c @@ -140,8 +140,8 @@ const struct mountpt_operations littlefs_operations = littlefs_write, /* write */ littlefs_seek, /* seek */ littlefs_ioctl, /* ioctl */ - littlefs_truncate, /* truncate */ NULL, /* mmap */ + littlefs_truncate, /* truncate */ littlefs_sync, /* sync */ littlefs_dup, /* dup */ diff --git a/fs/mqueue/mq_open.c b/fs/mqueue/mq_open.c index 204e45a7ee4ea..7fc6cf9915af0 100644 --- a/fs/mqueue/mq_open.c +++ b/fs/mqueue/mq_open.c @@ -60,8 +60,8 @@ static const struct file_operations g_nxmq_fileops = NULL, /* write */ NULL, /* seek */ NULL, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ nxmq_file_poll /* poll */ }; diff --git a/fs/nfs/nfs_vfsops.c b/fs/nfs/nfs_vfsops.c index 7eae707be206f..1358bc4f814cc 100644 --- a/fs/nfs/nfs_vfsops.c +++ b/fs/nfs/nfs_vfsops.c @@ -198,8 +198,8 @@ const struct mountpt_operations nfs_operations = nfs_write, /* write */ NULL, /* seek */ NULL, /* ioctl */ - nfs_truncate, /* truncate */ NULL, /* mmap */ + nfs_truncate, /* truncate */ NULL, /* sync */ nfs_dup, /* dup */ diff --git a/fs/nxffs/nxffs_initialize.c b/fs/nxffs/nxffs_initialize.c index 9b7e124a5448f..7e97e19b957e0 100644 --- a/fs/nxffs/nxffs_initialize.c +++ b/fs/nxffs/nxffs_initialize.c @@ -54,12 +54,12 @@ const struct mountpt_operations nxffs_operations = nxffs_write, /* write */ NULL, /* seek -- Use f_pos in struct file */ nxffs_ioctl, /* ioctl */ + NULL, /* mmap */ #ifdef __NO_TRUNCATE_SUPPORT__ nxffs_truncate, /* truncate */ #else NULL, /* truncate */ #endif - NULL, /* mmap */ NULL, /* sync -- No buffered data */ nxffs_dup, /* dup */ diff --git a/fs/procfs/fs_procfs.c b/fs/procfs/fs_procfs.c index 7b446cc12eee3..bcecf480b58f9 100644 --- a/fs/procfs/fs_procfs.c +++ b/fs/procfs/fs_procfs.c @@ -252,8 +252,8 @@ const struct mountpt_operations procfs_operations = procfs_write, /* write */ NULL, /* seek */ procfs_ioctl, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ NULL, /* sync */ procfs_dup, /* dup */ diff --git a/fs/romfs/fs_romfs.c b/fs/romfs/fs_romfs.c index 6d45fc48f6f0b..bafcdd25bd5c8 100644 --- a/fs/romfs/fs_romfs.c +++ b/fs/romfs/fs_romfs.c @@ -121,8 +121,8 @@ const struct mountpt_operations romfs_operations = NULL, /* write */ romfs_seek, /* seek */ romfs_ioctl, /* ioctl */ - NULL, /* truncate */ romfs_mmap, /* mmap */ + NULL, /* truncate */ NULL, /* sync */ romfs_dup, /* dup */ @@ -580,7 +580,7 @@ static off_t romfs_seek(FAR struct file *filep, off_t offset, int whence) static int romfs_ioctl(FAR struct file *filep, int cmd, unsigned long arg) { - FAR struct romfs_file_s *rf; + FAR struct romfs_file_s *rf; finfo("cmd: %d arg: %08lx\n", cmd, arg); @@ -625,8 +625,8 @@ static int romfs_mmap(FAR struct file *filep, FAR struct mm_map_entry_s *map) * the file. */ - if (map && rm && rm->rm_xipbase && rf && - map->offset + map->length <= rf->rf_size) + if (rm->rm_xipbase && map->offset >= 0 && map->offset < rf->rf_size && + map->length != 0 && map->offset + map->length <= rf->rf_size) { map->vaddr = rm->rm_xipbase + rf->rf_startoffset + map->offset; ret = OK; diff --git a/fs/rpmsgfs/rpmsgfs.c b/fs/rpmsgfs/rpmsgfs.c index b56f5662bd61c..63cfc2900399c 100644 --- a/fs/rpmsgfs/rpmsgfs.c +++ b/fs/rpmsgfs/rpmsgfs.c @@ -109,7 +109,7 @@ static int rpmsgfs_fstat(FAR const struct file *filep, FAR struct stat *buf); static int rpmsgfs_fchstat(FAR const struct file *filep, FAR const struct stat *buf, int flags); -static int rpmsgfs_ftruncate(FAR struct file *filep, +static int rpmsgfs_truncate(FAR struct file *filep, off_t length); static int rpmsgfs_opendir(FAR struct inode *mountpt, @@ -161,8 +161,8 @@ const struct mountpt_operations rpmsgfs_operations = rpmsgfs_write, /* write */ rpmsgfs_seek, /* seek */ rpmsgfs_ioctl, /* ioctl */ - rpmsgfs_ftruncate, /* ftruncate */ NULL, /* mmap */ + rpmsgfs_truncate, /* truncate */ rpmsgfs_sync, /* sync */ rpmsgfs_dup, /* dup */ @@ -804,7 +804,7 @@ static int rpmsgfs_fchstat(FAR const struct file *filep, } /**************************************************************************** - * Name: rpmsgfs_ftruncate + * Name: rpmsgfs_truncate * * Description: * Set the length of the open, regular file associated with the file @@ -812,7 +812,7 @@ static int rpmsgfs_fchstat(FAR const struct file *filep, * ****************************************************************************/ -static int rpmsgfs_ftruncate(FAR struct file *filep, off_t length) +static int rpmsgfs_truncate(FAR struct file *filep, off_t length) { FAR struct inode *inode; FAR struct rpmsgfs_mountpt_s *fs; diff --git a/fs/smartfs/smartfs_smart.c b/fs/smartfs/smartfs_smart.c index 93486cedf7fae..d7928edd1ae67 100644 --- a/fs/smartfs/smartfs_smart.c +++ b/fs/smartfs/smartfs_smart.c @@ -140,8 +140,8 @@ const struct mountpt_operations smartfs_operations = smartfs_write, /* write */ smartfs_seek, /* seek */ smartfs_ioctl, /* ioctl */ - smartfs_truncate, /* truncate */ NULL, /* mmap */ + smartfs_truncate, /* truncate */ smartfs_sync, /* sync */ smartfs_dup, /* dup */ diff --git a/fs/socket/socket.c b/fs/socket/socket.c index aff1dcf4bd462..6555f4255d177 100644 --- a/fs/socket/socket.c +++ b/fs/socket/socket.c @@ -64,8 +64,8 @@ static const struct file_operations g_sock_fileops = sock_file_write, /* write */ NULL, /* seek */ sock_file_ioctl, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ sock_file_poll /* poll */ }; diff --git a/fs/spiffs/src/spiffs_vfs.c b/fs/spiffs/src/spiffs_vfs.c index b3c9b77fbd4b9..163c427054d99 100644 --- a/fs/spiffs/src/spiffs_vfs.c +++ b/fs/spiffs/src/spiffs_vfs.c @@ -141,8 +141,8 @@ const struct mountpt_operations spiffs_operations = spiffs_write, /* write */ spiffs_seek, /* seek */ spiffs_ioctl, /* ioctl */ - spiffs_truncate, /* truncate */ NULL, /* mmap */ + spiffs_truncate, /* truncate */ spiffs_sync, /* sync */ spiffs_dup, /* dup */ diff --git a/fs/tmpfs/fs_tmpfs.c b/fs/tmpfs/fs_tmpfs.c index 7db062e62a900..56dbd39fa59e6 100644 --- a/fs/tmpfs/fs_tmpfs.c +++ b/fs/tmpfs/fs_tmpfs.c @@ -178,8 +178,8 @@ const struct mountpt_operations tmpfs_operations = tmpfs_write, /* write */ tmpfs_seek, /* seek */ NULL, /* ioctl */ - tmpfs_truncate, /* truncate */ tmpfs_mmap, /* mmap */ + tmpfs_truncate, /* truncate */ tmpfs_sync, /* sync */ tmpfs_dup, /* dup */ @@ -1655,7 +1655,8 @@ static int tmpfs_mmap(FAR struct file *filep, FAR struct mm_map_entry_s *map) DEBUGASSERT(tfo != NULL); - if (map && map->offset + map->length <= tfo->tfo_size) + if (map->offset >= 0 && map->offset < tfo->tfo_size && + map->length && map->offset + map->length <= tfo->tfo_size) { map->vaddr = tfo->tfo_data + map->offset; ret = OK; diff --git a/fs/unionfs/fs_unionfs.c b/fs/unionfs/fs_unionfs.c index 6aa10c83f22bd..bf0c642cff9f0 100644 --- a/fs/unionfs/fs_unionfs.c +++ b/fs/unionfs/fs_unionfs.c @@ -222,8 +222,8 @@ const struct mountpt_operations unionfs_operations = unionfs_write, /* write */ unionfs_seek, /* seek */ unionfs_ioctl, /* ioctl */ - unionfs_truncate, /* truncate */ NULL, /* mmap */ + unionfs_truncate, /* truncate */ unionfs_sync, /* sync */ unionfs_dup, /* dup */ diff --git a/fs/userfs/fs_userfs.c b/fs/userfs/fs_userfs.c index fad5276b98908..953b3c6caba30 100644 --- a/fs/userfs/fs_userfs.c +++ b/fs/userfs/fs_userfs.c @@ -160,8 +160,8 @@ const struct mountpt_operations userfs_operations = userfs_write, /* write */ userfs_seek, /* seek */ userfs_ioctl, /* ioctl */ - userfs_truncate, /* truncate */ NULL, /* mmap */ + userfs_truncate, /* truncate */ userfs_sync, /* sync */ userfs_dup, /* dup */ diff --git a/fs/vfs/fs_epoll.c b/fs/vfs/fs_epoll.c index 964d90e1b14ea..a75c793022f82 100644 --- a/fs/vfs/fs_epoll.c +++ b/fs/vfs/fs_epoll.c @@ -104,8 +104,8 @@ static const struct file_operations g_epoll_ops = NULL, /* write */ NULL, /* seek */ NULL, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ epoll_do_poll /* poll */ }; diff --git a/fs/vfs/fs_eventfd.c b/fs/vfs/fs_eventfd.c index 50ccd4e2af607..ac3287b47499e 100644 --- a/fs/vfs/fs_eventfd.c +++ b/fs/vfs/fs_eventfd.c @@ -100,8 +100,8 @@ static const struct file_operations g_eventfd_fops = eventfd_do_write, /* write */ NULL, /* seek */ NULL, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ #ifdef CONFIG_EVENT_FD_POLL eventfd_do_poll /* poll */ #endif diff --git a/fs/vfs/fs_signalfd.c b/fs/vfs/fs_signalfd.c index bd5ddd3cd5811..62e4963468a7d 100644 --- a/fs/vfs/fs_signalfd.c +++ b/fs/vfs/fs_signalfd.c @@ -79,8 +79,8 @@ static const struct file_operations g_signalfd_fileops = NULL, /* write */ NULL, /* seek */ NULL, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ signalfd_file_poll /* poll */ }; diff --git a/graphics/nxterm/nxterm_driver.c b/graphics/nxterm/nxterm_driver.c index 7fd79f7bc28d4..4367c6d61c354 100644 --- a/graphics/nxterm/nxterm_driver.c +++ b/graphics/nxterm/nxterm_driver.c @@ -66,8 +66,8 @@ const struct file_operations g_nxterm_drvrops = nxterm_write, /* write */ NULL, /* seek */ nxterm_ioctl, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ nxterm_poll /* poll */ #ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS , nxterm_unlink /* unlink */ @@ -84,8 +84,8 @@ const struct file_operations g_nxterm_drvrops = nxterm_write, /* write */ NULL, /* seek */ nxterm_ioctl, /* ioctl */ - NULL, /* truncate */ NULL, /* mmap */ + NULL, /* truncate */ NULL /* poll */ #ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS , nxterm_unlink /* unlink */ diff --git a/include/nuttx/fs/fs.h b/include/nuttx/fs/fs.h index 21e31adf03e24..6032252b16184 100644 --- a/include/nuttx/fs/fs.h +++ b/include/nuttx/fs/fs.h @@ -213,8 +213,8 @@ struct file_operations size_t buflen); off_t (*seek)(FAR struct file *filep, off_t offset, int whence); int (*ioctl)(FAR struct file *filep, int cmd, unsigned long arg); - int (*truncate)(FAR struct file *filep, off_t length); int (*mmap)(FAR struct file *filep, FAR struct mm_map_entry_s *map); + int (*truncate)(FAR struct file *filep, off_t length); /* The two structures need not be common after this point */ @@ -301,8 +301,8 @@ struct mountpt_operations size_t buflen); off_t (*seek)(FAR struct file *filep, off_t offset, int whence); int (*ioctl)(FAR struct file *filep, int cmd, unsigned long arg); - int (*truncate)(FAR struct file *filep, off_t length); int (*mmap)(FAR struct file *filep, FAR struct mm_map_entry_s *map); + int (*truncate)(FAR struct file *filep, off_t length); /* The two structures need not be common after this point. The following * are extended methods needed to deal with the unique needs of mounted