drm/ttm: remove redundant ternaray operation on ret
Subsystems (4)
PATCH 1/1 drm/ttm: remove redundant ternaray operation on ret
Currently the only exit path to the end of the function __ttm_bo_lru_cursor_next is when pointer res is NULL. The ternary operation at the end of the function that checks on the value of res is redundant as res can never be non-null and hence the expression referencing pointer bo is never executed. Clean up the code by replacing the ternary operator with just a simple return of NULL
--- drivers/gpu/drm/ttm/ttm_bo_util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/ttm/ttm_bo_util.c +1 -1
@@ -1016,7 +1016,7 @@ __ttm_bo_lru_cursor_next(struct ttm_bo_lru_cursor *curs) }spin_unlock (lru_lock); -return res ? bo :NULL ; +return NULL ; }/**
Signature · 1 line
2.50.0
subject has typo, should be "ternary"
rday
Quoted 4 lines · Robert P. J. Day
subject has typo, should be "ternary"
rday
Good catch. Can that be fixed up before applying the patch rather than me sending a V2?
Colin
Quoted 7 lines · Colin King (gmail)
Quoted 4 lines · Robert P. J. Day
subject has typo, should be "ternary"
rday
Good catch. Can that be fixed up before applying the patch rather than me sending a V2?
Thomas or me can take care of that before pushing.
Christian.
Quoted 2 lines
Colin