qinwei2004 commented on code in PR #8799: URL: https://github.com/apache/nuttx/pull/8799#discussion_r1135465339
########## arch/arm64/src/common/arm64_fpu.c: ########## @@ -54,6 +80,45 @@ static struct fpu_reg g_idle_thread_fpu[CONFIG_SMP_NCPUS]; static struct arm64_cpu_fpu_context g_cpu_fpu_ctx[CONFIG_SMP_NCPUS]; +#ifdef CONFIG_FS_PROCFS_REGISTER + +/* procfs methods */ + +static int arm64_fpu_procfs_open(struct file *filep, const char *relpath, + int oflags, mode_t mode); +static int arm64_fpu_procfs_close(struct file *filep); +static ssize_t arm64_fpu_procfs_read(struct file *filep, char *buffer, + size_t buflen); +static int arm64_fpu_procfs_stat(const char *relpath, struct stat *buf); + +/* See include/nutts/fs/procfs.h + * We use the old-fashioned kind of initializers so that this will compile + * with any compiler. + */ + +const struct procfs_operations arm64_fpu_procfs_operations = +{ + arm64_fpu_procfs_open, /* open */ + arm64_fpu_procfs_close, /* close */ + arm64_fpu_procfs_read, /* read */ + NULL, /* write */ + NULL, /* dup */ + NULL, /* opendir */ + NULL, /* closedir */ + NULL, /* readdir */ + NULL, /* rewinddir */ + + arm64_fpu_procfs_stat /* stat */ +}; Review Comment: you mean like : const struct file_operations relay_file_operations = { .open = relay_file_open, .poll = relay_file_poll, .mmap = relay_file_mmap, .read = relay_file_read, .llseek = no_llseek, .release = relay_file_release, .splice_read = relay_file_splice_read, }; but most of NuttX driver use the style like my define, I guess it's for compiler compatible?? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org