Skip to content

Commit f4f1c70

Browse files
committed
drm/msm/adreno: Remove redundant revn param
This just duplicates what is in adreno_info, and can cause confusion if used before it is set. Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Konrad Dybcio <[email protected]> Reviewed-by: Dmitry Baryshkov <[email protected]> Patchwork: https://patchwork.freedesktop.org/patch/549761/
1 parent 6391030 commit f4f1c70

File tree

3 files changed

+9
-16
lines changed

3 files changed

+9
-16
lines changed

drivers/gpu/drm/msm/adreno/a6xx_gpu.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2484,8 +2484,6 @@ struct msm_gpu *a6xx_gpu_init(struct drm_device *dev)
24842484
return ERR_PTR(-EINVAL);
24852485

24862486
/* Assign these early so that we can use the is_aXYZ helpers */
2487-
/* Numeric revision IDs (e.g. 630) */
2488-
adreno_gpu->revn = info->revn;
24892487
/* New-style ADRENO_REV()-only */
24902488
adreno_gpu->rev = info->rev;
24912489
/* Quirk data */

drivers/gpu/drm/msm/adreno/adreno_gpu.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1099,7 +1099,6 @@ int adreno_gpu_init(struct drm_device *drm, struct platform_device *pdev,
10991099

11001100
adreno_gpu->funcs = funcs;
11011101
adreno_gpu->info = adreno_info(config->rev);
1102-
adreno_gpu->revn = adreno_gpu->info->revn;
11031102
adreno_gpu->rev = *rev;
11041103

11051104
if (adreno_read_speedbin(dev, &speedbin) || !speedbin)

drivers/gpu/drm/msm/adreno/adreno_gpu.h

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ struct adreno_gpu {
7777
struct msm_gpu base;
7878
struct adreno_rev rev;
7979
const struct adreno_info *info;
80-
uint32_t revn; /* numeric revision name */
8180
uint16_t speedbin;
8281
const struct adreno_gpu_funcs *funcs;
8382

@@ -147,10 +146,9 @@ bool adreno_cmp_rev(struct adreno_rev rev1, struct adreno_rev rev2);
147146

148147
static inline bool adreno_is_revn(const struct adreno_gpu *gpu, uint32_t revn)
149148
{
150-
/* revn can be zero, but if not is set at same time as info */
151-
WARN_ON_ONCE(!gpu->info);
152-
153-
return gpu->revn == revn;
149+
if (WARN_ON_ONCE(!gpu->info))
150+
return false;
151+
return gpu->info->revn == revn;
154152
}
155153

156154
static inline bool adreno_has_gmu_wrapper(const struct adreno_gpu *gpu)
@@ -160,18 +158,16 @@ static inline bool adreno_has_gmu_wrapper(const struct adreno_gpu *gpu)
160158

161159
static inline bool adreno_is_a2xx(const struct adreno_gpu *gpu)
162160
{
163-
/* revn can be zero, but if not is set at same time as info */
164-
WARN_ON_ONCE(!gpu->info);
165-
166-
return (gpu->revn < 300);
161+
if (WARN_ON_ONCE(!gpu->info))
162+
return false;
163+
return (gpu->info->revn < 300);
167164
}
168165

169166
static inline bool adreno_is_a20x(const struct adreno_gpu *gpu)
170167
{
171-
/* revn can be zero, but if not is set at same time as info */
172-
WARN_ON_ONCE(!gpu->info);
173-
174-
return (gpu->revn < 210);
168+
if (WARN_ON_ONCE(!gpu->info))
169+
return false;
170+
return (gpu->info->revn < 210);
175171
}
176172

177173
static inline bool adreno_is_a225(const struct adreno_gpu *gpu)

0 commit comments

Comments
 (0)