vfs: Remove the unnessary check when CONFIG_DEBUG_MM enable

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2022-07-28 02:00:33 +08:00 committed by Petro Karashchenko
parent f53c776d97
commit 2b0e28e492
4 changed files with 0 additions and 56 deletions

View File

@ -720,21 +720,7 @@ static ssize_t fat_write(FAR struct file *filep, FAR const char *buffer,
bool force_indirect = false; bool force_indirect = false;
#endif #endif
/* Sanity checks. I have seen the following assertion misfire if
* CONFIG_DEBUG_MM is enabled while re-directing output to a
* file. In this case, the debug output can get generated while
* the file is being opened, FAT data structures are being allocated,
* and things are generally in a perverse state.
*/
#ifdef CONFIG_DEBUG_MM
if (filep->f_priv == NULL || filep->f_inode == NULL)
{
return -ENXIO;
}
#else
DEBUGASSERT(filep->f_priv != NULL && filep->f_inode != NULL); DEBUGASSERT(filep->f_priv != NULL && filep->f_inode != NULL);
#endif
/* Recover our private data from the struct file instance */ /* Recover our private data from the struct file instance */

View File

@ -490,21 +490,7 @@ static ssize_t hostfs_write(FAR struct file *filep, const char *buffer,
FAR struct hostfs_ofile_s *hf; FAR struct hostfs_ofile_s *hf;
ssize_t ret; ssize_t ret;
/* Sanity checks. I have seen the following assertion misfire if
* CONFIG_DEBUG_MM is enabled while re-directing output to a
* file. In this case, the debug output can get generated while
* the file is being opened, FAT data structures are being allocated,
* and things are generally in a perverse state.
*/
#ifdef CONFIG_DEBUG_MM
if (filep->f_priv == NULL || filep->f_inode == NULL)
{
return -ENXIO;
}
#else
DEBUGASSERT(filep->f_priv != NULL && filep->f_inode != NULL); DEBUGASSERT(filep->f_priv != NULL && filep->f_inode != NULL);
#endif
/* Recover our private data from the struct file instance */ /* Recover our private data from the struct file instance */

View File

@ -528,21 +528,7 @@ static ssize_t rpmsgfs_write(FAR struct file *filep, const char *buffer,
FAR struct rpmsgfs_ofile_s *hf; FAR struct rpmsgfs_ofile_s *hf;
ssize_t ret; ssize_t ret;
/* Sanity checks. I have seen the following assertion misfire if
* CONFIG_DEBUG_MM is enabled while re-directing output to a
* file. In this case, the debug output can get generated while
* the file is being opened, FAT data structures are being allocated,
* and things are generally in a perverse state.
*/
#ifdef CONFIG_DEBUG_MM
if (filep->f_priv == NULL || filep->f_inode == NULL)
{
return -ENXIO;
}
#else
DEBUGASSERT(filep->f_priv != NULL && filep->f_inode != NULL); DEBUGASSERT(filep->f_priv != NULL && filep->f_inode != NULL);
#endif
/* Recover our private data from the struct file instance */ /* Recover our private data from the struct file instance */

View File

@ -641,21 +641,7 @@ static ssize_t smartfs_write(FAR struct file *filep, const char *buffer,
size_t byteswritten; size_t byteswritten;
int ret; int ret;
/* Sanity checks. I have seen the following assertion misfire if
* CONFIG_DEBUG_MM is enabled while re-directing output to a
* file. In this case, the debug output can get generated while
* the file is being opened, FAT data structures are being allocated,
* and things are generally in a perverse state.
*/
#ifdef CONFIG_DEBUG_MM
if (filep->f_priv == NULL || filep->f_inode == NULL)
{
return -ENXIO;
}
#else
DEBUGASSERT(filep->f_priv != NULL && filep->f_inode != NULL); DEBUGASSERT(filep->f_priv != NULL && filep->f_inode != NULL);
#endif
/* Recover our private data from the struct file instance */ /* Recover our private data from the struct file instance */