aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--device_info_procfs.c1
-rw-r--r--nvdebug.h2
-rw-r--r--nvdebug_entry.c2
-rw-r--r--runlist_procfs.c4
4 files changed, 7 insertions, 2 deletions
diff --git a/device_info_procfs.c b/device_info_procfs.c
index c96007a..1fc0586 100644
--- a/device_info_procfs.c
+++ b/device_info_procfs.c
@@ -24,6 +24,7 @@ static ssize_t nvdebug_reg32_read(struct file *f, char __user *buf, size_t size,
24} 24}
25struct file_operations nvdebug_read_reg32_file_ops = { 25struct file_operations nvdebug_read_reg32_file_ops = {
26 .read = nvdebug_reg32_read, 26 .read = nvdebug_reg32_read,
27 .llseek = default_llseek,
27}; 28};
28 29
29//// ==v== PTOP_DEVICE_INFO ==v== //// 30//// ==v== PTOP_DEVICE_INFO ==v== ////
diff --git a/nvdebug.h b/nvdebug.h
index 968a60b..8009b84 100644
--- a/nvdebug.h
+++ b/nvdebug.h
@@ -951,7 +951,7 @@ static inline int file2parentgpuidx(const struct file *f) {
951// was upgraded from Linux 4.9 to 5.10 (r32 -> r34+) 951// was upgraded from Linux 4.9 to 5.10 (r32 -> r34+)
952// Note that this is wrong if nvgpu was built without CONFIG_NVGPU_NON_FUSA 952// Note that this is wrong if nvgpu was built without CONFIG_NVGPU_NON_FUSA
953// i.e. if FUSA was enabled, this is wrong. 953// i.e. if FUSA was enabled, this is wrong.
954#define gk20a_regs(gk20a) ((void*)gk20a + sizeof(void(*)(void))) 954#define gk20a_regs(gk20a) (*(void**)((void*)gk20a + sizeof(void(*)(void))))
955#else 955#else
956#include <os/linux/os_linux.h> // For struct nvgpu_os_linux, which holds regs 956#include <os/linux/os_linux.h> // For struct nvgpu_os_linux, which holds regs
957#define gk20a_regs(gk20a) (container_of(gk20a, struct nvgpu_os_linux, g)->regs) 957#define gk20a_regs(gk20a) (container_of(gk20a, struct nvgpu_os_linux, g)->regs)
diff --git a/nvdebug_entry.c b/nvdebug_entry.c
index 60fb7af..8e8266c 100644
--- a/nvdebug_entry.c
+++ b/nvdebug_entry.c
@@ -35,7 +35,7 @@ unsigned int g_nvdebug_devices = 0;
35#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0) 35#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)
36// This rewrites the struct to the proc_ops layout on newer kernels 36// This rewrites the struct to the proc_ops layout on newer kernels
37const struct proc_ops* compat_ops(const struct file_operations* ops) { 37const struct proc_ops* compat_ops(const struct file_operations* ops) {
38 struct proc_ops new_ops; 38 struct proc_ops new_ops = {};
39 new_ops.proc_open = ops->open; 39 new_ops.proc_open = ops->open;
40 new_ops.proc_read = ops->read; 40 new_ops.proc_read = ops->read;
41 new_ops.proc_write = ops->write; 41 new_ops.proc_write = ops->write;
diff --git a/runlist_procfs.c b/runlist_procfs.c
index a0e71b0..d9ec6eb 100644
--- a/runlist_procfs.c
+++ b/runlist_procfs.c
@@ -201,6 +201,7 @@ ssize_t preempt_tsg_file_write(struct file *f, const char __user *buffer,
201 201
202struct file_operations preempt_tsg_file_ops = { 202struct file_operations preempt_tsg_file_ops = {
203 .write = preempt_tsg_file_write, 203 .write = preempt_tsg_file_write,
204 .llseek = default_llseek,
204}; 205};
205 206
206ssize_t disable_channel_file_write(struct file *f, const char __user *buffer, 207ssize_t disable_channel_file_write(struct file *f, const char __user *buffer,
@@ -238,6 +239,7 @@ ssize_t disable_channel_file_write(struct file *f, const char __user *buffer,
238 239
239struct file_operations disable_channel_file_ops = { 240struct file_operations disable_channel_file_ops = {
240 .write = disable_channel_file_write, 241 .write = disable_channel_file_write,
242 .llseek = default_llseek,
241}; 243};
242 244
243ssize_t enable_channel_file_write(struct file *f, const char __user *buffer, 245ssize_t enable_channel_file_write(struct file *f, const char __user *buffer,
@@ -264,6 +266,7 @@ ssize_t enable_channel_file_write(struct file *f, const char __user *buffer,
264 266
265struct file_operations enable_channel_file_ops = { 267struct file_operations enable_channel_file_ops = {
266 .write = enable_channel_file_write, 268 .write = enable_channel_file_write,
269 .llseek = default_llseek,
267}; 270};
268 271
269ssize_t switch_to_tsg_file_write(struct file *f, const char __user *buffer, 272ssize_t switch_to_tsg_file_write(struct file *f, const char __user *buffer,
@@ -319,4 +322,5 @@ ssize_t switch_to_tsg_file_write(struct file *f, const char __user *buffer,
319 322
320struct file_operations switch_to_tsg_file_ops = { 323struct file_operations switch_to_tsg_file_ops = {
321 .write = switch_to_tsg_file_write, 324 .write = switch_to_tsg_file_write,
325 .llseek = default_llseek,
322}; 326};