From 11c878a96eec206b86d6edaad34727e6a00c2b36 Mon Sep 17 00:00:00 2001 From: Akash Kollipara Date: Wed, 16 Mar 2022 14:10:57 +0530 Subject: [PATCH] audio: tegra: nvadsp: Fixed typecast warnings - Fixed typecast warning - Updated datatypes to make it compliant with kernel version > 5.10.0 Bug 3528414 Change-Id: Ief5cac399c35786e3f53dbe3199f70881e730df3 Signed-off-by: Akash Kollipara Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2682497 Reviewed-by: svc-mobile-coverity Reviewed-by: svc-mobile-cert Reviewed-by: Viswanath L Reviewed-by: svc_kernel_abi Reviewed-by: Ketan Patil Reviewed-by: Sharad Gupta GVS: Gerrit_Virtual_Submit --- drivers/platform/tegra/nvadsp/dev.c | 2 +- drivers/platform/tegra/nvadsp/os.c | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/platform/tegra/nvadsp/dev.c b/drivers/platform/tegra/nvadsp/dev.c index 838eb9f8..72f7fc8b 100644 --- a/drivers/platform/tegra/nvadsp/dev.c +++ b/drivers/platform/tegra/nvadsp/dev.c @@ -420,7 +420,7 @@ static int __init nvadsp_probe(struct platform_device *pdev) goto out; } drv_data->base_regs[iter] = base; - nvadsp_add_load_mappings(res->start, base, + nvadsp_add_load_mappings(res->start, (void __force *)base, resource_size(res)); } diff --git a/drivers/platform/tegra/nvadsp/os.c b/drivers/platform/tegra/nvadsp/os.c index ec05b69c..ea66ab6e 100644 --- a/drivers/platform/tegra/nvadsp/os.c +++ b/drivers/platform/tegra/nvadsp/os.c @@ -545,8 +545,8 @@ static void copy_io_in_l(void *to, const void *from, int sz) { int i; for (i = 0; i < sz; i += 4) { - int val = *(int *)(from + i); - *(int *)(to + i) = val; + u32 val = *(u32 *)(from + i); + writel(val, (void __iomem *)(to + i)); } } @@ -2224,8 +2224,13 @@ static int adsp_create_os_version(struct dentry *adsp_debugfs_root) return 0; } +#if KERNEL_VERSION(5, 10, 0) > LINUX_VERSION_CODE static unsigned int adsp_health_poll(struct file *file, poll_table *wait) +#else +static __poll_t adsp_health_poll(struct file *file, + poll_table *wait) +#endif { struct nvadsp_drv_data *drv_data = platform_get_drvdata(priv.pdev);