p_fs->vol_flag = new_flag;
if (p_fs->vol_type == EXFAT) {
- if (p_fs->pbr_bh == NULL) {
+ if (!p_fs->pbr_bh) {
if (sector_read(sb, p_fs->PBR_sector,
&p_fs->pbr_bh, 1) != FFS_SUCCESS)
return;
p_fs->vol_amap = kmalloc_array(p_fs->map_sectors,
sizeof(struct buffer_head *),
GFP_KERNEL);
- if (p_fs->vol_amap == NULL)
+ if (!p_fs->vol_amap)
return FFS_MEMORYERR;
sector = START_SECTOR(p_fs->map_clu);
int i;
struct fs_info_t *p_fs = &(EXFAT_SB(sb)->fs_info);
- if (p_fs->vol_amap == NULL)
+ if (!p_fs->vol_amap)
return;
for (i = 0; i < p_fs->map_sectors; i++)
upcase_table = p_fs->vol_utbl = kmalloc(UTBL_COL_COUNT * sizeof(u16 *),
GFP_KERNEL);
- if (upcase_table == NULL)
+ if (!upcase_table)
return FFS_MEMORYERR;
memset(upcase_table, 0, UTBL_COL_COUNT * sizeof(u16 *));
} else { /* uni != index , uni != 0xFFFF */
u16 col_index = get_col_index(index);
- if (upcase_table[col_index] == NULL) {
+ if (!upcase_table[col_index]) {
pr_debug("alloc = 0x%X\n", col_index);
upcase_table[col_index] = kmalloc_array(UTBL_ROW_COUNT,
sizeof(u16), GFP_KERNEL);
- if (upcase_table[col_index] == NULL) {
+ if (!upcase_table[col_index]) {
ret = FFS_MEMORYERR;
goto error;
}
upcase_table = p_fs->vol_utbl = kmalloc(UTBL_COL_COUNT * sizeof(u16 *),
GFP_KERNEL);
- if (upcase_table == NULL)
+ if (!upcase_table)
return FFS_MEMORYERR;
memset(upcase_table, 0, UTBL_COL_COUNT * sizeof(u16 *));
} else { /* uni != index , uni != 0xFFFF */
u16 col_index = get_col_index(index);
- if (upcase_table[col_index] == NULL) {
+ if (!upcase_table[col_index]) {
pr_debug("alloc = 0x%X\n", col_index);
upcase_table[col_index] = kmalloc_array(UTBL_ROW_COUNT,
sizeof(u16),
GFP_KERNEL);
- if (upcase_table[col_index] == NULL) {
+ if (!upcase_table[col_index]) {
ret = FFS_MEMORYERR;
goto error;
}
buf = buf_getblk(sb, sector);
- if (buf == NULL)
+ if (!buf)
return NULL;
return (struct dentry_t *)(buf + offset);
buf = buf_getblk(sb, sec);
- if (buf == NULL)
+ if (!buf)
return NULL;
- if (sector != NULL)
+ if (sector)
*sector = sec;
return (struct dentry_t *)(buf + off);
}
sec += START_SECTOR(clu);
buf = buf_getblk(sb, sec);
- if (buf == NULL)
+ if (!buf)
goto err_out;
ep = (struct dentry_t *)(buf + off);
pr_debug("%s: trying to kmalloc %zx bytes for %d entries\n", __func__,
bufsize, num_entries);
es = kmalloc(bufsize, GFP_KERNEL);
- if (es == NULL)
+ if (!es)
goto err_out;
es->num_entries = num_entries;
sec++;
}
buf = buf_getblk(sb, sec);
- if (buf == NULL)
+ if (!buf)
goto err_out;
off = 0;
ep = (struct dentry_t *)(buf);
remaining_byte_in_sector >> DENTRY_SIZE_BITS,
num_entries);
buf = buf_getblk(sb, sec);
- if (buf == NULL)
+ if (!buf)
goto err_out;
pr_debug("es->buf %p buf_off %u\n", esbuf, buf_off);
pr_debug("copying %d entries from %p to sector %llu\n",
struct fs_info_t *p_fs = &(EXFAT_SB(sb)->fs_info);
es = get_entry_set_in_dir(sb, p_dir, entry, ES_ALL_ENTRIES, &ep);
- if (es == NULL || es->num_entries < 3) {
+ if (!es || es->num_entries < 3) {
if (es)
release_entry_set(es);
return;
alen = exfat_striptail_len(name);
blen = __exfat_striptail_len(len, str);
if (alen == blen) {
- if (t == NULL) {
+ if (!t) {
if (strncasecmp(name->name, str, alen) == 0)
return 0;
} else {
struct fs_info_t *p_fs = &(EXFAT_SB(sb)->fs_info);
/* check the validity of pointer parameters */
- if (info == NULL)
+ if (!info)
return FFS_ERROR;
/* acquire the lock for file system critical section */
pr_debug("%s entered\n", __func__);
/* check the validity of pointer parameters */
- if ((fid == NULL) || (path == NULL) || (*path == '\0'))
+ if (!fid || !path || (*path == '\0'))
return FFS_ERROR;
/* acquire the lock for file system critical section */
int ret;
/* check the validity of pointer parameters */
- if ((fid == NULL) || (path == NULL) || (*path == '\0'))
+ if (!fid || !path || (*path == '\0'))
return FFS_ERROR;
/* acquire the lock for file system critical section */
struct bd_info_t *p_bd = &(EXFAT_SB(sb)->bd_info);
/* check the validity of the given file id */
- if (fid == NULL)
+ if (!fid)
return FFS_INVALIDFID;
/* check the validity of pointer parameters */
- if (buffer == NULL)
+ if (!buffer)
return FFS_ERROR;
/* acquire the lock for file system critical section */
count = fid->size - fid->rwoffset;
if (count == 0) {
- if (rcount != NULL)
+ if (rcount)
*rcount = 0;
ret = FFS_EOF;
goto out;
/* How did this ever work and not leak a brlse()?? */
err_out:
/* set the size of read bytes */
- if (rcount != NULL)
+ if (rcount)
*rcount = read_bytes;
if (p_fs->dev_ejected)
struct bd_info_t *p_bd = &(EXFAT_SB(sb)->bd_info);
/* check the validity of the given file id */
- if (fid == NULL)
+ if (!fid)
return FFS_INVALIDFID;
/* check the validity of pointer parameters */
- if (buffer == NULL)
+ if (!buffer)
return FFS_ERROR;
/* acquire the lock for file system critical section */
fid->rwoffset = fid->size;
if (count == 0) {
- if (wcount != NULL)
+ if (wcount)
*wcount = 0;
ret = FFS_SUCCESS;
goto out;
if (p_fs->vol_type == EXFAT) {
es = get_entry_set_in_dir(sb, &(fid->dir), fid->entry,
ES_ALL_ENTRIES, &ep);
- if (es == NULL)
+ if (!es)
goto err_out;
ep2 = ep+1;
} else {
err_out:
/* set the size of written bytes */
- if (wcount != NULL)
+ if (wcount)
*wcount = write_bytes;
if (num_alloced == 0)
if (p_fs->vol_type == EXFAT) {
es = get_entry_set_in_dir(sb, &fid->dir, fid->entry,
ES_ALL_ENTRIES, &ep);
- if (es == NULL) {
+ if (!es) {
ret = FFS_MEDIAERR;
goto out;
}
s32 new_entry = 0;
/* check the validity of the given file id */
- if (fid == NULL)
+ if (!fid)
return FFS_INVALIDFID;
/* check the validity of pointer parameters */
- if ((new_path == NULL) || (*new_path == '\0'))
+ if (!new_path || (*new_path == '\0'))
return FFS_ERROR;
/* acquire the lock for file system critical section */
struct fs_info_t *p_fs = &(EXFAT_SB(sb)->fs_info);
/* check the validity of the given file id */
- if (fid == NULL)
+ if (!fid)
return FFS_INVALIDFID;
/* acquire the lock for file system critical section */
if (p_fs->vol_type == EXFAT) {
es = get_entry_set_in_dir(sb, &(fid->dir), fid->entry,
ES_ALL_ENTRIES, &ep);
- if (es == NULL) {
+ if (!es) {
ret = FFS_MEDIAERR;
goto out;
}
if (p_fs->vol_type == EXFAT) {
es = get_entry_set_in_dir(sb, &(fid->dir), fid->entry,
ES_2_ENTRIES, &ep);
- if (es == NULL) {
+ if (!es) {
ret = FFS_MEDIAERR;
goto out;
}
if (p_fs->vol_type == EXFAT) {
es = get_entry_set_in_dir(sb, &(fid->dir), fid->entry,
ES_ALL_ENTRIES, &ep);
- if (es == NULL) {
+ if (!es) {
ret = FFS_MEDIAERR;
goto out;
}
struct file_id_t *fid = &(EXFAT_I(inode)->fid);
/* check the validity of pointer parameters */
- if (clu == NULL)
+ if (!clu)
return FFS_ERROR;
/* acquire the lock for file system critical section */
if (p_fs->vol_type == EXFAT) {
es = get_entry_set_in_dir(sb, &fid->dir, fid->entry,
ES_ALL_ENTRIES, &ep);
- if (es == NULL) {
+ if (!es) {
ret = FFS_MEDIAERR;
goto out;
}
pr_debug("%s entered\n", __func__);
/* check the validity of pointer parameters */
- if ((fid == NULL) || (path == NULL) || (*path == '\0'))
+ if (!fid || !path || (*path == '\0'))
return FFS_ERROR;
/* acquire the lock for file system critical section */
struct file_id_t *fid = &(EXFAT_I(inode)->fid);
/* check the validity of pointer parameters */
- if (dir_entry == NULL)
+ if (!dir_entry)
return FFS_ERROR;
/* check if the given file ID is opened */
struct fs_info_t *p_fs = &(EXFAT_SB(sb)->fs_info);
/* check the validity of the given file id */
- if (fid == NULL)
+ if (!fid)
return FFS_INVALIDFID;
dir.dir = fid->dir.dir;
{
struct exfat_inode_info *ei = EXFAT_I(inode);
- if (ei->target != NULL) {
+ if (ei->target) {
char *cookie = ei->target;
- if (cookie != NULL)
+ if (cookie)
return (char *)(ei->target);
}
return NULL;
if (!options)
goto out;
- while ((p = strsep(&options, ",")) != NULL) {
+ while ((p = strsep(&options, ","))) {
int token;
if (!*p)
(SLAB_RECLAIM_ACCOUNT |
SLAB_MEM_SPREAD),
init_once);
- if (exfat_inode_cachep == NULL)
+ if (!exfat_inode_cachep)
return -ENOMEM;
return 0;
}