fs: Add model field to geometry and mtd_geometry_s

the model is very useful to track the device info

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao
2021-08-11 12:21:39 +08:00
committed by Gustavo Henrique Nihei
parent 30aa0ee700
commit 9f027208d4
53 changed files with 116 additions and 0 deletions
+2
View File
@@ -920,6 +920,8 @@ static int cxd56_emmc_geometry(struct inode *inode,
DEBUGASSERT(inode && inode->i_private); DEBUGASSERT(inode && inode->i_private);
priv = (struct cxd56_emmc_state_s *)inode->i_private; priv = (struct cxd56_emmc_state_s *)inode->i_private;
memset(geometry, 0, sizeof(*geometry));
geometry->geo_available = true; geometry->geo_available = true;
geometry->geo_mediachanged = false; geometry->geo_mediachanged = false;
#if !defined(CONFIG_MMCSD_READONLY) #if !defined(CONFIG_MMCSD_READONLY)
+2
View File
@@ -190,6 +190,8 @@ static int cxd56_ioctl(struct mtd_dev_s *dev, int cmd, unsigned long arg)
finfo("cmd: GEOM\n"); finfo("cmd: GEOM\n");
if (geo) if (geo)
{ {
memset(geo, 0, sizeof(*geo));
/* Populate the geometry structure with information need to /* Populate the geometry structure with information need to
* know the capacity and how to access the device. * know the capacity and how to access the device.
* *
+3
View File
@@ -192,6 +192,9 @@ static int mmcl_geometry(struct inode *inode, struct geometry *geometry)
if (geometry) if (geometry)
{ {
dev = (struct mmcl_dev_s *)inode->i_private; dev = (struct mmcl_dev_s *)inode->i_private;
memset(geometry, 0, sizeof(*geometry));
geometry->geo_available = true; geometry->geo_available = true;
geometry->geo_mediachanged = false; geometry->geo_mediachanged = false;
geometry->geo_writeenabled = true; geometry->geo_writeenabled = true;
+2
View File
@@ -314,6 +314,8 @@ static int lc823450_ioctl(struct mtd_dev_s *dev, int cmd,
geo = (struct mtd_geometry_s *)arg; geo = (struct mtd_geometry_s *)arg;
if (geo) if (geo)
{ {
memset(geo, 0, sizeof(*geo));
/* Populate the geometry structure with information needed to /* Populate the geometry structure with information needed to
* know the capacity and how to access the device. * know the capacity and how to access the device.
*/ */
+2
View File
@@ -858,6 +858,8 @@ static int lpc43_ioctl(struct mtd_dev_s *dev, int cmd, unsigned long arg)
(struct mtd_geometry_s *)((uintptr_t)arg); (struct mtd_geometry_s *)((uintptr_t)arg);
if (geo) if (geo)
{ {
memset(geo, 0, sizeof(*geo));
/* Populate the geometry structure with information need to /* Populate the geometry structure with information need to
* know the capacity and how to access the device. * know the capacity and how to access the device.
* *
+2
View File
@@ -288,6 +288,8 @@ static int pplus_fls_ioctl(struct mtd_dev_s *dev,
if (geo) if (geo)
{ {
memset(geo, 0, sizeof(*geo));
/* Populate the geometry structure with information need to /* Populate the geometry structure with information need to
* know the capacity and how to access the device. * know the capacity and how to access the device.
* *
+2
View File
@@ -456,6 +456,8 @@ static int rp2040_flash_ioctl(struct mtd_dev_s *dev,
if (geo != NULL) if (geo != NULL)
{ {
memset(geo, 0, sizeof(*geo));
geo->blocksize = FLASH_SECTOR_SIZE; geo->blocksize = FLASH_SECTOR_SIZE;
geo->erasesize = FLASH_BLOCK_SIZE; geo->erasesize = FLASH_BLOCK_SIZE;
geo->neraseblocks = FLASH_BLOCK_COUNT; geo->neraseblocks = FLASH_BLOCK_COUNT;
+2
View File
@@ -236,6 +236,8 @@ static int ameba_flash_ioctl(struct mtd_dev_s *dev,
(struct mtd_geometry_s *)((uintptr_t)arg); (struct mtd_geometry_s *)((uintptr_t)arg);
if (geo) if (geo)
{ {
memset(geo, 0, sizeof(*geo));
geo->blocksize = AMEBA_PAGE_SIZE; geo->blocksize = AMEBA_PAGE_SIZE;
geo->erasesize = AMEBA_SECTOR_SIZE; geo->erasesize = AMEBA_SECTOR_SIZE;
geo->neraseblocks = priv->nsectors; geo->neraseblocks = priv->nsectors;
+3
View File
@@ -292,6 +292,9 @@ static int eeed_geometry(struct inode *inode, struct geometry *geometry)
if (geometry) if (geometry)
{ {
dev = (struct eeed_struct_s *)inode->i_private; dev = (struct eeed_struct_s *)inode->i_private;
memset(geometry, 0, sizeof(*geometry));
geometry->geo_available = true; geometry->geo_available = true;
geometry->geo_mediachanged = false; geometry->geo_mediachanged = false;
geometry->geo_writeenabled = true; geometry->geo_writeenabled = true;
+2
View File
@@ -377,6 +377,8 @@ static int tiva_ioctl(struct mtd_dev_s *dev, int cmd, unsigned long arg)
struct mtd_geometry_s *geo = (struct mtd_geometry_s *)arg; struct mtd_geometry_s *geo = (struct mtd_geometry_s *)arg;
if (geo) if (geo)
{ {
memset(geo, 0, sizeof(*geo));
/* Populate the geometry structure with information needed to /* Populate the geometry structure with information needed to
* know the capacity and how to access the device. * know the capacity and how to access the device.
* *
+2
View File
@@ -782,6 +782,8 @@ static int tlsr82_flash_ioctl(struct mtd_dev_s *dev, int cmd,
if (geo) if (geo)
{ {
memset(geo, 0, sizeof(*geo));
/* Populate the geometry structure with information need to /* Populate the geometry structure with information need to
* know the capacity and how to access the device. * know the capacity and how to access the device.
* *
+2
View File
@@ -296,6 +296,8 @@ int bl602_ioctl(struct mtd_dev_s *dev, int cmd,
struct mtd_geometry_s *geo = (struct mtd_geometry_s *)arg; struct mtd_geometry_s *geo = (struct mtd_geometry_s *)arg;
if (geo) if (geo)
{ {
memset(geo, 0, sizeof(*geo));
geo->blocksize = SPIFLASH_BLOCKSIZE; geo->blocksize = SPIFLASH_BLOCKSIZE;
geo->erasesize = SPIFLASH_BLOCKSIZE; geo->erasesize = SPIFLASH_BLOCKSIZE;
geo->neraseblocks = (priv->config->flash_size) / \ geo->neraseblocks = (priv->config->flash_size) / \
@@ -577,6 +577,8 @@ static int esp32c3_ioctl(struct mtd_dev_s *dev, int cmd,
struct mtd_geometry_s *geo = (struct mtd_geometry_s *)arg; struct mtd_geometry_s *geo = (struct mtd_geometry_s *)arg;
if (geo) if (geo)
{ {
memset(geo, 0, sizeof(*geo));
geo->blocksize = MTD_BLK_SIZE; geo->blocksize = MTD_BLK_SIZE;
geo->erasesize = MTD_ERASE_SIZE; geo->erasesize = MTD_ERASE_SIZE;
geo->neraseblocks = MTD_SIZE(priv) / MTD_ERASE_SIZE; geo->neraseblocks = MTD_SIZE(priv) / MTD_ERASE_SIZE;
+4
View File
@@ -1990,6 +1990,8 @@ static int esp32_ioctl(struct mtd_dev_s *dev, int cmd,
struct mtd_geometry_s *geo = (struct mtd_geometry_s *)arg; struct mtd_geometry_s *geo = (struct mtd_geometry_s *)arg;
if (geo) if (geo)
{ {
memset(geo, 0, sizeof(*geo));
geo->blocksize = MTD_BLKSIZE(priv); geo->blocksize = MTD_BLKSIZE(priv);
geo->erasesize = MTD_ERASESIZE(priv); geo->erasesize = MTD_ERASESIZE(priv);
geo->neraseblocks = MTD_SIZE(priv) / MTD_ERASESIZE(priv); geo->neraseblocks = MTD_SIZE(priv) / MTD_ERASESIZE(priv);
@@ -2066,6 +2068,8 @@ static int esp32_ioctl_encrypt(struct mtd_dev_s *dev, int cmd,
struct mtd_geometry_s *geo = (struct mtd_geometry_s *)arg; struct mtd_geometry_s *geo = (struct mtd_geometry_s *)arg;
if (geo) if (geo)
{ {
memset(geo, 0, sizeof(*geo));
geo->blocksize = SPI_FLASH_ENCRYPT_MIN_SIZE; geo->blocksize = SPI_FLASH_ENCRYPT_MIN_SIZE;
geo->erasesize = MTD_ERASESIZE(priv); geo->erasesize = MTD_ERASESIZE(priv);
geo->neraseblocks = MTD_SIZE(priv) / geo->erasesize; geo->neraseblocks = MTD_SIZE(priv) / geo->erasesize;
@@ -620,6 +620,8 @@ static int esp32s3_ioctl(struct mtd_dev_s *dev, int cmd,
struct mtd_geometry_s *geo = (struct mtd_geometry_s *)arg; struct mtd_geometry_s *geo = (struct mtd_geometry_s *)arg;
if (geo) if (geo)
{ {
memset(geo, 0, sizeof(*geo));
geo->blocksize = MTD_BLK_SIZE; geo->blocksize = MTD_BLK_SIZE;
geo->erasesize = MTD_ERASE_SIZE; geo->erasesize = MTD_ERASE_SIZE;
geo->neraseblocks = MTD_SIZE(priv) / MTD_ERASE_SIZE; geo->neraseblocks = MTD_SIZE(priv) / MTD_ERASE_SIZE;
@@ -556,6 +556,8 @@ static int imxrt_flexspi_nor_ioctl(struct mtd_dev_s *dev,
if (geo) if (geo)
{ {
memset(geo, 0, sizeof(*geo));
/* Populate the geometry structure with information need to /* Populate the geometry structure with information need to
* know the capacity and how to access the device. * know the capacity and how to access the device.
* *
+3
View File
@@ -288,6 +288,9 @@ static int loop_geometry(FAR struct inode *inode,
if (geometry) if (geometry)
{ {
dev = (FAR struct loop_struct_s *)inode->i_private; dev = (FAR struct loop_struct_s *)inode->i_private;
memset(geometry, 0, sizeof(*geometry));
geometry->geo_available = true; geometry->geo_available = true;
geometry->geo_mediachanged = false; geometry->geo_mediachanged = false;
geometry->geo_writeenabled = dev->writeenabled; geometry->geo_writeenabled = dev->writeenabled;
+3
View File
@@ -307,6 +307,9 @@ static int rd_geometry(FAR struct inode *inode, struct geometry *geometry)
if (geometry) if (geometry)
{ {
dev = (struct rd_struct_s *)inode->i_private; dev = (struct rd_struct_s *)inode->i_private;
memset(geometry, 0, sizeof(*geometry));
geometry->geo_available = true; geometry->geo_available = true;
geometry->geo_mediachanged = false; geometry->geo_mediachanged = false;
geometry->geo_writeenabled = RDFLAG_IS_WRENABLED(dev->rd_flags); geometry->geo_writeenabled = RDFLAG_IS_WRENABLED(dev->rd_flags);
+2
View File
@@ -2247,6 +2247,8 @@ static int mmcsd_geometry(FAR struct inode *inode, struct geometry *geometry)
if (geometry) if (geometry)
{ {
memset(geometry, 0, sizeof(*geometry));
/* Is there a (supported) card inserted in the slot? */ /* Is there a (supported) card inserted in the slot? */
priv = (FAR struct mmcsd_state_s *)inode->i_private; priv = (FAR struct mmcsd_state_s *)inode->i_private;
+2
View File
@@ -1611,6 +1611,8 @@ static int mmcsd_geometry(FAR struct inode *inode, struct geometry *geometry)
/* Then return the card geometry */ /* Then return the card geometry */
memset(geometry, 0, sizeof(*geometry));
geometry->geo_available = geometry->geo_available =
((slot->state & (MMCSD_SLOTSTATUS_NOTREADY | ((slot->state & (MMCSD_SLOTSTATUS_NOTREADY |
MMCSD_SLOTSTATUS_NODISK)) == 0); MMCSD_SLOTSTATUS_NODISK)) == 0);
+2
View File
@@ -579,6 +579,8 @@ static int at24c_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
((uintptr_t)arg); ((uintptr_t)arg);
if (geo) if (geo)
{ {
memset(geo, 0, sizeof(*geo));
/* Populate the geometry structure with information need to /* Populate the geometry structure with information need to
* know the capacity and how to access the device. * know the capacity and how to access the device.
* *
+2
View File
@@ -616,6 +616,8 @@ static int at25_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
if (geo != NULL) if (geo != NULL)
{ {
memset(geo, 0, sizeof(*geo));
/* Populate the geometry structure with information need to /* Populate the geometry structure with information need to
* know the capacity and how to access the device. * know the capacity and how to access the device.
* *
+2
View File
@@ -783,6 +783,8 @@ static int at45db_ioctl(FAR struct mtd_dev_s *mtd,
(FAR struct mtd_geometry_s *)((uintptr_t)arg); (FAR struct mtd_geometry_s *)((uintptr_t)arg);
if (geo) if (geo)
{ {
memset(geo, 0, sizeof(*geo));
/* Populate the geometry structure with information need to /* Populate the geometry structure with information need to
* know the capacity and how to access the device. * know the capacity and how to access the device.
* *
+2
View File
@@ -443,6 +443,8 @@ static int filemtd_ioctl(FAR struct mtd_dev_s *dev, int cmd,
if (geo) if (geo)
{ {
memset(geo, 0, sizeof(*geo));
/* Populate the geometry structure with information need to /* Populate the geometry structure with information need to
* know the capacity and how to access the device. * know the capacity and how to access the device.
*/ */
+2
View File
@@ -478,6 +478,8 @@ static int ftl_geometry(FAR struct inode *inode,
geometry->geo_nsectors = dev->geo.neraseblocks * dev->blkper; geometry->geo_nsectors = dev->geo.neraseblocks * dev->blkper;
geometry->geo_sectorsize = dev->geo.blocksize; geometry->geo_sectorsize = dev->geo.blocksize;
strcpy(geometry->geo_model, dev->geo.model);
finfo("available: true mediachanged: false writeenabled: %s\n", finfo("available: true mediachanged: false writeenabled: %s\n",
geometry->geo_writeenabled ? "true" : "false"); geometry->geo_writeenabled ? "true" : "false");
finfo("nsectors: %" PRIuOFF " sectorsize: %u\n", finfo("nsectors: %" PRIuOFF " sectorsize: %u\n",
+2
View File
@@ -947,6 +947,8 @@ static int gd25_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
(FAR struct mtd_geometry_s *)((uintptr_t)arg); (FAR struct mtd_geometry_s *)((uintptr_t)arg);
if (geo) if (geo)
{ {
memset(geo, 0, sizeof(*geo));
geo->blocksize = GD25_PAGE_SIZE; geo->blocksize = GD25_PAGE_SIZE;
geo->erasesize = GD25_SECTOR_SIZE; geo->erasesize = GD25_SECTOR_SIZE;
geo->neraseblocks = priv->nsectors; geo->neraseblocks = priv->nsectors;
+2
View File
@@ -753,6 +753,8 @@ static int gd5f_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
(FAR struct mtd_geometry_s *)((uintptr_t)arg); (FAR struct mtd_geometry_s *)((uintptr_t)arg);
if (geo) if (geo)
{ {
memset(geo, 0, sizeof(*geo));
geo->blocksize = (1 << priv->pageshift); geo->blocksize = (1 << priv->pageshift);
geo->erasesize = (1 << priv->sectorshift); geo->erasesize = (1 << priv->sectorshift);
geo->neraseblocks = priv->nsectors; geo->neraseblocks = priv->nsectors;
+2
View File
@@ -1010,6 +1010,8 @@ static int is25xp_ioctl(FAR struct mtd_dev_s *dev,
(FAR struct mtd_geometry_s *)((uintptr_t)arg); (FAR struct mtd_geometry_s *)((uintptr_t)arg);
if (geo) if (geo)
{ {
memset(geo, 0, sizeof(*geo));
/* Populate the geometry structure with information need to /* Populate the geometry structure with information need to
* know the capacity and how to access the device. * know the capacity and how to access the device.
* *
+2
View File
@@ -1056,6 +1056,8 @@ static int m25p_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
((uintptr_t)arg); ((uintptr_t)arg);
if (geo) if (geo)
{ {
memset(geo, 0, sizeof(*geo));
/* Populate the geometry structure with information need to /* Populate the geometry structure with information need to
* know the capacity and how to access the device. * know the capacity and how to access the device.
* *
+2
View File
@@ -758,6 +758,8 @@ static int nand_ioctl(struct mtd_dev_s *dev, int cmd, unsigned long arg)
FAR struct mtd_geometry_s *geo = (struct mtd_geometry_s *)arg; FAR struct mtd_geometry_s *geo = (struct mtd_geometry_s *)arg;
if (geo) if (geo)
{ {
memset(geo, 0, sizeof(*geo));
/* Populate the geometry structure with information needed to /* Populate the geometry structure with information needed to
* know the capacity and how to access the device. Returns: * know the capacity and how to access the device. Returns:
* *
+2
View File
@@ -403,6 +403,8 @@ static int part_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
FAR struct mtd_geometry_s *geo = (FAR struct mtd_geometry_s *)arg; FAR struct mtd_geometry_s *geo = (FAR struct mtd_geometry_s *)arg;
if (geo) if (geo)
{ {
memset(geo, 0, sizeof(*geo));
/* Populate the geometry structure with information needed to /* Populate the geometry structure with information needed to
* know the capacity and how to access the device. * know the capacity and how to access the device.
*/ */
+2
View File
@@ -310,6 +310,8 @@ static int progmem_ioctl(FAR struct mtd_dev_s *dev, int cmd,
FAR struct mtd_geometry_s *geo = (FAR struct mtd_geometry_s *)arg; FAR struct mtd_geometry_s *geo = (FAR struct mtd_geometry_s *)arg;
if (geo) if (geo)
{ {
memset(geo, 0, sizeof(*geo));
/* Populate the geometry structure with information needed to /* Populate the geometry structure with information needed to
* know the capacity and how to access the device. * know the capacity and how to access the device.
* *
+2
View File
@@ -275,6 +275,8 @@ static int mtd_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
((uintptr_t)arg); ((uintptr_t)arg);
if (geo) if (geo)
{ {
memset(geo, 0, sizeof(*geo));
/* Populate the geometry structure with information need to /* Populate the geometry structure with information need to
* know the capacity and how to access the device. * know the capacity and how to access the device.
* *
+2
View File
@@ -1053,6 +1053,8 @@ static int mx25l_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
(FAR struct mtd_geometry_s *)((uintptr_t)arg); (FAR struct mtd_geometry_s *)((uintptr_t)arg);
if (geo) if (geo)
{ {
memset(geo, 0, sizeof(*geo));
/* Populate the geometry structure with information need to /* Populate the geometry structure with information need to
* know the capacity and how to access the device. * know the capacity and how to access the device.
* *
+2
View File
@@ -735,6 +735,8 @@ int mx25rxx_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
if (geo) if (geo)
{ {
memset(geo, 0, sizeof(*geo));
/* Populate the geometry structure with information need to /* Populate the geometry structure with information need to
* know the capacity and how to access the device. * know the capacity and how to access the device.
* *
+2
View File
@@ -789,6 +789,8 @@ static int mx35_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
(FAR struct mtd_geometry_s *)((uintptr_t)arg); (FAR struct mtd_geometry_s *)((uintptr_t)arg);
if (geo) if (geo)
{ {
memset(geo, 0, sizeof(*geo));
/* Populate the geometry structure with information need to /* Populate the geometry structure with information need to
* know the capacity and how to access the device. * know the capacity and how to access the device.
* *
+2
View File
@@ -1371,6 +1371,8 @@ static int n25qxxx_ioctl(FAR struct mtd_dev_s *dev,
if (geo) if (geo)
{ {
memset(geo, 0, sizeof(*geo));
/* Populate the geometry structure with information need to /* Populate the geometry structure with information need to
* know the capacity and how to access the device. * know the capacity and how to access the device.
* *
+2
View File
@@ -276,6 +276,8 @@ static int nullmtd_ioctl(FAR struct mtd_dev_s *dev, int cmd,
if (geo) if (geo)
{ {
memset(geo, 0, sizeof(*geo));
/* Populate the geometry structure with information need to /* Populate the geometry structure with information need to
* know the capacity and how to access the device. * know the capacity and how to access the device.
*/ */
+2
View File
@@ -386,6 +386,8 @@ static int ram_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
(FAR struct mtd_geometry_s *)((uintptr_t)arg); (FAR struct mtd_geometry_s *)((uintptr_t)arg);
if (geo) if (geo)
{ {
memset(geo, 0, sizeof(*geo));
/* Populate the geometry structure with information need to /* Populate the geometry structure with information need to
* know the capacity and how to access the device. * know the capacity and how to access the device.
*/ */
+2
View File
@@ -838,6 +838,8 @@ static int ramtron_ioctl(FAR struct mtd_dev_s *dev,
(FAR struct mtd_geometry_s *)((uintptr_t)arg); (FAR struct mtd_geometry_s *)((uintptr_t)arg);
if (geo) if (geo)
{ {
memset(geo, 0, sizeof(*geo));
/* Populate the geometry structure with information need to /* Populate the geometry structure with information need to
* know the capacity and how to access the device. * know the capacity and how to access the device.
* *
+2
View File
@@ -1419,6 +1419,8 @@ static int s25fl1_ioctl(FAR struct mtd_dev_s *dev,
if (geo) if (geo)
{ {
memset(geo, 0, sizeof(*geo));
/* Populate the geometry structure with information need to /* Populate the geometry structure with information need to
* know the capacity and how to access the device. * know the capacity and how to access the device.
* *
+2
View File
@@ -521,6 +521,8 @@ static int s512_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
((uintptr_t)arg); ((uintptr_t)arg);
if (geo) if (geo)
{ {
memset(geo, 0, sizeof(*geo));
/* Populate the geometry structure with information need to /* Populate the geometry structure with information need to
* know the capacity and how to access the device. * know the capacity and how to access the device.
* *
+2
View File
@@ -241,6 +241,8 @@ static int skel_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
FAR struct mtd_geometry_s *geo = (FAR struct mtd_geometry_s *)arg; FAR struct mtd_geometry_s *geo = (FAR struct mtd_geometry_s *)arg;
if (geo) if (geo)
{ {
memset(geo, 0, sizeof(*geo));
/* Populate the geometry structure with information needed to /* Populate the geometry structure with information needed to
* know the capacity and how to access the device. * know the capacity and how to access the device.
* *
+2
View File
@@ -1066,6 +1066,8 @@ static int smart_geometry(FAR struct inode *inode, struct geometry *geometry)
dev->sectorsize; dev->sectorsize;
geometry->geo_sectorsize = dev->sectorsize; geometry->geo_sectorsize = dev->sectorsize;
strcpy(geometry->geo_model, dev->geo.model);
finfo("available: true mediachanged: false writeenabled: %s\n", finfo("available: true mediachanged: false writeenabled: %s\n",
geometry->geo_writeenabled ? "true" : "false"); geometry->geo_writeenabled ? "true" : "false");
finfo("nsectors: %" PRIuOFF " sectorsize: %" PRIi16 "\n", finfo("nsectors: %" PRIuOFF " sectorsize: %" PRIi16 "\n",
+2
View File
@@ -1167,6 +1167,8 @@ static int sst25_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
((uintptr_t)arg); ((uintptr_t)arg);
if (geo) if (geo)
{ {
memset(geo, 0, sizeof(*geo));
/* Populate the geometry structure with information need to /* Populate the geometry structure with information need to
* know the capacity and how to access the device. * know the capacity and how to access the device.
* *
+2
View File
@@ -871,6 +871,8 @@ static int sst25xx_ioctl(FAR struct mtd_dev_s *dev, int cmd,
((uintptr_t)arg); ((uintptr_t)arg);
if (geo) if (geo)
{ {
memset(geo, 0, sizeof(*geo));
/* Populate the geometry structure with information need to /* Populate the geometry structure with information need to
* know the capacity and how to access the device. * know the capacity and how to access the device.
* *
+2
View File
@@ -877,6 +877,8 @@ static int sst26_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
(FAR struct mtd_geometry_s *)((uintptr_t)arg); (FAR struct mtd_geometry_s *)((uintptr_t)arg);
if (geo != NULL) if (geo != NULL)
{ {
memset(geo, 0, sizeof(*geo));
/* Populate the geometry structure with information need to /* Populate the geometry structure with information need to
* know the capacity and how to access the device. * know the capacity and how to access the device.
* *
+2
View File
@@ -710,6 +710,8 @@ static int sst39vf_ioctl(FAR struct mtd_dev_s *dev,
FAR struct mtd_geometry_s *geo = (FAR struct mtd_geometry_s *)arg; FAR struct mtd_geometry_s *geo = (FAR struct mtd_geometry_s *)arg;
if (geo) if (geo)
{ {
memset(geo, 0, sizeof(*geo));
/* Populate the geometry structure with information need to /* Populate the geometry structure with information need to
* know the capacity and how to access the device. * know the capacity and how to access the device.
*/ */
+2
View File
@@ -1294,6 +1294,8 @@ static int w25_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
(FAR struct mtd_geometry_s *)((uintptr_t)arg); (FAR struct mtd_geometry_s *)((uintptr_t)arg);
if (geo) if (geo)
{ {
memset(geo, 0, sizeof(*geo));
/* Populate the geometry structure with information need to /* Populate the geometry structure with information need to
* know the capacity and how to access the device. * know the capacity and how to access the device.
* *
+2
View File
@@ -1409,6 +1409,8 @@ static int w25qxxxjv_ioctl(FAR struct mtd_dev_s *dev,
if (geo) if (geo)
{ {
memset(geo, 0, sizeof(*geo));
/* Populate the geometry structure with information need to /* Populate the geometry structure with information need to
* know the capacity and how to access the device. * know the capacity and how to access the device.
* *

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