mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-25 02:32:08 +03:00
drivers: platform: nvadsp: Fix sparse issues
Fix multiple instances of the following issues - - warning: incorrect type in argument 2 (different address spaces) - warning: symbol 'file_size' was not declared. Should it be static? Bug 3528414 Change-Id: I2cbda8dbfc98b134f36ec3c291a5147d96c6ff82 Signed-off-by: Niranjan Dighe <ndighe@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2684747 Tested-by: mobile promotions <svcmobile_promotions@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
Laxman Dewangan
parent
19cf0a1232
commit
3fa96a4417
@@ -53,7 +53,7 @@ static int open_count;
|
||||
* Kernel file functions
|
||||
******************************************************************************/
|
||||
|
||||
struct file *file_open(const char *path, int flags, int rights)
|
||||
static struct file *file_open(const char *path, int flags, int rights)
|
||||
{
|
||||
struct file *filp = NULL;
|
||||
mm_segment_t oldfs;
|
||||
@@ -70,12 +70,12 @@ struct file *file_open(const char *path, int flags, int rights)
|
||||
return filp;
|
||||
}
|
||||
|
||||
void file_close(struct file *file)
|
||||
static void file_close(struct file *file)
|
||||
{
|
||||
filp_close(file, NULL);
|
||||
}
|
||||
|
||||
int file_write(struct file *file, unsigned long long *offset,
|
||||
static int file_write(struct file *file, unsigned long long *offset,
|
||||
unsigned char *data, unsigned int size)
|
||||
{
|
||||
mm_segment_t oldfs;
|
||||
@@ -84,13 +84,13 @@ int file_write(struct file *file, unsigned long long *offset,
|
||||
oldfs = get_fs();
|
||||
set_fs(KERNEL_DS);
|
||||
|
||||
ret = vfs_write(file, data, size, offset);
|
||||
ret = vfs_write(file, (const char __user *)data, size, offset);
|
||||
|
||||
set_fs(oldfs);
|
||||
return ret;
|
||||
}
|
||||
|
||||
uint32_t file_read(struct file *file, unsigned long long *offset,
|
||||
static uint32_t file_read(struct file *file, unsigned long long *offset,
|
||||
unsigned char *data, unsigned int size)
|
||||
{
|
||||
mm_segment_t oldfs;
|
||||
@@ -99,14 +99,14 @@ uint32_t file_read(struct file *file, unsigned long long *offset,
|
||||
oldfs = get_fs();
|
||||
set_fs(KERNEL_DS);
|
||||
|
||||
ret = vfs_read(file, data, size, offset);
|
||||
ret = vfs_read(file, (char __user *)data, size, offset);
|
||||
|
||||
set_fs(oldfs);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
uint32_t file_size(struct file *file)
|
||||
static uint32_t file_size(struct file *file)
|
||||
{
|
||||
mm_segment_t oldfs;
|
||||
uint32_t size = 0;
|
||||
@@ -137,7 +137,7 @@ static struct nvadsp_mbox rx_mbox;
|
||||
* w+ - open for reading and writing (overwrite file) *
|
||||
* a+ - open for reading and writing (append if file exists) */
|
||||
|
||||
void set_flags(union adspff_message_t *m, unsigned int *flags)
|
||||
static void set_flags(union adspff_message_t *m, unsigned int *flags)
|
||||
{
|
||||
if (0 == strcmp(m->msg.payload.fopen_msg.modes, "r+"))
|
||||
*flags = O_RDWR;
|
||||
@@ -202,7 +202,7 @@ static struct file_struct *check_file_opened(const char *path)
|
||||
return file;
|
||||
}
|
||||
|
||||
void adspff_fopen(void)
|
||||
static void adspff_fopen(void)
|
||||
{
|
||||
union adspff_message_t *message;
|
||||
union adspff_message_t *msg_recv;
|
||||
@@ -293,7 +293,7 @@ static inline unsigned int is_write_file(struct file_struct *file)
|
||||
return file->flags & (O_WRONLY | O_RDWR);
|
||||
}
|
||||
|
||||
void adspff_fclose(void)
|
||||
static void adspff_fclose(void)
|
||||
{
|
||||
union adspff_message_t *message;
|
||||
struct file_struct *file = NULL;
|
||||
@@ -326,7 +326,7 @@ void adspff_fclose(void)
|
||||
kfree(message);
|
||||
}
|
||||
|
||||
void adspff_fsize(void)
|
||||
static void adspff_fsize(void)
|
||||
{
|
||||
union adspff_message_t *msg_recv;
|
||||
union adspff_message_t message;
|
||||
@@ -366,7 +366,7 @@ void adspff_fsize(void)
|
||||
kfree(msg_recv);
|
||||
}
|
||||
|
||||
void adspff_fwrite(void)
|
||||
static void adspff_fwrite(void)
|
||||
{
|
||||
union adspff_message_t message;
|
||||
union adspff_message_t *msg_recv;
|
||||
@@ -424,7 +424,7 @@ void adspff_fwrite(void)
|
||||
kfree(msg_recv);
|
||||
}
|
||||
|
||||
void adspff_fread(void)
|
||||
static void adspff_fread(void)
|
||||
{
|
||||
union adspff_message_t *message;
|
||||
union adspff_message_t *msg_recv;
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
|
||||
#include "dev.h"
|
||||
#include "os.h"
|
||||
#include "dev-t18x.h"
|
||||
|
||||
#if IS_ENABLED(CONFIG_TEGRA_HSP)
|
||||
static void nvadsp_dbell_handler(void *data)
|
||||
|
||||
@@ -546,7 +546,7 @@ 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);
|
||||
writel(val, to + i);
|
||||
*(int *)(to + i) = val;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -969,6 +969,7 @@ EXPORT_SYMBOL(nvadsp_os_load);
|
||||
* 0 - min emc freq
|
||||
* > 0 - expected emc freq at this adsp freq
|
||||
*/
|
||||
#ifdef CONFIG_TEGRA_ADSP_DFS
|
||||
u32 adsp_to_emc_freq(u32 adspfreq)
|
||||
{
|
||||
/*
|
||||
@@ -980,6 +981,7 @@ u32 adsp_to_emc_freq(u32 adspfreq)
|
||||
else
|
||||
return 0; /* emc min */
|
||||
}
|
||||
#endif
|
||||
|
||||
static int nvadsp_set_ape_emc_freq(struct nvadsp_drv_data *drv_data)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user