From 4614098993e810a9dcc7fdf60ce46ce05bc8e16a Mon Sep 17 00:00:00 2001 From: Sameer Pujar Date: Fri, 11 Sep 2020 20:52:13 +0530 Subject: [PATCH] nvadsp: fix build errors on v5.9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Following build errors are seen when ADSP configs CONFIG_TEGRA_ADSP_FILEIO and CONFIG_TEGRA_ADSP_LPTHREAD are enabled. * Error due to "segment.h" adsp_lpthread.c:14:10: fatal error: asm/segment.h: No such file or directory adspff.c:17:10: fatal error: asm/segment.h: No such file or directory (asm/segment.h inclusion is removed as asm/uaccess.h already takes care of required dependencies) * Error due to unavailable structure "sched_param" adspff.c:517:21: error: variable ‘param’ has initializer but incomplete type adspff.c:518:3: error: ‘const struct sched_param’ has no member named ‘sched_priority’ (Replace with to fix this build issue) * Error due to unavailable "get_ds()" adspff.c:63:9: error: implicit declaration of function ‘get_ds’; did you mean ‘get_fs’? [-Werror=implicit-function-declaration] (Fixed by replacing get_ds() with KERNEL_DS. The get_ds() support is removed from upstream kernel) Bug 200593718 Bug 200657500 Change-Id: I8b9cbed5ee42f34cf3731ea2d2f06aa760c28358 Signed-off-by: Sameer Pujar Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2412299 Reviewed-by: automaticguardword Reviewed-by: Mohan Kumar D Reviewed-by: Dipesh Gandhi Reviewed-by: Sharad Gupta Reviewed-by: mobile promotions Tested-by: mobile promotions GVS: Gerrit_Virtual_Submit --- drivers/platform/tegra/nvadsp/adsp_lpthread.c | 3 +-- drivers/platform/tegra/nvadsp/adspff.c | 13 ++++++------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/drivers/platform/tegra/nvadsp/adsp_lpthread.c b/drivers/platform/tegra/nvadsp/adsp_lpthread.c index 8a827a29..3646a70e 100644 --- a/drivers/platform/tegra/nvadsp/adsp_lpthread.c +++ b/drivers/platform/tegra/nvadsp/adsp_lpthread.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2019, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2016-2020, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -11,7 +11,6 @@ * more details. */ -#include #include #include diff --git a/drivers/platform/tegra/nvadsp/adspff.c b/drivers/platform/tegra/nvadsp/adspff.c index 0655c4a3..e7199e98 100644 --- a/drivers/platform/tegra/nvadsp/adspff.c +++ b/drivers/platform/tegra/nvadsp/adspff.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2019, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2016-2020, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -14,7 +14,6 @@ #define pr_fmt(fmt) "adspff: " fmt #include -#include #include #include @@ -22,13 +21,13 @@ #include #include #include -#include #include #include #include #include #include +#include #include "adspff.h" #include "dev.h" @@ -60,7 +59,7 @@ struct file *file_open(const char *path, int flags, int rights) int err = 0; oldfs = get_fs(); - set_fs(get_ds()); + set_fs(KERNEL_DS); filp = filp_open(path, flags, rights); set_fs(oldfs); if (IS_ERR(filp)) { @@ -82,7 +81,7 @@ int file_write(struct file *file, unsigned long long *offset, int ret = 0; oldfs = get_fs(); - set_fs(get_ds()); + set_fs(KERNEL_DS); ret = vfs_write(file, data, size, offset); @@ -97,7 +96,7 @@ uint32_t file_read(struct file *file, unsigned long long *offset, uint32_t ret = 0; oldfs = get_fs(); - set_fs(get_ds()); + set_fs(KERNEL_DS); ret = vfs_read(file, data, size, offset); @@ -112,7 +111,7 @@ uint32_t file_size(struct file *file) uint32_t size = 0; oldfs = get_fs(); - set_fs(get_ds()); + set_fs(KERNEL_DS); size = vfs_llseek(file, 0, SEEK_END);