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

drm/msm/dp: delete unnecessary debugfs error handling

Currently the error checking logic in the dp_debug module could
pass zero to PTR_ERR and it causes the below kbot warnings:

drivers/gpu/drm/msm/dp/dp_debug.c:378 dp_debug_init()
warn: passing zero to 'PTR_ERR'
drivers/gpu/drm/msm/dp/dp_debug.c:387 dp_debug_init()
warn: passing zero to 'PTR_ERR'
drivers/gpu/drm/msm/dp/dp_debug.c:396 dp_debug_init()
warn: passing zero to 'PTR_ERR'
drivers/gpu/drm/msm/dp/dp_debug.c:405 dp_debug_init()
warn: passing zero to 'PTR_ERR'

Debugfs functions are not supposed to be checked in the normal
case so delete this code. Also it silences the above Smatch
warnings that we're checking for NULL when these functions only
return error pointers.

Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Abhinav Kumar <abhinavk@codeaurora.org>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Link: https://lore.kernel.org/r/1614971839-2686-3-git-send-email-abhinavk@codeaurora.org
Signed-off-by: Rob Clark <robdclark@chromium.org>

authored by

Abhinav Kumar and committed by
Rob Clark
cb3fd74a 7d649cfe

+4 -27
+4 -27
drivers/gpu/drm/msm/dp/dp_debug.c
··· 368 368 int rc = 0; 369 369 struct dp_debug_private *debug = container_of(dp_debug, 370 370 struct dp_debug_private, dp_debug); 371 - struct dentry *file; 372 - struct dentry *test_active; 373 - struct dentry *test_data, *test_type; 374 371 375 - file = debugfs_create_file("dp_debug", 0444, minor->debugfs_root, 372 + debugfs_create_file("dp_debug", 0444, minor->debugfs_root, 376 373 debug, &dp_debug_fops); 377 - if (IS_ERR_OR_NULL(file)) { 378 - rc = PTR_ERR(file); 379 - DRM_ERROR("[%s] debugfs create file failed, rc=%d\n", 380 - DEBUG_NAME, rc); 381 - } 382 374 383 - test_active = debugfs_create_file("msm_dp_test_active", 0444, 375 + debugfs_create_file("msm_dp_test_active", 0444, 384 376 minor->debugfs_root, 385 377 debug, &test_active_fops); 386 - if (IS_ERR_OR_NULL(test_active)) { 387 - rc = PTR_ERR(test_active); 388 - DRM_ERROR("[%s] debugfs test_active failed, rc=%d\n", 389 - DEBUG_NAME, rc); 390 - } 391 378 392 - test_data = debugfs_create_file("msm_dp_test_data", 0444, 379 + debugfs_create_file("msm_dp_test_data", 0444, 393 380 minor->debugfs_root, 394 381 debug, &dp_test_data_fops); 395 - if (IS_ERR_OR_NULL(test_data)) { 396 - rc = PTR_ERR(test_data); 397 - DRM_ERROR("[%s] debugfs test_data failed, rc=%d\n", 398 - DEBUG_NAME, rc); 399 - } 400 382 401 - test_type = debugfs_create_file("msm_dp_test_type", 0444, 383 + debugfs_create_file("msm_dp_test_type", 0444, 402 384 minor->debugfs_root, 403 385 debug, &dp_test_type_fops); 404 - if (IS_ERR_OR_NULL(test_type)) { 405 - rc = PTR_ERR(test_type); 406 - DRM_ERROR("[%s] debugfs test_type failed, rc=%d\n", 407 - DEBUG_NAME, rc); 408 - } 409 386 410 387 debug->root = minor->debugfs_root; 411 388