diff options
Diffstat (limited to 'drivers/gpu/nvgpu/include')
-rw-r--r-- | drivers/gpu/nvgpu/include/nvgpu/kref.h | 5 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/include/nvgpu/ptimer.h | 5 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/include/nvgpu/xve.h | 3 |
3 files changed, 8 insertions, 5 deletions
diff --git a/drivers/gpu/nvgpu/include/nvgpu/kref.h b/drivers/gpu/nvgpu/include/nvgpu/kref.h index 72b21ec4..2cbc07bc 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/kref.h +++ b/drivers/gpu/nvgpu/include/nvgpu/kref.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved. | 2 | * Copyright (c) 2017-2018, NVIDIA CORPORATION. All rights reserved. |
3 | * | 3 | * |
4 | * Permission is hereby granted, free of charge, to any person obtaining a | 4 | * Permission is hereby granted, free of charge, to any person obtaining a |
5 | * copy of this software and associated documentation files (the "Software"), | 5 | * copy of this software and associated documentation files (the "Software"), |
@@ -66,8 +66,9 @@ static inline int nvgpu_ref_put(struct nvgpu_ref *ref, | |||
66 | void (*release)(struct nvgpu_ref *r)) | 66 | void (*release)(struct nvgpu_ref *r)) |
67 | { | 67 | { |
68 | if (nvgpu_atomic_sub_and_test(1, &ref->refcount)) { | 68 | if (nvgpu_atomic_sub_and_test(1, &ref->refcount)) { |
69 | if (release != NULL) | 69 | if (release != NULL) { |
70 | release(ref); | 70 | release(ref); |
71 | } | ||
71 | return 1; | 72 | return 1; |
72 | } | 73 | } |
73 | return 0; | 74 | return 0; |
diff --git a/drivers/gpu/nvgpu/include/nvgpu/ptimer.h b/drivers/gpu/nvgpu/include/nvgpu/ptimer.h index 598e064f..3369eb20 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/ptimer.h +++ b/drivers/gpu/nvgpu/include/nvgpu/ptimer.h | |||
@@ -42,10 +42,11 @@ static inline u32 ptimer_scalingfactor10x(u32 ptimer_src_freq) | |||
42 | 42 | ||
43 | static inline u32 scale_ptimer(u32 timeout , u32 scale10x) | 43 | static inline u32 scale_ptimer(u32 timeout , u32 scale10x) |
44 | { | 44 | { |
45 | if (((timeout*10) % scale10x) >= (scale10x/2)) | 45 | if (((timeout*10) % scale10x) >= (scale10x/2)) { |
46 | return ((timeout * 10) / scale10x) + 1; | 46 | return ((timeout * 10) / scale10x) + 1; |
47 | else | 47 | } else { |
48 | return (timeout * 10) / scale10x; | 48 | return (timeout * 10) / scale10x; |
49 | } | ||
49 | } | 50 | } |
50 | 51 | ||
51 | int nvgpu_get_timestamps_zipper(struct gk20a *g, | 52 | int nvgpu_get_timestamps_zipper(struct gk20a *g, |
diff --git a/drivers/gpu/nvgpu/include/nvgpu/xve.h b/drivers/gpu/nvgpu/include/nvgpu/xve.h index acaf441c..2d0d6982 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/xve.h +++ b/drivers/gpu/nvgpu/include/nvgpu/xve.h | |||
@@ -55,8 +55,9 @@ | |||
55 | static inline const char *xve_speed_to_str(u32 speed) | 55 | static inline const char *xve_speed_to_str(u32 speed) |
56 | { | 56 | { |
57 | if (!speed || !is_power_of_2(speed) || | 57 | if (!speed || !is_power_of_2(speed) || |
58 | !(speed & GPU_XVE_SPEED_MASK)) | 58 | !(speed & GPU_XVE_SPEED_MASK)) { |
59 | return "Unknown ???"; | 59 | return "Unknown ???"; |
60 | } | ||
60 | 61 | ||
61 | return speed & GPU_XVE_SPEED_2P5 ? "Gen1" : | 62 | return speed & GPU_XVE_SPEED_2P5 ? "Gen1" : |
62 | speed & GPU_XVE_SPEED_5P0 ? "Gen2" : | 63 | speed & GPU_XVE_SPEED_5P0 ? "Gen2" : |