drm/nouveau: Improve variable names in nouveau_sched_init()
Subsystems (3)
PATCH 1/1 drm/nouveau: Improve variable names in nouveau_sched_init()
nouveau_sched_init() uses the function drm_sched_init(). The latter function has parameters called "hang_limit" and "timeout" in its API documentation.
nouveau_sched_init(), however, defines a variable called "job_hang_limit" which is passed to drm_sched_init()'s "timeout" parameter. The actual "hang_limit" parameter is directly set to 0.
Define a new variable and rename the existing one to make naming congruent with the function API.
--- drivers/gpu/drm/nouveau/nouveau_sched.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/nouveau/nouveau_sched.c +3 -2
@@ -404,7 +404,8 @@ nouveau_sched_init(struct nouveau_sched *sched, struct nouveau_drm *drm, {struct drm_gpu_scheduler *drm_sched = &sched->base;struct drm_sched_entity *entity = &sched->entity; -long job_hang_limit =msecs_to_jiffies (NOUVEAU_SCHED_JOB_TIMEOUT_MS ); +const long timeout =msecs_to_jiffies (NOUVEAU_SCHED_JOB_TIMEOUT_MS ); +const unsigned int hang_limit =0 ;int ret;if (!wq) {
@@ -418,7 +419,7 @@ nouveau_sched_init(struct nouveau_sched *sched, struct nouveau_drm *drm, ret =drm_sched_init (drm_sched, &nouveau_sched_ops, wq,NOUVEAU_SCHED_PRIORITY_COUNT , - credit_limit,0 , job_hang_limit, + credit_limit, hang_limit, timeout,NULL ,NULL ,"nouveau_sched" , drm->dev->dev);if (ret) goto fail_wq;
Signature · 1 line
2.45.0
Quoted 7 lines · Philipp Stanner
nouveau_sched_init()uses the functiondrm_sched_init(). The latter function has parameters called "hang_limit" and "timeout" in its API documentation.
nouveau_sched_init(), however, defines a variable called "job_hang_limit" which is passed to drm_sched_init()'s "timeout" parameter. The actual "hang_limit" parameter is directly set to 0.
Good catch.
Quoted 14 lines
Define a new variable and rename the existing one to make naming congruent with the function API.
Signed-off-by Philipp Stanner <[email protected]>--- drivers/gpu/drm/nouveau/nouveau_sched.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)drivers/gpu/drm/nouveau/nouveau_sched.c +0
-0
drivers/gpu/drm/nouveau/nouveau_sched.c nouveau_sched_init(struct nouveau_sched *sched, struct nouveau_drm *drm, · line 408
Quoted 6 lines
drivers/gpu/drm/nouveau/nouveau_sched.c +2
-1@@ -404,7 +404,8 @@ nouveau_sched_init(struct nouveau_sched *sched, struct nouveau_drm *drm, {struct drm_gpu_scheduler *drm_sched = &sched->base;struct drm_sched_entity *entity = &sched->entity; -long job_hang_limit =msecs_to_jiffies (NOUVEAU_SCHED_JOB_TIMEOUT_MS ); +const long timeout =msecs_to_jiffies (NOUVEAU_SCHED_JOB_TIMEOUT_MS ); +const unsigned int hang_limit =0 ;
Please don't create this variable though, it's not needed.
Quoted 15 lines
drivers/gpu/drm/nouveau/nouveau_sched.c +1
-1int ret;if (!wq) {@@ -418,7 +419,7 @@ nouveau_sched_init(struct nouveau_sched *sched, struct nouveau_drm *drm, ret =drm_sched_init (drm_sched, &nouveau_sched_ops, wq,NOUVEAU_SCHED_PRIORITY_COUNT , - credit_limit,0 , job_hang_limit, + credit_limit, hang_limit, timeout,NULL ,NULL ,"nouveau_sched" , drm->dev->dev);if (ret) goto fail_wq;Signature · 1 line
2.45.0