Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/xe: Rely on kmalloc/kzalloc log message

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>

authored by

Francois Dugast and committed by
Rodrigo Vivi
955c09e2 4d18eac0

+7 -13
+1 -3
drivers/gpu/drm/xe/xe_gt_debugfs.c
··· 173 173 */ 174 174 #define DEBUGFS_SIZE (ARRAY_SIZE(debugfs_list) * sizeof(struct drm_info_list)) 175 175 local = drmm_kmalloc(&gt_to_xe(gt)->drm, DEBUGFS_SIZE, GFP_KERNEL); 176 - if (!local) { 177 - XE_WARN_ON("Couldn't allocate memory"); 176 + if (!local) 178 177 return; 179 - } 180 178 181 179 memcpy(local, debugfs_list, DEBUGFS_SIZE); 182 180 #undef DEBUGFS_SIZE
+1 -3
drivers/gpu/drm/xe/xe_guc_debugfs.c
··· 89 89 90 90 #define DEBUGFS_SIZE (ARRAY_SIZE(debugfs_list) * sizeof(struct drm_info_list)) 91 91 local = drmm_kmalloc(&guc_to_xe(guc)->drm, DEBUGFS_SIZE, GFP_KERNEL); 92 - if (!local) { 93 - XE_WARN_ON("Couldn't allocate memory"); 92 + if (!local) 94 93 return; 95 - } 96 94 97 95 memcpy(local, debugfs_list, DEBUGFS_SIZE); 98 96 #undef DEBUGFS_SIZE
+1 -3
drivers/gpu/drm/xe/xe_huc_debugfs.c
··· 55 55 56 56 #define DEBUGFS_SIZE (ARRAY_SIZE(debugfs_list) * sizeof(struct drm_info_list)) 57 57 local = drmm_kmalloc(&huc_to_xe(huc)->drm, DEBUGFS_SIZE, GFP_KERNEL); 58 - if (!local) { 59 - XE_WARN_ON("Couldn't allocate memory"); 58 + if (!local) 60 59 return; 61 - } 62 60 63 61 memcpy(local, debugfs_list, DEBUGFS_SIZE); 64 62 #undef DEBUGFS_SIZE
+4 -4
drivers/gpu/drm/xe/xe_query.c
··· 65 65 } 66 66 67 67 hw_engine_info = kmalloc(size, GFP_KERNEL); 68 - if (XE_IOCTL_DBG(xe, !hw_engine_info)) 68 + if (!hw_engine_info) 69 69 return -ENOMEM; 70 70 71 71 for_each_gt(gt, xe, gt_id) ··· 182 182 } 183 183 184 184 config = kzalloc(size, GFP_KERNEL); 185 - if (XE_IOCTL_DBG(xe, !config)) 185 + if (!config) 186 186 return -ENOMEM; 187 187 188 188 config->num_params = num_params; ··· 231 231 } 232 232 233 233 gts = kzalloc(size, GFP_KERNEL); 234 - if (XE_IOCTL_DBG(xe, !gts)) 234 + if (!gts) 235 235 return -ENOMEM; 236 236 237 237 gts->num_gt = xe->info.gt_count; ··· 278 278 } 279 279 280 280 hwconfig = kzalloc(size, GFP_KERNEL); 281 - if (XE_IOCTL_DBG(xe, !hwconfig)) 281 + if (!hwconfig) 282 282 return -ENOMEM; 283 283 284 284 xe_device_mem_access_get(xe);