diff options
author | Terje Bergstrom <tbergstrom@nvidia.com> | 2017-03-24 13:55:46 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-03-28 15:05:03 -0400 |
commit | 3e39798997f0726472e18a17462216094c084074 (patch) | |
tree | cf68b3fff464c1217fa28ec27f6c612d5cfc66fb /drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c | |
parent | 580c8112f08281332cefea16243fcfbf27cd6bdd (diff) |
gpu: nvgpu: Remove unnecessary use of dev_name()
Move the name field from struct gpu_ops up to struct gk20a. The field
is not a function op, so it doesn't belong in gpu_ops.
Replace all uses of dev_name() with use of g->name when possible.
JIRA NVGPU-16
Change-Id: Ic6e99e39258cbf3bb7c806962cbbd7de5126688f
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1328534
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c b/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c index 165bcf46..b5098849 100644 --- a/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c | |||
@@ -123,7 +123,7 @@ static int gk20a_dbg_gpu_do_dev_open(struct inode *inode, | |||
123 | 123 | ||
124 | dev = g->dev; | 124 | dev = g->dev; |
125 | 125 | ||
126 | gk20a_dbg(gpu_dbg_fn | gpu_dbg_gpu_dbg, "dbg session: %s", dev_name(dev)); | 126 | gk20a_dbg(gpu_dbg_fn | gpu_dbg_gpu_dbg, "dbg session: %s", g->name); |
127 | 127 | ||
128 | err = alloc_session(&dbg_session); | 128 | err = alloc_session(&dbg_session); |
129 | if (err) | 129 | if (err) |
@@ -476,7 +476,7 @@ static int dbg_unbind_channel_gk20a(struct dbg_session_gk20a *dbg_s, | |||
476 | int err; | 476 | int err; |
477 | 477 | ||
478 | gk20a_dbg(gpu_dbg_fn|gpu_dbg_gpu_dbg, "%s fd=%d", | 478 | gk20a_dbg(gpu_dbg_fn|gpu_dbg_gpu_dbg, "%s fd=%d", |
479 | dev_name(dbg_s->dev), args->channel_fd); | 479 | g->name, args->channel_fd); |
480 | 480 | ||
481 | ch = gk20a_get_channel_from_file(args->channel_fd); | 481 | ch = gk20a_get_channel_from_file(args->channel_fd); |
482 | if (!ch) { | 482 | if (!ch) { |
@@ -513,7 +513,7 @@ int gk20a_dbg_gpu_dev_release(struct inode *inode, struct file *filp) | |||
513 | struct gk20a *g = dbg_s->g; | 513 | struct gk20a *g = dbg_s->g; |
514 | struct dbg_profiler_object_data *prof_obj, *tmp_obj; | 514 | struct dbg_profiler_object_data *prof_obj, *tmp_obj; |
515 | 515 | ||
516 | gk20a_dbg(gpu_dbg_gpu_dbg | gpu_dbg_fn, "%s", dev_name(dbg_s->dev)); | 516 | gk20a_dbg(gpu_dbg_gpu_dbg | gpu_dbg_fn, "%s", g->name); |
517 | 517 | ||
518 | /* unbind channels */ | 518 | /* unbind channels */ |
519 | dbg_unbind_all_channels_gk20a(dbg_s); | 519 | dbg_unbind_all_channels_gk20a(dbg_s); |
@@ -561,7 +561,7 @@ static int dbg_bind_channel_gk20a(struct dbg_session_gk20a *dbg_s, | |||
561 | struct dbg_session_data *session_data; | 561 | struct dbg_session_data *session_data; |
562 | 562 | ||
563 | gk20a_dbg(gpu_dbg_fn|gpu_dbg_gpu_dbg, "%s fd=%d", | 563 | gk20a_dbg(gpu_dbg_fn|gpu_dbg_gpu_dbg, "%s fd=%d", |
564 | dev_name(dbg_s->dev), args->channel_fd); | 564 | g->name, args->channel_fd); |
565 | 565 | ||
566 | /* even though get_file_channel is doing this it releases it as well */ | 566 | /* even though get_file_channel is doing this it releases it as well */ |
567 | /* by holding it here we'll keep it from disappearing while the | 567 | /* by holding it here we'll keep it from disappearing while the |
@@ -577,7 +577,7 @@ static int dbg_bind_channel_gk20a(struct dbg_session_gk20a *dbg_s, | |||
577 | return -EINVAL; | 577 | return -EINVAL; |
578 | } | 578 | } |
579 | 579 | ||
580 | gk20a_dbg_fn("%s hwchid=%d", dev_name(dbg_s->dev), ch->hw_chid); | 580 | gk20a_dbg_fn("%s hwchid=%d", g->name, ch->hw_chid); |
581 | 581 | ||
582 | nvgpu_mutex_acquire(&g->dbg_sessions_lock); | 582 | nvgpu_mutex_acquire(&g->dbg_sessions_lock); |
583 | nvgpu_mutex_acquire(&ch->dbg_s_lock); | 583 | nvgpu_mutex_acquire(&ch->dbg_s_lock); |
@@ -1262,7 +1262,7 @@ static int dbg_set_powergate(struct dbg_session_gk20a *dbg_s, u32 powermode) | |||
1262 | /* This function must be called with g->dbg_sessions_lock held */ | 1262 | /* This function must be called with g->dbg_sessions_lock held */ |
1263 | 1263 | ||
1264 | gk20a_dbg(gpu_dbg_fn|gpu_dbg_gpu_dbg, "%s powergate mode = %d", | 1264 | gk20a_dbg(gpu_dbg_fn|gpu_dbg_gpu_dbg, "%s powergate mode = %d", |
1265 | dev_name(dbg_s->dev), powermode); | 1265 | g->name, powermode); |
1266 | 1266 | ||
1267 | switch (powermode) { | 1267 | switch (powermode) { |
1268 | case NVGPU_DBG_GPU_POWERGATE_MODE_DISABLE: | 1268 | case NVGPU_DBG_GPU_POWERGATE_MODE_DISABLE: |
@@ -1352,7 +1352,7 @@ static int dbg_set_powergate(struct dbg_session_gk20a *dbg_s, u32 powermode) | |||
1352 | } | 1352 | } |
1353 | 1353 | ||
1354 | gk20a_dbg(gpu_dbg_fn|gpu_dbg_gpu_dbg, "%s powergate mode = %d done", | 1354 | gk20a_dbg(gpu_dbg_fn|gpu_dbg_gpu_dbg, "%s powergate mode = %d done", |
1355 | dev_name(dbg_s->dev), powermode); | 1355 | g->name, powermode); |
1356 | return err; | 1356 | return err; |
1357 | } | 1357 | } |
1358 | 1358 | ||
@@ -1362,7 +1362,7 @@ static int nvgpu_ioctl_powergate_gk20a(struct dbg_session_gk20a *dbg_s, | |||
1362 | int err; | 1362 | int err; |
1363 | struct gk20a *g = dbg_s->g; | 1363 | struct gk20a *g = dbg_s->g; |
1364 | gk20a_dbg_fn("%s powergate mode = %d", | 1364 | gk20a_dbg_fn("%s powergate mode = %d", |
1365 | dev_name(dbg_s->dev), args->mode); | 1365 | g->name, args->mode); |
1366 | 1366 | ||
1367 | nvgpu_mutex_acquire(&g->dbg_sessions_lock); | 1367 | nvgpu_mutex_acquire(&g->dbg_sessions_lock); |
1368 | err = g->ops.dbg_session_ops.dbg_set_powergate(dbg_s, args->mode); | 1368 | err = g->ops.dbg_session_ops.dbg_set_powergate(dbg_s, args->mode); |
@@ -1378,7 +1378,7 @@ static int nvgpu_dbg_gpu_ioctl_smpc_ctxsw_mode(struct dbg_session_gk20a *dbg_s, | |||
1378 | struct channel_gk20a *ch_gk20a; | 1378 | struct channel_gk20a *ch_gk20a; |
1379 | 1379 | ||
1380 | gk20a_dbg_fn("%s smpc ctxsw mode = %d", | 1380 | gk20a_dbg_fn("%s smpc ctxsw mode = %d", |
1381 | dev_name(dbg_s->dev), args->mode); | 1381 | g->name, args->mode); |
1382 | 1382 | ||
1383 | err = gk20a_busy(g); | 1383 | err = gk20a_busy(g); |
1384 | if (err) { | 1384 | if (err) { |
@@ -1420,7 +1420,7 @@ static int nvgpu_dbg_gpu_ioctl_hwpm_ctxsw_mode(struct dbg_session_gk20a *dbg_s, | |||
1420 | struct channel_gk20a *ch_gk20a; | 1420 | struct channel_gk20a *ch_gk20a; |
1421 | 1421 | ||
1422 | gk20a_dbg_fn("%s pm ctxsw mode = %d", | 1422 | gk20a_dbg_fn("%s pm ctxsw mode = %d", |
1423 | dev_name(dbg_s->dev), args->mode); | 1423 | g->name, args->mode); |
1424 | 1424 | ||
1425 | /* Must have a valid reservation to enable/disable hwpm cxtsw. | 1425 | /* Must have a valid reservation to enable/disable hwpm cxtsw. |
1426 | * Just print an error message for now, but eventually this should | 1426 | * Just print an error message for now, but eventually this should |
@@ -1523,7 +1523,7 @@ static int nvgpu_ioctl_allocate_profiler_object( | |||
1523 | struct gk20a *g = get_gk20a(dbg_s->dev); | 1523 | struct gk20a *g = get_gk20a(dbg_s->dev); |
1524 | struct dbg_profiler_object_data *prof_obj; | 1524 | struct dbg_profiler_object_data *prof_obj; |
1525 | 1525 | ||
1526 | gk20a_dbg_fn("%s", dev_name(dbg_s->dev)); | 1526 | gk20a_dbg_fn("%s", g->name); |
1527 | 1527 | ||
1528 | nvgpu_mutex_acquire(&g->dbg_sessions_lock); | 1528 | nvgpu_mutex_acquire(&g->dbg_sessions_lock); |
1529 | 1529 | ||
@@ -1567,7 +1567,7 @@ static int nvgpu_ioctl_free_profiler_object( | |||
1567 | bool obj_found = false; | 1567 | bool obj_found = false; |
1568 | 1568 | ||
1569 | gk20a_dbg_fn("%s session_id = %d profiler_handle = %x", | 1569 | gk20a_dbg_fn("%s session_id = %d profiler_handle = %x", |
1570 | dev_name(dbg_s->dev), dbg_s->id, args->profiler_handle); | 1570 | g->name, dbg_s->id, args->profiler_handle); |
1571 | 1571 | ||
1572 | nvgpu_mutex_acquire(&g->dbg_sessions_lock); | 1572 | nvgpu_mutex_acquire(&g->dbg_sessions_lock); |
1573 | 1573 | ||
@@ -1674,7 +1674,7 @@ static int nvgpu_profiler_reserve_acquire(struct dbg_session_gk20a *dbg_s, | |||
1674 | struct dbg_profiler_object_data *prof_obj, *my_prof_obj; | 1674 | struct dbg_profiler_object_data *prof_obj, *my_prof_obj; |
1675 | int err = 0; | 1675 | int err = 0; |
1676 | 1676 | ||
1677 | gk20a_dbg_fn("%s profiler_handle = %x", dev_name(dbg_s->dev), profiler_handle); | 1677 | gk20a_dbg_fn("%s profiler_handle = %x", g->name, profiler_handle); |
1678 | 1678 | ||
1679 | if (g->profiler_reservation_count < 0) { | 1679 | if (g->profiler_reservation_count < 0) { |
1680 | gk20a_err(dev_from_gk20a(g), "Negative reservation count!"); | 1680 | gk20a_err(dev_from_gk20a(g), "Negative reservation count!"); |
@@ -1776,7 +1776,7 @@ static int nvgpu_profiler_reserve_release(struct dbg_session_gk20a *dbg_s, | |||
1776 | struct dbg_profiler_object_data *prof_obj; | 1776 | struct dbg_profiler_object_data *prof_obj; |
1777 | int err = 0; | 1777 | int err = 0; |
1778 | 1778 | ||
1779 | gk20a_dbg_fn("%s profiler_handle = %x", dev_name(dbg_s->dev), profiler_handle); | 1779 | gk20a_dbg_fn("%s profiler_handle = %x", g->name, profiler_handle); |
1780 | 1780 | ||
1781 | nvgpu_mutex_acquire(&g->dbg_sessions_lock); | 1781 | nvgpu_mutex_acquire(&g->dbg_sessions_lock); |
1782 | 1782 | ||