mm_segment_t fs;
int rc = -ENOSYS;
- if (filp == NULL || IS_ERR(filp))
+ if (!filp || IS_ERR(filp))
return -EBADF;
if (kuch->kuc_magic != KUC_MAGIC) {
}
/* fput in group_rem */
- if (filp == NULL)
+ if (!filp)
return -EBADF;
/* freed in group_rem */
reg = kmalloc(sizeof(*reg) + data_len, 0);
- if (reg == NULL)
+ if (!reg)
return -ENOMEM;
reg->kr_fp = filp;
memcpy(reg->kr_data, data, data_len);
down_write(&kg_sem);
- if (kkuc_groups[group].next == NULL)
+ if (!kkuc_groups[group].next)
INIT_LIST_HEAD(&kkuc_groups[group]);
list_add(®->kr_chain, &kkuc_groups[group]);
up_write(&kg_sem);
{
struct kkuc_reg *reg, *next;
- if (kkuc_groups[group].next == NULL)
+ if (!kkuc_groups[group].next)
return 0;
if (uid == 0) {
list_del(®->kr_chain);
CDEBUG(D_KUC, "Removed uid=%d fp=%p from group %d\n",
reg->kr_uid, reg->kr_fp, group);
- if (reg->kr_fp != NULL)
+ if (reg->kr_fp)
fput(reg->kr_fp);
kfree(reg);
}
down_write(&kg_sem);
list_for_each_entry(reg, &kkuc_groups[group], kr_chain) {
- if (reg->kr_fp != NULL) {
+ if (reg->kr_fp) {
rc = libcfs_kkuc_msg_put(reg->kr_fp, payload);
if (rc == 0)
one_success = 1;
}
/* no link for this group */
- if (kkuc_groups[group].next == NULL)
+ if (!kkuc_groups[group].next)
return 0;
down_read(&kg_sem);
list_for_each_entry(reg, &kkuc_groups[group], kr_chain) {
- if (reg->kr_fp != NULL)
+ if (reg->kr_fp)
rc = cb_func(reg->kr_data, cb_arg);
}
up_read(&kg_sem);