From 1360c38cf4b8b2b984d23f649f6e955f07034e37 Mon Sep 17 00:00:00 2001 From: Ankita Garg Date: Wed, 14 Jun 2023 07:32:13 +0000 Subject: [PATCH] drm/tegra: Fix compile errors with clang Fix build errors encountered when building the modules with android common kernel(ACK) using clang. Bug 3974840 Change-Id: Ie12d5143c3c13a66dcd5f0ee06035593d5bec6a6 Signed-off-by: Bruce Xu Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2921068 Reviewed-by: svcacv Reviewed-by: Laxman Dewangan Tested-by: Jian-Min Liu GVS: Gerrit_Virtual_Submit --- drivers/gpu/drm/tegra/nvdec.c | 2 +- drivers/gpu/drm/tegra/submit.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/tegra/nvdec.c b/drivers/gpu/drm/tegra/nvdec.c index 211bae8e..a23fa2be 100644 --- a/drivers/gpu/drm/tegra/nvdec.c +++ b/drivers/gpu/drm/tegra/nvdec.c @@ -81,7 +81,7 @@ static inline void nvdec_writel(struct nvdec *nvdec, u32 value, static int nvdec_set_rate(struct nvdec *nvdec, unsigned long rate) { - struct nvdec_config *config = nvdec->config; + const struct nvdec_config *config = nvdec->config; struct host1x_client *client = &nvdec->client.base; unsigned long dev_rate; u32 weight, emc_kbps; diff --git a/drivers/gpu/drm/tegra/submit.c b/drivers/gpu/drm/tegra/submit.c index 65feb0f6..b489d8bd 100644 --- a/drivers/gpu/drm/tegra/submit.c +++ b/drivers/gpu/drm/tegra/submit.c @@ -1,5 +1,7 @@ // SPDX-License-Identifier: GPL-2.0-only -/* Copyright (c) 2020 NVIDIA Corporation */ +/* + * Copyright (c) 2020-2023, NVIDIA CORPORATION & AFFILIATES. All Rights Reserved. + */ #include #include @@ -425,7 +427,7 @@ submit_create_job(struct tegra_drm_context *context, struct gather_bo *bo, needed_cmds = args->num_cmds; if (job_data->timestamps.virt) { /* Space for TSP method commands */ - err = check_add_overflow(needed_cmds, 2, &needed_cmds); + err = check_add_overflow(needed_cmds, (u32)2U, &needed_cmds); if (err) { SUBMIT_ERR(context, "num_cmds too high"); job = ERR_PTR(-EINVAL);