diff options
author | Philip Elcan <pelcan@nvidia.com> | 2018-08-23 14:45:19 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-08-29 20:47:25 -0400 |
commit | 2d0149c9abd74fd6bb59e076cfd46f49097e5662 (patch) | |
tree | 3d14929f7721440b777abfc150a35abbb1b03f36 /drivers/gpu/nvgpu/gp10b | |
parent | 74639b444251d7adc222400625eb59a3d53d0c0a (diff) |
gpu: nvgpu: resolve MISRA 10.3 violations
MISRA rule 10.3 prohibits implicit assigning of u64 to u32. The nvgpu was
assigning the value returned by ARRAY_SIZE which is a u64 to a u32. This
value was then returned in a function defined by gpu_ops.
This patch changes the return type for these gpu_ops to u64 and updates
the functions that implement the functions and lastly the saved value. This
removes the violation in this instance.
JIRA NVGPU-647
Change-Id: I2b93929633cf4809d8f65ee41f739f45d4c2cda7
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1805588
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gp10b')
-rw-r--r-- | drivers/gpu/nvgpu/gp10b/regops_gp10b.c | 24 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gp10b/regops_gp10b.h | 14 |
2 files changed, 19 insertions, 19 deletions
diff --git a/drivers/gpu/nvgpu/gp10b/regops_gp10b.c b/drivers/gpu/nvgpu/gp10b/regops_gp10b.c index 60f36b6c..8113f7d5 100644 --- a/drivers/gpu/nvgpu/gp10b/regops_gp10b.c +++ b/drivers/gpu/nvgpu/gp10b/regops_gp10b.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Tegra GK20A GPU Debugger Driver Register Ops | 2 | * Tegra GK20A GPU Debugger Driver Register Ops |
3 | * | 3 | * |
4 | * Copyright (c) 2015-2017, NVIDIA CORPORATION. All rights reserved. | 4 | * Copyright (c) 2015-2018, NVIDIA CORPORATION. All rights reserved. |
5 | * | 5 | * |
6 | * Permission is hereby granted, free of charge, to any person obtaining a | 6 | * Permission is hereby granted, free of charge, to any person obtaining a |
7 | * copy of this software and associated documentation files (the "Software"), | 7 | * copy of this software and associated documentation files (the "Software"), |
@@ -382,7 +382,7 @@ static const struct regop_offset_range gp10b_global_whitelist_ranges[] = { | |||
382 | { 0x009a0100, 1}, | 382 | { 0x009a0100, 1}, |
383 | }; | 383 | }; |
384 | 384 | ||
385 | static const u32 gp10b_global_whitelist_ranges_count = | 385 | static const u64 gp10b_global_whitelist_ranges_count = |
386 | ARRAY_SIZE(gp10b_global_whitelist_ranges); | 386 | ARRAY_SIZE(gp10b_global_whitelist_ranges); |
387 | 387 | ||
388 | /* context */ | 388 | /* context */ |
@@ -390,24 +390,24 @@ static const u32 gp10b_global_whitelist_ranges_count = | |||
390 | /* runcontrol */ | 390 | /* runcontrol */ |
391 | static const u32 gp10b_runcontrol_whitelist[] = { | 391 | static const u32 gp10b_runcontrol_whitelist[] = { |
392 | }; | 392 | }; |
393 | static const u32 gp10b_runcontrol_whitelist_count = | 393 | static const u64 gp10b_runcontrol_whitelist_count = |
394 | ARRAY_SIZE(gp10b_runcontrol_whitelist); | 394 | ARRAY_SIZE(gp10b_runcontrol_whitelist); |
395 | 395 | ||
396 | static const struct regop_offset_range gp10b_runcontrol_whitelist_ranges[] = { | 396 | static const struct regop_offset_range gp10b_runcontrol_whitelist_ranges[] = { |
397 | }; | 397 | }; |
398 | static const u32 gp10b_runcontrol_whitelist_ranges_count = | 398 | static const u64 gp10b_runcontrol_whitelist_ranges_count = |
399 | ARRAY_SIZE(gp10b_runcontrol_whitelist_ranges); | 399 | ARRAY_SIZE(gp10b_runcontrol_whitelist_ranges); |
400 | 400 | ||
401 | 401 | ||
402 | /* quad ctl */ | 402 | /* quad ctl */ |
403 | static const u32 gp10b_qctl_whitelist[] = { | 403 | static const u32 gp10b_qctl_whitelist[] = { |
404 | }; | 404 | }; |
405 | static const u32 gp10b_qctl_whitelist_count = | 405 | static const u64 gp10b_qctl_whitelist_count = |
406 | ARRAY_SIZE(gp10b_qctl_whitelist); | 406 | ARRAY_SIZE(gp10b_qctl_whitelist); |
407 | 407 | ||
408 | static const struct regop_offset_range gp10b_qctl_whitelist_ranges[] = { | 408 | static const struct regop_offset_range gp10b_qctl_whitelist_ranges[] = { |
409 | }; | 409 | }; |
410 | static const u32 gp10b_qctl_whitelist_ranges_count = | 410 | static const u64 gp10b_qctl_whitelist_ranges_count = |
411 | ARRAY_SIZE(gp10b_qctl_whitelist_ranges); | 411 | ARRAY_SIZE(gp10b_qctl_whitelist_ranges); |
412 | 412 | ||
413 | const struct regop_offset_range *gp10b_get_global_whitelist_ranges(void) | 413 | const struct regop_offset_range *gp10b_get_global_whitelist_ranges(void) |
@@ -415,7 +415,7 @@ const struct regop_offset_range *gp10b_get_global_whitelist_ranges(void) | |||
415 | return gp10b_global_whitelist_ranges; | 415 | return gp10b_global_whitelist_ranges; |
416 | } | 416 | } |
417 | 417 | ||
418 | int gp10b_get_global_whitelist_ranges_count(void) | 418 | u64 gp10b_get_global_whitelist_ranges_count(void) |
419 | { | 419 | { |
420 | return gp10b_global_whitelist_ranges_count; | 420 | return gp10b_global_whitelist_ranges_count; |
421 | } | 421 | } |
@@ -425,7 +425,7 @@ const struct regop_offset_range *gp10b_get_context_whitelist_ranges(void) | |||
425 | return gp10b_global_whitelist_ranges; | 425 | return gp10b_global_whitelist_ranges; |
426 | } | 426 | } |
427 | 427 | ||
428 | int gp10b_get_context_whitelist_ranges_count(void) | 428 | u64 gp10b_get_context_whitelist_ranges_count(void) |
429 | { | 429 | { |
430 | return gp10b_global_whitelist_ranges_count; | 430 | return gp10b_global_whitelist_ranges_count; |
431 | } | 431 | } |
@@ -435,7 +435,7 @@ const u32 *gp10b_get_runcontrol_whitelist(void) | |||
435 | return gp10b_runcontrol_whitelist; | 435 | return gp10b_runcontrol_whitelist; |
436 | } | 436 | } |
437 | 437 | ||
438 | int gp10b_get_runcontrol_whitelist_count(void) | 438 | u64 gp10b_get_runcontrol_whitelist_count(void) |
439 | { | 439 | { |
440 | return gp10b_runcontrol_whitelist_count; | 440 | return gp10b_runcontrol_whitelist_count; |
441 | } | 441 | } |
@@ -445,7 +445,7 @@ const struct regop_offset_range *gp10b_get_runcontrol_whitelist_ranges(void) | |||
445 | return gp10b_runcontrol_whitelist_ranges; | 445 | return gp10b_runcontrol_whitelist_ranges; |
446 | } | 446 | } |
447 | 447 | ||
448 | int gp10b_get_runcontrol_whitelist_ranges_count(void) | 448 | u64 gp10b_get_runcontrol_whitelist_ranges_count(void) |
449 | { | 449 | { |
450 | return gp10b_runcontrol_whitelist_ranges_count; | 450 | return gp10b_runcontrol_whitelist_ranges_count; |
451 | } | 451 | } |
@@ -455,7 +455,7 @@ const u32 *gp10b_get_qctl_whitelist(void) | |||
455 | return gp10b_qctl_whitelist; | 455 | return gp10b_qctl_whitelist; |
456 | } | 456 | } |
457 | 457 | ||
458 | int gp10b_get_qctl_whitelist_count(void) | 458 | u64 gp10b_get_qctl_whitelist_count(void) |
459 | { | 459 | { |
460 | return gp10b_qctl_whitelist_count; | 460 | return gp10b_qctl_whitelist_count; |
461 | } | 461 | } |
@@ -465,7 +465,7 @@ const struct regop_offset_range *gp10b_get_qctl_whitelist_ranges(void) | |||
465 | return gp10b_qctl_whitelist_ranges; | 465 | return gp10b_qctl_whitelist_ranges; |
466 | } | 466 | } |
467 | 467 | ||
468 | int gp10b_get_qctl_whitelist_ranges_count(void) | 468 | u64 gp10b_get_qctl_whitelist_ranges_count(void) |
469 | { | 469 | { |
470 | return gp10b_qctl_whitelist_ranges_count; | 470 | return gp10b_qctl_whitelist_ranges_count; |
471 | } | 471 | } |
diff --git a/drivers/gpu/nvgpu/gp10b/regops_gp10b.h b/drivers/gpu/nvgpu/gp10b/regops_gp10b.h index 7bc08189..e8b9f325 100644 --- a/drivers/gpu/nvgpu/gp10b/regops_gp10b.h +++ b/drivers/gpu/nvgpu/gp10b/regops_gp10b.h | |||
@@ -2,7 +2,7 @@ | |||
2 | * | 2 | * |
3 | * Tegra GP10B GPU Debugger Driver Register Ops | 3 | * Tegra GP10B GPU Debugger Driver Register Ops |
4 | * | 4 | * |
5 | * Copyright (c) 2015-2017, NVIDIA CORPORATION. All rights reserved. | 5 | * Copyright (c) 2015-2018, NVIDIA CORPORATION. All rights reserved. |
6 | * | 6 | * |
7 | * Permission is hereby granted, free of charge, to any person obtaining a | 7 | * Permission is hereby granted, free of charge, to any person obtaining a |
8 | * copy of this software and associated documentation files (the "Software"), | 8 | * copy of this software and associated documentation files (the "Software"), |
@@ -28,17 +28,17 @@ | |||
28 | struct dbg_session_gk20a; | 28 | struct dbg_session_gk20a; |
29 | 29 | ||
30 | const struct regop_offset_range *gp10b_get_global_whitelist_ranges(void); | 30 | const struct regop_offset_range *gp10b_get_global_whitelist_ranges(void); |
31 | int gp10b_get_global_whitelist_ranges_count(void); | 31 | u64 gp10b_get_global_whitelist_ranges_count(void); |
32 | const struct regop_offset_range *gp10b_get_context_whitelist_ranges(void); | 32 | const struct regop_offset_range *gp10b_get_context_whitelist_ranges(void); |
33 | int gp10b_get_context_whitelist_ranges_count(void); | 33 | u64 gp10b_get_context_whitelist_ranges_count(void); |
34 | const u32 *gp10b_get_runcontrol_whitelist(void); | 34 | const u32 *gp10b_get_runcontrol_whitelist(void); |
35 | int gp10b_get_runcontrol_whitelist_count(void); | 35 | u64 gp10b_get_runcontrol_whitelist_count(void); |
36 | const struct regop_offset_range *gp10b_get_runcontrol_whitelist_ranges(void); | 36 | const struct regop_offset_range *gp10b_get_runcontrol_whitelist_ranges(void); |
37 | int gp10b_get_runcontrol_whitelist_ranges_count(void); | 37 | u64 gp10b_get_runcontrol_whitelist_ranges_count(void); |
38 | const u32 *gp10b_get_qctl_whitelist(void); | 38 | const u32 *gp10b_get_qctl_whitelist(void); |
39 | int gp10b_get_qctl_whitelist_count(void); | 39 | u64 gp10b_get_qctl_whitelist_count(void); |
40 | const struct regop_offset_range *gp10b_get_qctl_whitelist_ranges(void); | 40 | const struct regop_offset_range *gp10b_get_qctl_whitelist_ranges(void); |
41 | int gp10b_get_qctl_whitelist_ranges_count(void); | 41 | u64 gp10b_get_qctl_whitelist_ranges_count(void); |
42 | int gp10b_apply_smpc_war(struct dbg_session_gk20a *dbg_s); | 42 | int gp10b_apply_smpc_war(struct dbg_session_gk20a *dbg_s); |
43 | 43 | ||
44 | #endif /* __REGOPS_GP10B_H_ */ | 44 | #endif /* __REGOPS_GP10B_H_ */ |