From: Charles Manning Date: Thu, 7 Jun 2012 02:54:30 +0000 (+1200) Subject: Fix some statics and remove unused function X-Git-Tag: pre-driver-refactoring~8 X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=commitdiff_plain;h=cb185cec287359727e44321979ad2324b4fad7cb;ds=sidebyside Fix some statics and remove unused function Signed-off-by: Charles Manning --- diff --git a/direct/yaffsfs.c b/direct/yaffsfs.c index 9f1397b..62fb793 100644 --- a/direct/yaffsfs.c +++ b/direct/yaffsfs.c @@ -394,19 +394,19 @@ static int yaffs_toupper(YCHAR a) return a; } -int yaffsfs_Match(YCHAR a, YCHAR b) +static int yaffsfs_Match(YCHAR a, YCHAR b) { return (yaffs_toupper(a) == yaffs_toupper(b)); } #else -int yaffsfs_Match(YCHAR a, YCHAR b) +static int yaffsfs_Match(YCHAR a, YCHAR b) { /* case sensitive */ return (a == b); } #endif -int yaffsfs_IsPathDivider(YCHAR ch) +static int yaffsfs_IsPathDivider(YCHAR ch) { const YCHAR *str = YAFFS_PATH_DIVIDERS; @@ -419,7 +419,7 @@ int yaffsfs_IsPathDivider(YCHAR ch) return 0; } -int yaffsfs_CheckNameLength(const char *name) +static int yaffsfs_CheckNameLength(const char *name) { int retVal = 0; @@ -1000,7 +1000,7 @@ int yaffs_open(const YCHAR *path, int oflag, int mode) YAFFS_SHARE_READ | YAFFS_SHARE_WRITE); } -int yaffs_Dofsync(int handle, int datasync) +static int yaffs_Dofsync(int handle, int datasync) { int retVal = -1; struct yaffs_obj *obj; @@ -1063,7 +1063,7 @@ int yaffs_close(int handle) return retVal; } -int yaffsfs_do_read(int handle, void *vbuf, unsigned int nbyte, +static int yaffsfs_do_read(int handle, void *vbuf, unsigned int nbyte, int isPread, loff_t offset) { struct yaffsfs_FileDes *fd = NULL; @@ -1185,7 +1185,7 @@ int yaffs_pread(int handle, void *buf, unsigned int nbyte, loff_t offset) return yaffsfs_do_read(handle, buf, nbyte, 1, offset); } -int yaffsfs_do_write(int handle, const void *vbuf, unsigned int nbyte, +static int yaffsfs_do_write(int handle, const void *vbuf, unsigned int nbyte, int isPwrite, loff_t offset) { struct yaffsfs_FileDes *fd = NULL; @@ -1416,7 +1416,7 @@ loff_t yaffs_lseek(int handle, loff_t offset, int whence) return pos; } -int yaffsfs_DoUnlink(const YCHAR *path, int isDirectory) +static int yaffsfs_DoUnlink(const YCHAR *path, int isDirectory) { struct yaffs_obj *dir = NULL; struct yaffs_obj *obj = NULL; diff --git a/yaffs_attribs.c b/yaffs_attribs.c index fe914e5..3d778f2 100644 --- a/yaffs_attribs.c +++ b/yaffs_attribs.c @@ -52,7 +52,7 @@ void yaffs_attribs_init(struct yaffs_obj *obj, u32 gid, u32 uid, u32 rdev) obj->yst_gid = gid; } -loff_t yaffs_get_file_size(struct yaffs_obj *obj) +static loff_t yaffs_get_file_size(struct yaffs_obj *obj) { YCHAR *alias = NULL; obj = yaffs_get_equivalent_obj(obj); diff --git a/yaffs_guts.c b/yaffs_guts.c index df6cb00..6d9f608 100644 --- a/yaffs_guts.c +++ b/yaffs_guts.c @@ -185,31 +185,6 @@ void yaffs_release_temp_buffer(struct yaffs_dev *dev, u8 *buffer) } -/* - * Determine if we have a managed buffer. - */ -int yaffs_is_managed_tmp_buffer(struct yaffs_dev *dev, const u8 *buffer) -{ - int i; - - for (i = 0; i < YAFFS_N_TEMP_BUFFERS; i++) { - if (dev->temp_buffer[i].buffer == buffer) - return 1; - } - - for (i = 0; i < dev->param.n_caches; i++) { - if (dev->cache[i].data == buffer) - return 1; - } - - if (buffer == dev->checkpt_buffer) - return 1; - - yaffs_trace(YAFFS_TRACE_ALWAYS, - "yaffs: unmaged buffer detected."); - return 0; -} - /* * Functions for robustisizing TODO * @@ -739,7 +714,7 @@ static void yaffs_deinit_tnodes_and_objs(struct yaffs_dev *dev) dev->n_tnodes = 0; } -void yaffs_load_tnode_0(struct yaffs_dev *dev, struct yaffs_tnode *tn, +static void yaffs_load_tnode_0(struct yaffs_dev *dev, struct yaffs_tnode *tn, unsigned pos, unsigned val) { u32 *map = (u32 *) tn; @@ -1926,7 +1901,7 @@ struct yaffs_obj *yaffs_find_by_number(struct yaffs_dev *dev, u32 number) return NULL; } -struct yaffs_obj *yaffs_new_obj(struct yaffs_dev *dev, int number, +static struct yaffs_obj *yaffs_new_obj(struct yaffs_dev *dev, int number, enum yaffs_obj_type type) { struct yaffs_obj *the_obj = NULL; @@ -3860,7 +3835,7 @@ static int yaffs_unlink_file_if_needed(struct yaffs_obj *in) return ret_val; } -int yaffs_del_file(struct yaffs_obj *in) +static int yaffs_del_file(struct yaffs_obj *in) { int ret_val = YAFFS_OK; int deleted; /* Need to cache value on stack if in is freed */ diff --git a/yaffs_tagscompat.c b/yaffs_tagscompat.c index 9ac5896..32ba11f 100644 --- a/yaffs_tagscompat.c +++ b/yaffs_tagscompat.c @@ -22,7 +22,7 @@ static void yaffs_handle_rd_data_error(struct yaffs_dev *dev, int nand_chunk); /********** Tags ECC calculations *********/ -void yaffs_calc_ecc(const u8 *data, struct yaffs_spare *spare) +static void yaffs_calc_ecc(const u8 *data, struct yaffs_spare *spare) { yaffs_ecc_calc(data, spare->ecc1); yaffs_ecc_calc(&data[256], spare->ecc2);