fixwarning.diff 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398
  1. diff --git a/dfs_yaffs2.c b/dfs_yaffs2.c
  2. index 4b056ae..e63d5d4 100644
  3. --- a/dfs_yaffs2.c
  4. +++ b/dfs_yaffs2.c
  5. @@ -39,7 +39,6 @@ static int dfs_yaffs_mount(struct dfs_filesystem* fs,
  6. const void* data)
  7. {
  8. unsigned index;
  9. - ynandif_Geometry *g;
  10. /*1. find a empty entry in partition table */
  11. for (index = 0; index < NAND_DEVICE_PART_MAX ; index ++)
  12. diff --git a/yaffs/direct/yaffsfs.c b/yaffs/direct/yaffsfs.c
  13. index 17fc502..1f47ea7 100644
  14. --- a/yaffs/direct/yaffsfs.c
  15. +++ b/yaffs/direct/yaffsfs.c
  16. @@ -1367,7 +1367,7 @@ off_t yaffs_lseek(int handle, off_t offset, int whence)
  17. if(offset >= 0)
  18. pos = offset;
  19. } else if(whence == SEEK_CUR) {
  20. - if( (fd->position + offset) >= 0)
  21. + if( ((int)fd->position + offset) >= 0)
  22. pos = (fd->position + offset);
  23. } else if(whence == SEEK_END) {
  24. fSize = yaffs_get_obj_length(obj);
  25. diff --git a/yaffs/direct/yportenv.h b/yaffs/direct/yportenv.h
  26. index f693c16..ac0a737 100644
  27. --- a/yaffs/direct/yportenv.h
  28. +++ b/yaffs/direct/yportenv.h
  29. @@ -45,7 +45,7 @@
  30. #endif
  31. #ifndef loff_t
  32. - typedef unsigned long loff_t;
  33. + typedef long loff_t;
  34. #endif
  35. #ifndef dev_t
  36. @@ -66,7 +66,7 @@
  37. #elif defined (__GNUC__) && !defined(__CC_ARM)
  38. #ifndef loff_t
  39. - typedef unsigned long loff_t;
  40. + typedef long loff_t;
  41. #endif
  42. #ifndef dev_t
  43. diff --git a/yaffs/yaffs_guts.c b/yaffs/yaffs_guts.c
  44. index d72aa5b..08db8c8 100644
  45. --- a/yaffs/yaffs_guts.c
  46. +++ b/yaffs/yaffs_guts.c
  47. @@ -280,7 +280,7 @@ static void yaffs_handle_chunk_wr_error(struct yaffs_dev *dev, int nand_chunk,
  48. static inline int yaffs_hash_fn(int n)
  49. {
  50. - n = abs(n);
  51. + n = n > 0 ? n : -n;
  52. return n % YAFFS_NOBJECT_BUCKETS;
  53. }
  54. @@ -319,9 +319,9 @@ static int yaffs_check_chunk_erased(struct yaffs_dev *dev, int nand_chunk)
  55. int retval = YAFFS_OK;
  56. u8 *data = yaffs_get_temp_buffer(dev);
  57. struct yaffs_ext_tags tags;
  58. - int result;
  59. - result = yaffs_rd_chunk_tags_nand(dev, nand_chunk, data, &tags);
  60. +
  61. + yaffs_rd_chunk_tags_nand(dev, nand_chunk, data, &tags);
  62. if (tags.ecc_result > YAFFS_ECC_RESULT_NO_ERROR)
  63. retval = YAFFS_FAIL;
  64. @@ -347,9 +347,9 @@ static int yaffs_verify_chunk_written(struct yaffs_dev *dev,
  65. int retval = YAFFS_OK;
  66. struct yaffs_ext_tags temp_tags;
  67. u8 *buffer = yaffs_get_temp_buffer(dev);
  68. - int result;
  69. - result = yaffs_rd_chunk_tags_nand(dev, nand_chunk, buffer, &temp_tags);
  70. +
  71. + yaffs_rd_chunk_tags_nand(dev, nand_chunk, buffer, &temp_tags);
  72. if (memcmp(buffer, data, dev->data_bytes_per_chunk) ||
  73. temp_tags.obj_id != tags->obj_id ||
  74. temp_tags.chunk_id != tags->chunk_id ||
  75. @@ -1478,7 +1478,7 @@ static struct yaffs_cache *yaffs_grab_chunk_cache(struct yaffs_dev *dev)
  76. struct yaffs_obj *the_obj;
  77. int usage;
  78. int i;
  79. - int pushout;
  80. + /* int pushout; */
  81. if (dev->param.n_caches < 1)
  82. return NULL;
  83. @@ -1499,7 +1499,7 @@ static struct yaffs_cache *yaffs_grab_chunk_cache(struct yaffs_dev *dev)
  84. the_obj = dev->cache[0].object;
  85. usage = -1;
  86. cache = NULL;
  87. - pushout = -1;
  88. + /* pushout = -1; */
  89. for (i = 0; i < dev->param.n_caches; i++) {
  90. if (dev->cache[i].object &&
  91. @@ -1509,7 +1509,7 @@ static struct yaffs_cache *yaffs_grab_chunk_cache(struct yaffs_dev *dev)
  92. usage = dev->cache[i].last_use;
  93. the_obj = dev->cache[i].object;
  94. cache = &dev->cache[i];
  95. - pushout = i;
  96. + /* pushout = i; */
  97. }
  98. }
  99. @@ -3167,7 +3167,7 @@ static void yaffs_check_obj_details_loaded(struct yaffs_obj *in)
  100. struct yaffs_obj_hdr *oh;
  101. struct yaffs_dev *dev;
  102. struct yaffs_ext_tags tags;
  103. - int result;
  104. +
  105. int alloc_failed = 0;
  106. if (!in || !in->lazy_loaded || in->hdr_chunk < 1)
  107. @@ -3177,7 +3177,7 @@ static void yaffs_check_obj_details_loaded(struct yaffs_obj *in)
  108. in->lazy_loaded = 0;
  109. buf = yaffs_get_temp_buffer(dev);
  110. - result = yaffs_rd_chunk_tags_nand(dev, in->hdr_chunk, buf, &tags);
  111. + yaffs_rd_chunk_tags_nand(dev, in->hdr_chunk, buf, &tags);
  112. oh = (struct yaffs_obj_hdr *)buf;
  113. in->yst_mode = oh->yst_mode;
  114. @@ -3189,6 +3189,7 @@ static void yaffs_check_obj_details_loaded(struct yaffs_obj *in)
  115. yaffs_clone_str(oh->alias);
  116. if (!in->variant.symlink_variant.alias)
  117. alloc_failed = 1; /* Not returned */
  118. + alloc_failed = alloc_failed;
  119. }
  120. yaffs_release_temp_buffer(dev, buf);
  121. }
  122. @@ -3274,7 +3275,7 @@ int yaffs_update_oh(struct yaffs_obj *in, const YCHAR *name, int force,
  123. struct yaffs_dev *dev = in->my_dev;
  124. int prev_chunk_id;
  125. int ret_val = 0;
  126. - int result = 0;
  127. +
  128. int new_chunk_id;
  129. struct yaffs_ext_tags new_tags;
  130. struct yaffs_ext_tags old_tags;
  131. @@ -3297,7 +3298,7 @@ int yaffs_update_oh(struct yaffs_obj *in, const YCHAR *name, int force,
  132. prev_chunk_id = in->hdr_chunk;
  133. if (prev_chunk_id > 0) {
  134. - result = yaffs_rd_chunk_tags_nand(dev, prev_chunk_id,
  135. + yaffs_rd_chunk_tags_nand(dev, prev_chunk_id,
  136. buffer, &old_tags);
  137. yaffs_verify_oh(in, oh, &old_tags, 0);
  138. @@ -3921,7 +3922,7 @@ int yaffs_del_obj(struct yaffs_obj *obj)
  139. list_del_init(&obj->variant.dir_variant.dirty);
  140. }
  141. return yaffs_del_dir(obj);
  142. - break;
  143. + //break;
  144. case YAFFS_OBJECT_TYPE_SYMLINK:
  145. ret_val = yaffs_del_symlink(obj);
  146. break;
  147. @@ -3993,17 +3994,17 @@ static int yaffs_unlink_worker(struct yaffs_obj *obj)
  148. switch (obj->variant_type) {
  149. case YAFFS_OBJECT_TYPE_FILE:
  150. return yaffs_del_file(obj);
  151. - break;
  152. + //break;
  153. case YAFFS_OBJECT_TYPE_DIRECTORY:
  154. list_del_init(&obj->variant.dir_variant.dirty);
  155. return yaffs_del_dir(obj);
  156. - break;
  157. + //break;
  158. case YAFFS_OBJECT_TYPE_SYMLINK:
  159. return yaffs_del_symlink(obj);
  160. - break;
  161. + //break;
  162. case YAFFS_OBJECT_TYPE_SPECIAL:
  163. return yaffs_generic_obj_del(obj);
  164. - break;
  165. + //break;
  166. case YAFFS_OBJECT_TYPE_HARDLINK:
  167. case YAFFS_OBJECT_TYPE_UNKNOWN:
  168. default:
  169. @@ -4421,7 +4422,7 @@ int yaffs_get_obj_name(struct yaffs_obj *obj, YCHAR *name, int buffer_size)
  170. } else if (obj->short_name[0]) {
  171. strcpy(name, obj->short_name);
  172. } else if (obj->hdr_chunk > 0) {
  173. - int result;
  174. +
  175. u8 *buffer = yaffs_get_temp_buffer(obj->my_dev);
  176. struct yaffs_obj_hdr *oh = (struct yaffs_obj_hdr *)buffer;
  177. @@ -4429,7 +4430,7 @@ int yaffs_get_obj_name(struct yaffs_obj *obj, YCHAR *name, int buffer_size)
  178. memset(buffer, 0, obj->my_dev->data_bytes_per_chunk);
  179. if (obj->hdr_chunk > 0) {
  180. - result = yaffs_rd_chunk_tags_nand(obj->my_dev,
  181. + yaffs_rd_chunk_tags_nand(obj->my_dev,
  182. obj->hdr_chunk,
  183. buffer, NULL);
  184. }
  185. @@ -4490,16 +4491,16 @@ unsigned yaffs_get_obj_type(struct yaffs_obj *obj)
  186. switch (obj->variant_type) {
  187. case YAFFS_OBJECT_TYPE_FILE:
  188. return DT_REG;
  189. - break;
  190. + //break;
  191. case YAFFS_OBJECT_TYPE_DIRECTORY:
  192. return DT_DIR;
  193. - break;
  194. + //break;
  195. case YAFFS_OBJECT_TYPE_SYMLINK:
  196. return DT_LNK;
  197. - break;
  198. + //break;
  199. case YAFFS_OBJECT_TYPE_HARDLINK:
  200. return DT_REG;
  201. - break;
  202. + //break;
  203. case YAFFS_OBJECT_TYPE_SPECIAL:
  204. if (S_ISFIFO(obj->yst_mode))
  205. return DT_FIFO;
  206. @@ -4510,10 +4511,10 @@ unsigned yaffs_get_obj_type(struct yaffs_obj *obj)
  207. if (S_ISSOCK(obj->yst_mode))
  208. return DT_SOCK;
  209. return DT_REG;
  210. - break;
  211. + //break;
  212. default:
  213. return DT_REG;
  214. - break;
  215. + //break;
  216. }
  217. }
  218. @@ -4837,7 +4838,7 @@ int yaffs_guts_initialise(struct yaffs_dev *dev)
  219. dev->n_erased_blocks = 0;
  220. dev->n_free_chunks = 0;
  221. dev->alloc_block = -1;
  222. - dev->alloc_page = -1;
  223. + dev->alloc_page = (u32)(-1);
  224. dev->n_deleted_files = 0;
  225. dev->n_unlinked_files = 0;
  226. dev->n_bg_deletions = 0;
  227. diff --git a/yaffs/yaffs_packedtags2.c b/yaffs/yaffs_packedtags2.c
  228. index 820bc41..9306623 100644
  229. --- a/yaffs/yaffs_packedtags2.c
  230. +++ b/yaffs/yaffs_packedtags2.c
  231. @@ -35,7 +35,7 @@
  232. /* Also, the top 4 bits of the object Id are set to the object type. */
  233. #define EXTRA_OBJECT_TYPE_SHIFT (28)
  234. -#define EXTRA_OBJECT_TYPE_MASK ((0x0f) << EXTRA_OBJECT_TYPE_SHIFT)
  235. +#define EXTRA_OBJECT_TYPE_MASK ((0x0fUL) << EXTRA_OBJECT_TYPE_SHIFT)
  236. static void yaffs_dump_packed_tags2_tags_only(
  237. const struct yaffs_packed_tags2_tags_only *ptt)
  238. @@ -129,7 +129,7 @@ void yaffs_unpack_tags2_tags_only(struct yaffs_ext_tags *t,
  239. t->extra_parent_id = ptt->chunk_id & (~(ALL_EXTRA_FLAGS));
  240. t->extra_is_shrink = ptt->chunk_id & EXTRA_SHRINK_FLAG ? 1 : 0;
  241. t->extra_shadows = ptt->chunk_id & EXTRA_SHADOWS_FLAG ? 1 : 0;
  242. - t->extra_obj_type = ptt->obj_id >> EXTRA_OBJECT_TYPE_SHIFT;
  243. + t->extra_obj_type = (enum yaffs_obj_type)(ptt->obj_id >> EXTRA_OBJECT_TYPE_SHIFT);
  244. t->obj_id &= ~EXTRA_OBJECT_TYPE_MASK;
  245. if (t->extra_obj_type == YAFFS_OBJECT_TYPE_HARDLINK)
  246. diff --git a/yaffs/yaffs_verify.c b/yaffs/yaffs_verify.c
  247. index b3e540d..1758125 100644
  248. --- a/yaffs/yaffs_verify.c
  249. +++ b/yaffs/yaffs_verify.c
  250. @@ -223,7 +223,7 @@ void yaffs_verify_oh(struct yaffs_obj *obj, struct yaffs_obj_hdr *oh,
  251. void yaffs_verify_file(struct yaffs_obj *obj)
  252. {
  253. int required_depth;
  254. - int actual_depth;
  255. + //int actual_depth;
  256. u32 last_chunk;
  257. u32 the_chunk;
  258. u32 x;
  259. @@ -252,7 +252,7 @@ void yaffs_verify_file(struct yaffs_obj *obj)
  260. required_depth++;
  261. }
  262. - actual_depth = obj->variant.file_variant.top_level;
  263. + //actual_depth = obj->variant.file_variant.top_level;
  264. /* Check that the chunks in the tnode tree are all correct.
  265. * We do this by scanning through the tnode tree and
  266. diff --git a/yaffs/yaffs_yaffs1.c b/yaffs/yaffs_yaffs1.c
  267. index da6a40f..8e7f4b2 100644
  268. --- a/yaffs/yaffs_yaffs1.c
  269. +++ b/yaffs/yaffs_yaffs1.c
  270. @@ -23,7 +23,7 @@ int yaffs1_scan(struct yaffs_dev *dev)
  271. {
  272. struct yaffs_ext_tags tags;
  273. int blk;
  274. - int result;
  275. + //int result;
  276. int chunk;
  277. int c;
  278. int deleted;
  279. @@ -84,7 +84,7 @@ int yaffs1_scan(struct yaffs_dev *dev)
  280. cond_resched();
  281. bi = yaffs_get_block_info(dev, blk);
  282. - state = bi->block_state;
  283. + state = (enum yaffs_block_state)(bi->block_state);
  284. deleted = 0;
  285. @@ -95,7 +95,7 @@ int yaffs1_scan(struct yaffs_dev *dev)
  286. /* Read the tags and decide what to do */
  287. chunk = blk * dev->param.chunks_per_block + c;
  288. - result = yaffs_rd_chunk_tags_nand(dev, chunk, NULL,
  289. + yaffs_rd_chunk_tags_nand(dev, chunk, NULL,
  290. &tags);
  291. /* Let's have a good look at this chunk... */
  292. @@ -181,7 +181,7 @@ int yaffs1_scan(struct yaffs_dev *dev)
  293. yaffs_set_chunk_bit(dev, blk, c);
  294. bi->pages_in_use++;
  295. - result = yaffs_rd_chunk_tags_nand(dev, chunk,
  296. + yaffs_rd_chunk_tags_nand(dev, chunk,
  297. chunk_data,
  298. NULL);
  299. diff --git a/yaffs/yaffs_yaffs2.c b/yaffs/yaffs_yaffs2.c
  300. index 5761e96..69acd20 100644
  301. --- a/yaffs/yaffs_yaffs2.c
  302. +++ b/yaffs/yaffs_yaffs2.c
  303. @@ -946,7 +946,7 @@ static inline int yaffs2_scan_chunk(struct yaffs_dev *dev,
  304. int is_shrink;
  305. int is_unlinked;
  306. struct yaffs_ext_tags tags;
  307. - int result;
  308. + //int result;
  309. int alloc_failed = 0;
  310. int chunk = blk * dev->param.chunks_per_block + chunk_in_block;
  311. struct yaffs_file_var *file_var;
  312. @@ -954,12 +954,12 @@ static inline int yaffs2_scan_chunk(struct yaffs_dev *dev,
  313. struct yaffs_symlink_var *sl_var;
  314. if (summary_available) {
  315. - result = yaffs_summary_fetch(dev, &tags, chunk_in_block);
  316. + yaffs_summary_fetch(dev, &tags, chunk_in_block);
  317. tags.seq_number = bi->seq_number;
  318. }
  319. if (!summary_available || tags.obj_id == 0) {
  320. - result = yaffs_rd_chunk_tags_nand(dev, chunk, NULL, &tags);
  321. + yaffs_rd_chunk_tags_nand(dev, chunk, NULL, &tags);
  322. dev->tags_used++;
  323. } else {
  324. dev->summary_used++;
  325. @@ -1114,7 +1114,7 @@ static inline int yaffs2_scan_chunk(struct yaffs_dev *dev,
  326. * invalid data until needed.
  327. */
  328. - result = yaffs_rd_chunk_tags_nand(dev,
  329. + yaffs_rd_chunk_tags_nand(dev,
  330. chunk,
  331. chunk_data,
  332. NULL);
  333. @@ -1349,7 +1349,7 @@ int yaffs2_scan_backwards(struct yaffs_dev *dev)
  334. int n_to_scan = 0;
  335. enum yaffs_block_state state;
  336. int c;
  337. - int deleted;
  338. + //int deleted;
  339. LIST_HEAD(hard_list);
  340. struct yaffs_block_info *bi;
  341. u32 seq_number;
  342. @@ -1467,7 +1467,7 @@ int yaffs2_scan_backwards(struct yaffs_dev *dev)
  343. /* get the block to scan in the correct order */
  344. blk = block_index[block_iter].block;
  345. bi = yaffs_get_block_info(dev, blk);
  346. - deleted = 0;
  347. + //deleted = 0;
  348. summary_available = yaffs_summary_read(dev, dev->sum_tags, blk);
  349. diff --git a/yaffs_osglue.c b/yaffs_osglue.c
  350. index 2c34f99..4f2e5db 100644
  351. --- a/yaffs_osglue.c
  352. +++ b/yaffs_osglue.c
  353. @@ -58,7 +58,6 @@ void yaffsfs_LockInit(void)
  354. #else
  355. static rt_mutex_t mutex = RT_NULL;
  356. -static rt_sem_t sem = RT_NULL;
  357. void yaffsfs_Lock(void)
  358. {
  359. rt_mutex_take(mutex, RT_WAITING_FOREVER);