gpu: nvgpu: fix return type of *get_litter_value()

All callers for the *get_litter_value() functions were expecting u32,
but the functions were declared to return int's. This is a violation of
MISRA 10.3 which prohibits implicit assignment between essential types
(signed int and unsigned long int, in this case).  The litter values
are all u32's anyway.

JIRA NVGPU-647

Change-Id: I853d2abee372488e5d12e355050cbeaf1e53a42c
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1830581
Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Scott Long <scottl@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Philip Elcan
2018-09-18 10:14:05 -04:00
committed by mobile promotions
parent 1a3d75790d
commit 07e5bd817a
9 changed files with 14 additions and 14 deletions

View File

@@ -71,9 +71,9 @@
#define PRIV_SECURITY_DISABLE 0x01
int gm20b_get_litter_value(struct gk20a *g, int value)
u32 gm20b_get_litter_value(struct gk20a *g, int value)
{
int ret = EINVAL;
u32 ret = EINVAL;
switch (value) {
case GPU_LIT_NUM_GPCS:
ret = proj_scal_litter_num_gpcs_v();

View File

@@ -27,5 +27,5 @@
struct gk20a;
int gm20b_init_hal(struct gk20a *g);
int gm20b_get_litter_value(struct gk20a *g, int value);
u32 gm20b_get_litter_value(struct gk20a *g, int value);
#endif /* NVGPU_GM20B_HAL_GM20B_H */

View File

@@ -106,9 +106,9 @@
#include <nvgpu/hw/gp106/hw_gr_gp106.h>
static int gp106_get_litter_value(struct gk20a *g, int value)
static u32 gp106_get_litter_value(struct gk20a *g, int value)
{
int ret = -EINVAL;
u32 ret = EINVAL;
switch (value) {
case GPU_LIT_NUM_GPCS:

View File

@@ -88,9 +88,9 @@
#include <nvgpu/hw/gp10b/hw_pwr_gp10b.h>
#include <nvgpu/hw/gp10b/hw_gr_gp10b.h>
int gp10b_get_litter_value(struct gk20a *g, int value)
u32 gp10b_get_litter_value(struct gk20a *g, int value)
{
int ret = EINVAL;
u32 ret = EINVAL;
switch (value) {
case GPU_LIT_NUM_GPCS:
ret = proj_scal_litter_num_gpcs_v();

View File

@@ -27,5 +27,5 @@
struct gk20a;
int gp10b_init_hal(struct gk20a *gops);
int gp10b_get_litter_value(struct gk20a *g, int value);
u32 gp10b_get_litter_value(struct gk20a *g, int value);
#endif /* NVGPU_HAL_GP10B_H */

View File

@@ -125,9 +125,9 @@
#include <nvgpu/hw/gv100/hw_pwr_gv100.h>
#include <nvgpu/hw/gv100/hw_gr_gv100.h>
static int gv100_get_litter_value(struct gk20a *g, int value)
static u32 gv100_get_litter_value(struct gk20a *g, int value)
{
int ret = EINVAL;
u32 ret = EINVAL;
switch (value) {
case GPU_LIT_NUM_GPCS:
ret = proj_scal_litter_num_gpcs_v();

View File

@@ -104,9 +104,9 @@
#include <nvgpu/hw/gv11b/hw_pwr_gv11b.h>
#include <nvgpu/hw/gv11b/hw_gr_gv11b.h>
int gv11b_get_litter_value(struct gk20a *g, int value)
u32 gv11b_get_litter_value(struct gk20a *g, int value)
{
int ret = EINVAL;
u32 ret = EINVAL;
switch (value) {
case GPU_LIT_NUM_GPCS:
ret = proj_scal_litter_num_gpcs_v();

View File

@@ -27,5 +27,5 @@
struct gk20a;
int gv11b_init_hal(struct gk20a *gops);
int gv11b_get_litter_value(struct gk20a *g, int value);
u32 gv11b_get_litter_value(struct gk20a *g, int value);
#endif /* NVGPU_HAL_GV11B_H */

View File

@@ -1194,7 +1194,7 @@ struct gpu_ops {
int (*perfbuffer_disable)(struct gk20a *g);
} dbg_session_ops;
int (*get_litter_value)(struct gk20a *g, int value);
u32 (*get_litter_value)(struct gk20a *g, int value);
int (*chip_init_gpu_characteristics)(struct gk20a *g);
struct {