Skip to content

Commit

Permalink
Fix errors raised by missing-prototypes
Browse files Browse the repository at this point in the history
The recent upstream(commit 0fcb708) in the Linux kernel globally
enforce function prototype checks. This means that it's crucial
for each function to have a declaration to validate that both the
caller and the callee expect the same argument types. Failure to
comply with this requirement may result in real bugs due to
mismatched prototypes. Therefore, in this commit, we need to add
function prototypes to the header files or declare functions with
static to ensure compatibility with these changes.
  • Loading branch information
HotMercury committed May 5, 2024
1 parent 0f28083 commit dd75574
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions simplefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,19 @@ struct simplefs_dir_block {

/* superblock functions */
int simplefs_fill_super(struct super_block *sb, void *data, int silent);
void simplefs_kill_sb(struct super_block *sb);

/* inode functions */
int simplefs_init_inode_cache(void);
void simplefs_destroy_inode_cache(void);
struct inode *simplefs_iget(struct super_block *sb, unsigned long ino);

/* dentry function */
struct dentry *simplefs_mount(struct file_system_type *fs_type,
int flags,
const char *dev_name,
void *data);

/* file functions */
extern const struct file_operations simplefs_file_ops;
extern const struct file_operations simplefs_dir_ops;
Expand Down

0 comments on commit dd75574

Please sign in to comment.