imamnurby/smpl_train_seed8 huggingface dataset:
--- initial
+++ final
@@ -1,34 +1,34 @@
 struct vmw_resource *vmw_cotable_alloc(struct vmw_private *dev_priv, struct vmw_resource *ctx, u32 type) {
   struct vmw_cotable *vcotbl;
   int ret;
   u32 num_entries;
   if (unlikely(cotable_acc_size == 0)) cotable_acc_size = ttm_round_pot(sizeof(struct vmw_cotable));
   ret = ttm_mem_global_alloc(vmw_mem_glob(dev_priv), cotable_acc_size, false, true);
   if (unlikely(ret)) return ERR_PTR(ret);
   vcotbl = kzalloc(sizeof(*vcotbl), GFP_KERNEL);
-  if (unlikely(vcotbl == NULL)) {
+  if (unlikely(!vcotbl)) {
     ret = -ENOMEM;
     goto out_no_alloc;
   }
   ret = vmw_resource_init(dev_priv, &vcotbl->res, true, vmw_cotable_free, &vmw_cotable_func);
   if (unlikely(ret != 0)) goto out_no_init;
   INIT_LIST_HEAD(&vcotbl->resource_list);
   vcotbl->res.id = type;
   vcotbl->res.backup_size = PAGE_SIZE;
   num_entries = PAGE_SIZE / co_info[type].size;
   if (num_entries < co_info[type].min_initial_entries) {
     vcotbl->res.backup_size = co_info[type].min_initial_entries * co_info[type].size;
     vcotbl->res.backup_size = (vcotbl->res.backup_size + PAGE_SIZE - 1) & PAGE_MASK;
   }
   vcotbl->scrubbed = true;
   vcotbl->seen_entries = -1;
   vcotbl->type = type;
   vcotbl->ctx = ctx;
   vmw_resource_activate(&vcotbl->res, vmw_hw_cotable_destroy);
   return &vcotbl->res;
 out_no_init:
   kfree(vcotbl);
 out_no_alloc:
   ttm_mem_global_free(vmw_mem_glob(dev_priv), cotable_acc_size);
   return ERR_PTR(ret);
 }<sep>@@
expression e1;
statement S1,S2;
@@

        e1 = \(kmalloc\|kmemdup\|kzalloc\)(...);
	if (unlikely(
-       e1 == NULL
+       !e1
	))
	S1 else S2
--- initial
+++ final
@@ -1,14 +1,14 @@
 static int vmw_driver_open(struct drm_device *dev, struct drm_file *file_priv) {
   struct vmw_private *dev_priv = vmw_priv(dev);
   struct vmw_fpriv *vmw_fp;
   int ret = -ENOMEM;
   vmw_fp = kzalloc(sizeof(*vmw_fp), GFP_KERNEL);
-  if (unlikely(vmw_fp == NULL)) return ret;
+  if (unlikely(!vmw_fp)) return ret;
   vmw_fp->tfile = ttm_object_file_init(dev_priv->tdev, 10);
   if (unlikely(vmw_fp->tfile == NULL)) goto out_no_tfile;
   file_priv->driver_priv = vmw_fp;
   return 0;
 out_no_tfile:
   kfree(vmw_fp);
   return ret;
 }<sep>@@
expression e1;
statement S1,S2;
@@

        e1 = \(kmalloc\|kmemdup\|kzalloc\)(...);
	if (unlikely(
-       e1 == NULL
+       !e1
	))
	S1 else S2
--- initial
+++ final
@@ -1,9 +1,9 @@
 static int vmw_master_create(struct drm_device *dev, struct drm_master *master) {
   struct vmw_master *vmaster;
   vmaster = kzalloc(sizeof(*vmaster), GFP_KERNEL);
-  if (unlikely(vmaster == NULL)) return -ENOMEM;
+  if (unlikely(!vmaster)) return -ENOMEM;
   vmw_master_init(vmaster);
   ttm_lock_set_kill(&vmaster->lock, true, SIGTERM);
   master->driver_priv = vmaster;
   return 0;
 }<sep>@@
expression e1;
statement S1,S2;
@@

        e1 = \(kmalloc\|kmemdup\|kzalloc\)(...);
	if (unlikely(
-       e1 == NULL
+       !e1
	))
	S1 else S2
--- initial
+++ final
@@ -1,13 +1,13 @@
 static int vmw_resource_relocation_add(struct list_head *list, const struct vmw_resource *res, unsigned long offset, enum vmw_resource_relocation_type rel_type) {
   struct vmw_resource_relocation *rel;
   rel = kmalloc(sizeof(*rel), GFP_KERNEL);
-  if (unlikely(rel == NULL)) {
+  if (unlikely(!rel)) {
     DRM_ERROR("Failed to allocate a resource relocation.\n");
     return -ENOMEM;
   }
   rel->res = res;
   rel->offset = offset;
   rel->rel_type = rel_type;
   list_add_tail(&rel->head, list);
   return 0;
 }<sep>@@
expression e1;
statement S1,S2;
@@

        e1 = \(kmalloc\|kmemdup\|kzalloc\)(...);
	if (unlikely(
-       e1 == NULL
+       !e1
	))
	S1 else S2
--- initial
+++ final
@@ -1,43 +1,43 @@
 static int vmw_resource_val_add(struct vmw_sw_context *sw_context, struct vmw_resource *res, struct vmw_resource_val_node **p_node) {
   struct vmw_private *dev_priv = res->dev_priv;
   struct vmw_resource_val_node *node;
   struct drm_hash_item *hash;
   int ret;
   if (likely(drm_ht_find_item(&sw_context->res_ht, (unsigned long)res, &hash) == 0)) {
     node = container_of(hash, struct vmw_resource_val_node, hash);
     node->first_usage = false;
     if (unlikely(p_node != NULL)) *p_node = node;
     return 0;
   }
   node = kzalloc(sizeof(*node), GFP_KERNEL);
-  if (unlikely(node == NULL)) {
+  if (unlikely(!node)) {
     DRM_ERROR("Failed to allocate a resource validation "
               "entry.\n");
     return -ENOMEM;
   }
   node->hash.key = (unsigned long)res;
   ret = drm_ht_insert_item(&sw_context->res_ht, &node->hash);
   if (unlikely(ret != 0)) {
     DRM_ERROR("Failed to initialize a resource validation "
               "entry.\n");
     kfree(node);
     return ret;
   }
   node->res = vmw_resource_reference(res);
   node->first_usage = true;
   if (unlikely(p_node != NULL)) *p_node = node;
   if (!dev_priv->has_mob) {
     list_add_tail(&node->head, &sw_context->resource_list);
     return 0;
   }
   switch (vmw_res_type(res)) {
   case vmw_res_context:
   case vmw_res_dx_context:
     list_add(&node->head, &sw_context->ctx_resource_list);
     ret = vmw_cmd_ctx_first_setup(dev_priv, sw_context, node);
     break;
   case vmw_res_cotable: list_add_tail(&node->head, &sw_context->ctx_resource_list); break;
   default: list_add_tail(&node->head, &sw_context->resource_list); break;
   }
   return ret;
 }<sep>@@
expression e1;
statement S1,S2;
@@

        e1 = \(kmalloc\|kmemdup\|kzalloc\)(...);
	if (unlikely(
-       e1 == NULL
+       !e1
	))
	S1 else S2
--- initial
+++ final
@@ -1,31 +1,31 @@
 static int vmw_event_fence_action_create(struct drm_file *file_priv, struct vmw_fence_obj *fence, uint32_t flags, uint64_t user_data, bool interruptible) {
   struct vmw_event_fence_pending *event;
   struct vmw_fence_manager *fman = fman_from_fence(fence);
   struct drm_device *dev = fman->dev_priv->dev;
   int ret;
   event = kzalloc(sizeof(*event), GFP_KERNEL);
-  if (unlikely(event == NULL)) {
+  if (unlikely(!event)) {
     DRM_ERROR("Failed to allocate an event.\n");
     ret = -ENOMEM;
     goto out_no_space;
   }
   event->event.base.type = DRM_VMW_EVENT_FENCE_SIGNALED;
   event->event.base.length = sizeof(*event);
   event->event.user_data = user_data;
   ret = drm_event_reserve_init(dev, file_priv, &event->base, &event->event.base);
   if (unlikely(ret != 0)) {
     DRM_ERROR("Failed to allocate event space for this file.\n");
     kfree(event);
     goto out_no_space;
   }
   if (flags & DRM_VMW_FE_FLAG_REQ_TIME)
     ret = vmw_event_fence_action_queue(file_priv, fence, &event->base, &event->event.tv_sec, &event->event.tv_usec, interruptible);
   else
     ret = vmw_event_fence_action_queue(file_priv, fence, &event->base, NULL, NULL, interruptible);
   if (ret != 0) goto out_no_queue;
   return 0;
 out_no_queue:
   drm_event_cancel_free(dev, &event->base);
 out_no_space:
   return ret;
 }<sep>@@
expression e1;
statement S1,S2;
@@

        e1 = \(kmalloc\|kmemdup\|kzalloc\)(...);
	if (unlikely(
-       e1 == NULL
+       !e1
	))
	S1 else S2
--- initial
+++ final
@@ -1,16 +1,16 @@
 int vmw_event_fence_action_queue(struct drm_file *file_priv, struct vmw_fence_obj *fence, struct drm_pending_event *event, uint32_t *tv_sec, uint32_t *tv_usec, bool interruptible) {
   struct vmw_event_fence_action *eaction;
   struct vmw_fence_manager *fman = fman_from_fence(fence);
   eaction = kzalloc(sizeof(*eaction), GFP_KERNEL);
-  if (unlikely(eaction == NULL)) return -ENOMEM;
+  if (unlikely(!eaction)) return -ENOMEM;
   eaction->event = event;
   eaction->action.seq_passed = vmw_event_fence_action_seq_passed;
   eaction->action.cleanup = vmw_event_fence_action_cleanup;
   eaction->action.type = VMW_ACTION_EVENT;
   eaction->fence = vmw_fence_obj_reference(fence);
   eaction->dev = fman->dev_priv->dev;
   eaction->tv_sec = tv_sec;
   eaction->tv_usec = tv_usec;
   vmw_fence_obj_add_action(fence, &eaction->action);
   return 0;
 }<sep>@@
expression e1;
statement S1,S2;
@@

        e1 = \(kmalloc\|kmemdup\|kzalloc\)(...);
	if (unlikely(
-       e1 == NULL
+       !e1
	))
	S1 else S2
--- initial
+++ final
@@ -1,13 +1,13 @@
 int vmw_fence_create(struct vmw_fence_manager *fman, uint32_t seqno, struct vmw_fence_obj **p_fence) {
   struct vmw_fence_obj *fence;
   int ret;
   fence = kzalloc(sizeof(*fence), GFP_KERNEL);
-  if (unlikely(fence == NULL)) return -ENOMEM;
+  if (unlikely(!fence)) return -ENOMEM;
   ret = vmw_fence_obj_init(fman, fence, seqno, vmw_fence_destroy);
   if (unlikely(ret != 0)) goto out_err_init;
   *p_fence = fence;
   return 0;
 out_err_init:
   kfree(fence);
   return ret;
 }<sep>@@
expression e1;
statement S1,S2;
@@

        e1 = \(kmalloc\|kmemdup\|kzalloc\)(...);
	if (unlikely(
-       e1 == NULL
+       !e1
	))
	S1 else S2
--- initial
+++ final
@@ -1,16 +1,16 @@
 struct vmw_fence_manager *vmw_fence_manager_init(struct vmw_private *dev_priv) {
   struct vmw_fence_manager *fman = kzalloc(sizeof(*fman), GFP_KERNEL);
-  if (unlikely(fman == NULL)) return NULL;
+  if (unlikely(!fman)) return NULL;
   fman->dev_priv = dev_priv;
   spin_lock_init(&fman->lock);
   INIT_LIST_HEAD(&fman->fence_list);
   INIT_LIST_HEAD(&fman->cleanup_list);
   INIT_WORK(&fman->work, &vmw_fence_work_func);
   fman->fifo_down = true;
   fman->user_fence_size = ttm_round_pot(sizeof(struct vmw_user_fence));
   fman->fence_size = ttm_round_pot(sizeof(struct vmw_fence_obj));
   fman->event_fence_action_size = ttm_round_pot(sizeof(struct vmw_event_fence_action));
   mutex_init(&fman->goal_irq_mutex);
   fman->ctx = dma_fence_context_alloc(1);
   return fman;
 }<sep>@@
identifier e1;
type T;
statement S1,S2;
@@

        T e1 = \(kmalloc\|kmemdup\|kzalloc\)(...);
	if (unlikely(
-       e1 == NULL
+       !e1
	))
	S1 else S2
--- initial
+++ final
@@ -1,45 +1,45 @@
 int vmw_user_fence_create(struct drm_file *file_priv, struct vmw_fence_manager *fman, uint32_t seqno, struct vmw_fence_obj **p_fence, uint32_t *p_handle) {
   struct ttm_object_file *tfile = vmw_fpriv(file_priv)->tfile;
   struct vmw_user_fence *ufence;
   struct vmw_fence_obj *tmp;
   struct ttm_mem_global *mem_glob = vmw_mem_glob(fman->dev_priv);
   int ret;
   /*
    * Kernel memory space accounting, since this object may
    * be created by a user-space request.
    */
   ret = ttm_mem_global_alloc(mem_glob, fman->user_fence_size, false, false);
   if (unlikely(ret != 0)) return ret;
   ufence = kzalloc(sizeof(*ufence), GFP_KERNEL);
-  if (unlikely(ufence == NULL)) {
+  if (unlikely(!ufence)) {
     ret = -ENOMEM;
     goto out_no_object;
   }
   ret = vmw_fence_obj_init(fman, &ufence->fence, seqno, vmw_user_fence_destroy);
   if (unlikely(ret != 0)) {
     kfree(ufence);
     goto out_no_object;
   }
   /*
    * The base object holds a reference which is freed in
    * vmw_user_fence_base_release.
    */
   tmp = vmw_fence_obj_reference(&ufence->fence);
   ret = ttm_base_object_init(tfile, &ufence->base, false, VMW_RES_FENCE, &vmw_user_fence_base_release, NULL);
   if (unlikely(ret != 0)) {
     /*
      * Free the base object's reference
      */
     vmw_fence_obj_unreference(&tmp);
     goto out_err;
   }
   *p_fence = &ufence->fence;
   *p_handle = ufence->base.hash.key;
   return 0;
 out_err:
   tmp = &ufence->fence;
   vmw_fence_obj_unreference(&tmp);
 out_no_object:
   ttm_mem_global_free(mem_glob, fman->user_fence_size);
   return ret;
 }<sep>@@
expression e1;
statement S1,S2;
@@

        e1 = \(kmalloc\|kmemdup\|kzalloc\)(...);
	if (unlikely(
-       e1 == NULL
+       !e1
	))
	S1 else S2
--- initial
+++ final
@@ -1,21 +1,21 @@
 static int vmw_gmrid_man_init(struct ttm_mem_type_manager *man, unsigned long p_size) {
   struct vmw_private *dev_priv = container_of(man->bdev, struct vmw_private, bdev);
   struct vmwgfx_gmrid_man *gman = kzalloc(sizeof(*gman), GFP_KERNEL);
-  if (unlikely(gman == NULL)) return -ENOMEM;
+  if (unlikely(!gman)) return -ENOMEM;
   spin_lock_init(&gman->lock);
   gman->used_gmr_pages = 0;
   ida_init(&gman->gmr_ida);
   switch (p_size) {
   case VMW_PL_GMR:
     gman->max_gmr_ids = dev_priv->max_gmr_ids;
     gman->max_gmr_pages = dev_priv->max_gmr_pages;
     break;
   case VMW_PL_MOB:
     gman->max_gmr_ids = VMWGFX_NUM_MOB;
     gman->max_gmr_pages = dev_priv->max_mob_pages;
     break;
   default: BUG();
   }
   man->priv = (void *)gman;
   return 0;
 }<sep>@@
identifier e1;
type T;
statement S1,S2;
@@

        T e1 = \(kmalloc\|kmemdup\|kzalloc\)(...);
	if (unlikely(
-       e1 == NULL
+       !e1
	))
	S1 else S2
--- initial
+++ final
@@ -1,6 +1,6 @@
 struct vmw_mob *vmw_mob_create(unsigned long data_pages) {
   struct vmw_mob *mob = kzalloc(sizeof(*mob), GFP_KERNEL);
-  if (unlikely(mob == NULL)) return NULL;
+  if (unlikely(!mob)) return NULL;
   mob->num_pages = vmw_mob_calculate_pt_pages(data_pages);
   return mob;
 }<sep>@@
identifier e1;
type T;
statement S1,S2;
@@

        T e1 = \(kmalloc\|kmemdup\|kzalloc\)(...);
	if (unlikely(
-       e1 == NULL
+       !e1
	))
	S1 else S2
--- initial
+++ final
@@ -1,19 +1,19 @@
 int vmw_otables_setup(struct vmw_private *dev_priv) {
   struct vmw_otable **otables = &dev_priv->otable_batch.otables;
   int ret;
   if (dev_priv->has_dx) {
     *otables = kmemdup(dx_tables, sizeof(dx_tables), GFP_KERNEL);
-    if (*otables == NULL) return -ENOMEM;
+    if (!(*otables)) return -ENOMEM;
     dev_priv->otable_batch.num_otables = ARRAY_SIZE(dx_tables);
   } else {
     *otables = kmemdup(pre_dx_tables, sizeof(pre_dx_tables), GFP_KERNEL);
-    if (*otables == NULL) return -ENOMEM;
+    if (!(*otables)) return -ENOMEM;
     dev_priv->otable_batch.num_otables = ARRAY_SIZE(pre_dx_tables);
   }
   ret = vmw_otable_batch_setup(dev_priv, &dev_priv->otable_batch);
   if (unlikely(ret != 0)) goto out_setup;
   return 0;
 out_setup:
   kfree(*otables);
   return ret;
 }<sep>@@
expression e1;
statement S1,S2;
@@

        e1 = \(kmalloc\|kmemdup\|kzalloc\)(...);
	if (unlikely(
-       e1 == NULL
+       !e1
	))
	S1 else S2

@@
expression e1;
statement S1,S2;
@@

        *e1 = \(kmalloc\|kmemdup\|kzalloc\)(...);
	if (
-       *e1 == NULL
+       !(*e1)
	)
	S1 else S2
--- initial
+++ final
@@ -1,31 +1,31 @@
 int vmw_host_get_guestinfo(const char *guest_info_param, char *buffer, size_t *length) {
   struct rpc_channel channel;
   char *msg, *reply = NULL;
   size_t msg_len, reply_len = 0;
   int ret = 0;
   if (!vmw_msg_enabled) return -ENODEV;
   if (!guest_info_param || !length) return -EINVAL;
   msg_len = strlen(guest_info_param) + strlen("info-get ") + 1;
   msg = kzalloc(msg_len, GFP_KERNEL);
-  if (msg == NULL) {
+  if (!msg) {
     DRM_ERROR("Cannot allocate memory to get %s", guest_info_param);
     return -ENOMEM;
   }
   sprintf(msg, "info-get %s", guest_info_param);
   if (vmw_open_channel(&channel, RPCI_PROTOCOL_NUM) || vmw_send_msg(&channel, msg) || vmw_recv_msg(&channel, (void *)&reply, &reply_len) || vmw_close_channel(&channel)) {
     DRM_ERROR("Failed to get %s", guest_info_param);
     ret = -EINVAL;
   }
   if (buffer && reply && reply_len > 0) {
     /* Remove reply code, which are the first 2 characters of
      * the reply
      */
     reply_len = max(reply_len - 2, (size_t)0);
     reply_len = min(reply_len, *length);
     if (reply_len > 0) memcpy(buffer, reply + 2, reply_len);
   }
   *length = reply_len;
   kfree(reply);
   kfree(msg);
   return ret;
 }<sep>@@
expression e1;
statement S1,S2;
@@

        e1 = \(kmalloc\|kmemdup\|kzalloc\)(...);
	if (unlikely(
-       e1 == NULL
+       !e1
	))
	S1 else S2

@@
expression e1;
statement S1,S2;
@@

        e1 = \(kmalloc\|kmemdup\|kzalloc\)(...);
	if (
-       e1 == NULL
+       !e1
	)
	S1 else S2
--- initial
+++ final
@@ -1,21 +1,21 @@
 int vmw_host_log(const char *log) {
   struct rpc_channel channel;
   char *msg;
   int msg_len;
   int ret = 0;
   if (!vmw_msg_enabled) return -ENODEV;
   if (!log) return ret;
   msg_len = strlen(log) + strlen("log ") + 1;
   msg = kzalloc(msg_len, GFP_KERNEL);
-  if (msg == NULL) {
+  if (!msg) {
     DRM_ERROR("Cannot allocate memory for log message\n");
     return -ENOMEM;
   }
   sprintf(msg, "log %s", log);
   if (vmw_open_channel(&channel, RPCI_PROTOCOL_NUM) || vmw_send_msg(&channel, msg) || vmw_close_channel(&channel)) {
     DRM_ERROR("Failed to send log\n");
     ret = -EINVAL;
   }
   kfree(msg);
   return ret;
 }<sep>@@
expression e1;
statement S1,S2;
@@

        e1 = \(kmalloc\|kmemdup\|kzalloc\)(...);
	if (unlikely(
-       e1 == NULL
+       !e1
	))
	S1 else S2

@@
expression e1;
statement S1,S2;
@@

        e1 = \(kmalloc\|kmemdup\|kzalloc\)(...);
	if (
-       e1 == NULL
+       !e1
	)
	S1 else S2
--- initial
+++ final
@@ -1,58 +1,58 @@
 static int vmw_recv_msg(struct rpc_channel *channel, void **msg, size_t *msg_len) {
   unsigned long eax, ebx, ecx, edx, si, di, bp;
   char *reply;
   size_t reply_len;
   int retries = 0;
   *msg_len = 0;
   *msg = NULL;
   while (retries < RETRIES) {
     retries++;
     /* Set up additional parameters */
     si = channel->cookie_high;
     di = channel->cookie_low;
     VMW_PORT(VMW_PORT_CMD_RECVSIZE, 0, si, di, (VMW_HYPERVISOR_PORT | (channel->channel_id << 16)), VMW_HYPERVISOR_MAGIC, eax, ebx, ecx, edx, si, di);
     if ((HIGH_WORD(ecx) & MESSAGE_STATUS_SUCCESS) == 0 || (HIGH_WORD(ecx) & MESSAGE_STATUS_HB) == 0) {
       DRM_ERROR("Failed to get reply size\n");
       return -EINVAL;
     }
     /* No reply available.  This is okay. */
     if ((HIGH_WORD(ecx) & MESSAGE_STATUS_DORECV) == 0) return 0;
     reply_len = ebx;
     reply = kzalloc(reply_len + 1, GFP_KERNEL);
-    if (reply == NULL) {
+    if (!reply) {
       DRM_ERROR("Cannot allocate memory for reply\n");
       return -ENOMEM;
     }
     /* Receive buffer */
     si = channel->cookie_high;
     di = (uintptr_t)reply;
     bp = channel->cookie_low;
     VMW_PORT_HB_IN((MESSAGE_STATUS_SUCCESS << 16) | VMW_PORT_CMD_HB_MSG, reply_len, si, di, VMW_HYPERVISOR_HB_PORT | (channel->channel_id << 16), VMW_HYPERVISOR_MAGIC, bp, eax, ebx, ecx, edx, si, di);
     if ((HIGH_WORD(ebx) & MESSAGE_STATUS_SUCCESS) == 0) {
       kfree(reply);
       if ((HIGH_WORD(ebx) & MESSAGE_STATUS_CPT) != 0) {
         /* A checkpoint occurred. Retry. */
         continue;
       }
       return -EINVAL;
     }
     reply[reply_len] = '\0';
     /* Ack buffer */
     si = channel->cookie_high;
     di = channel->cookie_low;
     VMW_PORT(VMW_PORT_CMD_RECVSTATUS, MESSAGE_STATUS_SUCCESS, si, di, (VMW_HYPERVISOR_PORT | (channel->channel_id << 16)), VMW_HYPERVISOR_MAGIC, eax, ebx, ecx, edx, si, di);
     if ((HIGH_WORD(ecx) & MESSAGE_STATUS_SUCCESS) == 0) {
       kfree(reply);
       if ((HIGH_WORD(ecx) & MESSAGE_STATUS_CPT) != 0) {
         /* A checkpoint occurred. Retry. */
         continue;
       }
       return -EINVAL;
     }
     break;
   }
   if (retries == RETRIES) return -EINVAL;
   *msg_len = reply_len;
   *msg = reply;
   return 0;
 }<sep>@@
expression e1;
statement S1,S2;
@@

        e1 = \(kmalloc\|kmemdup\|kzalloc\)(...);
	if (unlikely(
-       e1 == NULL
+       !e1
	))
	S1 else S2

@@
expression e1;
statement S1,S2;
@@

        e1 = \(kmalloc\|kmemdup\|kzalloc\)(...);
	if (
-       e1 == NULL
+       !e1
	)
	S1 else S2
--- initial
+++ final
@@ -1,16 +1,16 @@
 static int vmw_resource_buf_alloc(struct vmw_resource *res, bool interruptible) {
   unsigned long size = (res->backup_size + PAGE_SIZE - 1) & PAGE_MASK;
   struct vmw_dma_buffer *backup;
   int ret;
   if (likely(res->backup)) {
     BUG_ON(res->backup->base.num_pages * PAGE_SIZE < size);
     return 0;
   }
   backup = kzalloc(sizeof(*backup), GFP_KERNEL);
-  if (unlikely(backup == NULL)) return -ENOMEM;
+  if (unlikely(!backup)) return -ENOMEM;
   ret = vmw_dmabuf_init(res->dev_priv, backup, res->backup_size, res->func->backup_placement, interruptible, &vmw_dmabuf_bo_free);
   if (unlikely(ret != 0)) goto out_no_dmabuf;
   res->backup = backup;
 out_no_dmabuf:
   return ret;
 }<sep>@@
expression e1;
statement S1,S2;
@@

        e1 = \(kmalloc\|kmemdup\|kzalloc\)(...);
	if (unlikely(
-       e1 == NULL
+       !e1
	))
	S1 else S2
--- initial
+++ final
@@ -1,26 +1,26 @@
 int vmw_user_dmabuf_alloc(struct vmw_private *dev_priv, struct ttm_object_file *tfile, uint32_t size, bool shareable, uint32_t *handle, struct vmw_dma_buffer **p_dma_buf, struct ttm_base_object **p_base) {
   struct vmw_user_dma_buffer *user_bo;
   struct ttm_buffer_object *tmp;
   int ret;
   user_bo = kzalloc(sizeof(*user_bo), GFP_KERNEL);
-  if (unlikely(user_bo == NULL)) {
+  if (unlikely(!user_bo)) {
     DRM_ERROR("Failed to allocate a buffer.\n");
     return -ENOMEM;
   }
   ret = vmw_dmabuf_init(dev_priv, &user_bo->dma, size, (dev_priv->has_mob) ? &vmw_sys_placement : &vmw_vram_sys_placement, true, &vmw_user_dmabuf_destroy);
   if (unlikely(ret != 0)) return ret;
   tmp = ttm_bo_reference(&user_bo->dma.base);
   ret = ttm_prime_object_init(tfile, size, &user_bo->prime, shareable, ttm_buffer_type, &vmw_user_dmabuf_release, &vmw_user_dmabuf_ref_obj_release);
   if (unlikely(ret != 0)) {
     ttm_bo_unref(&tmp);
     goto out_no_base_object;
   }
   *p_dma_buf = &user_bo->dma;
   if (p_base) {
     *p_base = &user_bo->prime.base;
     kref_get(&(*p_base)->refcount);
   }
   *handle = user_bo->prime.base.hash.key;
 out_no_base_object:
   return ret;
 }<sep>@@
expression e1;
statement S1,S2;
@@

        e1 = \(kmalloc\|kmemdup\|kzalloc\)(...);
	if (unlikely(
-       e1 == NULL
+       !e1
	))
	S1 else S2
--- initial
+++ final
@@ -1,35 +1,35 @@
 int vmw_compat_shader_add(struct vmw_private *dev_priv, struct vmw_cmdbuf_res_manager *man, u32 user_key, const void *bytecode, SVGA3dShaderType shader_type, size_t size, struct list_head *list) {
   struct vmw_dma_buffer *buf;
   struct ttm_bo_kmap_obj map;
   bool is_iomem;
   int ret;
   struct vmw_resource *res;
   if (!vmw_shader_id_ok(user_key, shader_type)) return -EINVAL;
   /* Allocate and pin a DMA buffer */
   buf = kzalloc(sizeof(*buf), GFP_KERNEL);
-  if (unlikely(buf == NULL)) return -ENOMEM;
+  if (unlikely(!buf)) return -ENOMEM;
   ret = vmw_dmabuf_init(dev_priv, buf, size, &vmw_sys_ne_placement, true, vmw_dmabuf_bo_free);
   if (unlikely(ret != 0)) goto out;
   ret = ttm_bo_reserve(&buf->base, false, true, NULL);
   if (unlikely(ret != 0)) goto no_reserve;
   /* Map and copy shader bytecode. */
   ret = ttm_bo_kmap(&buf->base, 0, PAGE_ALIGN(size) >> PAGE_SHIFT, &map);
   if (unlikely(ret != 0)) {
     ttm_bo_unreserve(&buf->base);
     goto no_reserve;
   }
   memcpy(ttm_kmap_obj_virtual(&map, &is_iomem), bytecode, size);
   WARN_ON(is_iomem);
   ttm_bo_kunmap(&map);
   ret = ttm_bo_validate(&buf->base, &vmw_sys_placement, false, true);
   WARN_ON(ret != 0);
   ttm_bo_unreserve(&buf->base);
   res = vmw_shader_alloc(dev_priv, buf, size, 0, shader_type);
   if (unlikely(ret != 0)) goto no_reserve;
   ret = vmw_cmdbuf_res_add(man, vmw_cmdbuf_res_shader, vmw_shader_key(user_key, shader_type), res, list);
   vmw_resource_unreference(&res);
 no_reserve:
   vmw_dmabuf_unreference(&buf);
 out:
   return ret;
 }<sep>@@
expression e1;
statement S1,S2;
@@

        e1 = \(kmalloc\|kmemdup\|kzalloc\)(...);
	if (unlikely(
-       e1 == NULL
+       !e1
	))
	S1 else S2