drm/xe: Rely on kmalloc/kzalloc log message
authorFrancois Dugast <francois.dugast@intel.com>
Wed, 19 Jul 2023 13:20:59 +0000 (13:20 +0000)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Thu, 21 Dec 2023 16:37:51 +0000 (11:37 -0500)
Those messages are unnecessary because a generic message is already
produced in case of allocation failure. Besides, this also removes a
misuse of the XE_IOCTL_DBG macro.

Signed-off-by: Francois Dugast <francois.dugast@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
drivers/gpu/drm/xe/xe_gt_debugfs.c
drivers/gpu/drm/xe/xe_guc_debugfs.c
drivers/gpu/drm/xe/xe_huc_debugfs.c
drivers/gpu/drm/xe/xe_query.c

index f9f653243f206d07e1582af0b6c1aa7198654bfc..e622174a866def716dbcad48c95b3c7b480630dc 100644 (file)
@@ -173,10 +173,8 @@ void xe_gt_debugfs_register(struct xe_gt *gt)
         */
 #define DEBUGFS_SIZE   (ARRAY_SIZE(debugfs_list) * sizeof(struct drm_info_list))
        local = drmm_kmalloc(&gt_to_xe(gt)->drm, DEBUGFS_SIZE, GFP_KERNEL);
-       if (!local) {
-               XE_WARN_ON("Couldn't allocate memory");
+       if (!local)
                return;
-       }
 
        memcpy(local, debugfs_list, DEBUGFS_SIZE);
 #undef DEBUGFS_SIZE
index 0178b1a2d367f08f7f786191cb98a22aad0982c8..b43c70de7e37370a8c63a03245dc3500ed439b7b 100644 (file)
@@ -89,10 +89,8 @@ void xe_guc_debugfs_register(struct xe_guc *guc, struct dentry *parent)
 
 #define DEBUGFS_SIZE   (ARRAY_SIZE(debugfs_list) * sizeof(struct drm_info_list))
        local = drmm_kmalloc(&guc_to_xe(guc)->drm, DEBUGFS_SIZE, GFP_KERNEL);
-       if (!local) {
-               XE_WARN_ON("Couldn't allocate memory");
+       if (!local)
                return;
-       }
 
        memcpy(local, debugfs_list, DEBUGFS_SIZE);
 #undef DEBUGFS_SIZE
index ae3c21315d59489b13dbea461a5b7ce69d4efec2..18585a7eeb9d43fe3763e79409b02510fb55d4c1 100644 (file)
@@ -55,10 +55,8 @@ void xe_huc_debugfs_register(struct xe_huc *huc, struct dentry *parent)
 
 #define DEBUGFS_SIZE   (ARRAY_SIZE(debugfs_list) * sizeof(struct drm_info_list))
        local = drmm_kmalloc(&huc_to_xe(huc)->drm, DEBUGFS_SIZE, GFP_KERNEL);
-       if (!local) {
-               XE_WARN_ON("Couldn't allocate memory");
+       if (!local)
                return;
-       }
 
        memcpy(local, debugfs_list, DEBUGFS_SIZE);
 #undef DEBUGFS_SIZE
index 4b7869596ba866c552aa570e2b6c3608a3570498..f880c9af1651a5d3d3ed8a2bf8d3d85cb568709a 100644 (file)
@@ -65,7 +65,7 @@ static int query_engines(struct xe_device *xe,
        }
 
        hw_engine_info = kmalloc(size, GFP_KERNEL);
-       if (XE_IOCTL_DBG(xe, !hw_engine_info))
+       if (!hw_engine_info)
                return -ENOMEM;
 
        for_each_gt(gt, xe, gt_id)
@@ -182,7 +182,7 @@ static int query_config(struct xe_device *xe, struct drm_xe_device_query *query)
        }
 
        config = kzalloc(size, GFP_KERNEL);
-       if (XE_IOCTL_DBG(xe, !config))
+       if (!config)
                return -ENOMEM;
 
        config->num_params = num_params;
@@ -231,7 +231,7 @@ static int query_gts(struct xe_device *xe, struct drm_xe_device_query *query)
        }
 
        gts = kzalloc(size, GFP_KERNEL);
-       if (XE_IOCTL_DBG(xe, !gts))
+       if (!gts)
                return -ENOMEM;
 
        gts->num_gt = xe->info.gt_count;
@@ -278,7 +278,7 @@ static int query_hwconfig(struct xe_device *xe,
        }
 
        hwconfig = kzalloc(size, GFP_KERNEL);
-       if (XE_IOCTL_DBG(xe, !hwconfig))
+       if (!hwconfig)
                return -ENOMEM;
 
        xe_device_mem_access_get(xe);