From 12c54c93ddb8acc8d18a1073f459dfb1302a6e36 Mon Sep 17 00:00:00 2001 From: Liu Aleaxander Date: Sat, 5 Jun 2010 22:05:29 +0800 Subject: [PATCH] Clean up the warning messages Signed-off-by: Liu Aleaxander --- fs/tfs/dir.c | 2 ++ fs/tfs/inode.c | 3 ++- fs/tfs/tfs_cmd.c | 2 +- include/bitopts.h | 3 +++ include/tfs.h | 4 ++++ init/init.c | 2 +- mm/malloc.c | 1 + 7 files changed, 14 insertions(+), 3 deletions(-) diff --git a/fs/tfs/dir.c b/fs/tfs/dir.c index 8a7e06a..3d8982a 100644 --- a/fs/tfs/dir.c +++ b/fs/tfs/dir.c @@ -267,6 +267,8 @@ int tfs_unlink(struct tfs_sb_info *sbi, const char *path) de->d_inode = 0; tfs_bwrite(sbi, cs->block, cs->data); tfs_release_inode(sbi, inode); + + return 0; } diff --git a/fs/tfs/inode.c b/fs/tfs/inode.c index b78d18a..6de7fd3 100644 --- a/fs/tfs/inode.c +++ b/fs/tfs/inode.c @@ -70,6 +70,7 @@ int tfs_release_inode(struct tfs_sb_info *sbi, struct inode *inode) tfs_free_block(sbi, block); free_inode(inode); + return 0; } @@ -311,7 +312,7 @@ struct inode * __mknod(struct tfs_sb_info *sbi, struct inode *dir, const char *f struct cache_struct *cs; int dirty = 0; - if (cs = tfs_find_entry(sbi, filename, dir, &de)) { + if ((cs = tfs_find_entry(sbi, filename, dir, &de))) { printk("ERROR: %s exist!\n", filename); return NULL; } diff --git a/fs/tfs/tfs_cmd.c b/fs/tfs/tfs_cmd.c index 24d2639..9c219a0 100644 --- a/fs/tfs/tfs_cmd.c +++ b/fs/tfs/tfs_cmd.c @@ -72,7 +72,7 @@ void ls(struct tfs_sb_info *sbi, char *filename) return; } - while (de = tfs_readdir(dir)) { + while ((de = tfs_readdir(dir))) { printk("%6d\t %s\n", de->d_ino, de->d_name); free(de); } diff --git a/include/bitopts.h b/include/bitopts.h index 1307acd..6353c5a 100644 --- a/include/bitopts.h +++ b/include/bitopts.h @@ -57,6 +57,9 @@ static unsigned long find_first_zero(void *buf, void *end) for (i = 0; i < 32; i++) if (test_bit(p, i) == 0) return block + i; + + /* Just to avoid the compile warning message */ + return -1; } diff --git a/include/tfs.h b/include/tfs.h index 8002950..fbc48d1 100644 --- a/include/tfs.h +++ b/include/tfs.h @@ -140,12 +140,16 @@ struct cache_struct *tfs_find_entry(struct tfs_sb_info *, const char *, struct i int tfs_add_entry(struct tfs_sb_info *, struct inode *, const char *, int , int *); int tfs_mkdir(struct tfs_sb_info *, const char *); int tfs_rmdir(struct tfs_sb_info *, const char *); +int tfs_unlink(struct tfs_sb_info *, const char *); /* inode.c */ struct inode *new_inode(int); void free_inode(struct inode *); +struct inode * tfs_new_inode(struct tfs_sb_info *, int); +int tfs_release_inode(struct tfs_sb_info *, struct inode *); struct inode *tfs_root_init(struct tfs_sb_info *); struct inode *tfs_iget_root(struct tfs_sb_info *); +struct inode *tfs_iget_by_inr(struct tfs_sb_info *, int); struct inode *tfs_iget(struct tfs_sb_info *, char *, struct inode *); struct inode *tfs_namei(struct tfs_sb_info *, const char *, uint32_t); uint32_t tfs_bmap(struct inode *, int); diff --git a/init/init.c b/init/init.c index 120e629..3f62540 100755 --- a/init/init.c +++ b/init/init.c @@ -182,7 +182,7 @@ void init(void) printk("Cd into root... "); this_dir = tfs_opendir(tfs_sbi, "/"); if (!this_dir) { - printf("cd into root dir failed!\n"); + printk("cd into root dir failed!\n"); } printk("\t\t\t%s\n", ok); diff --git a/mm/malloc.c b/mm/malloc.c index a44f74a..f0f1549 100644 --- a/mm/malloc.c +++ b/mm/malloc.c @@ -210,6 +210,7 @@ void Debug_mm(void) char *buf; #include +#include buf = malloc(1024); printk("malloc returned: %p\n", buf); floppy_reads(0, buf, 2); -- 2.11.4.GIT