Rockbox open source high quality audio player as a Music Player Daemon
mpris rockbox mpd libadwaita audio rust zig deno
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

Some Nano2G FTL cosmetics

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27851 a1c6a512-1295-4272-9138-f99709370657

+22 -21
+22 -21
firmware/target/arm/s5l8700/ipodnano2g/ftl-nano2g.c
··· 464 464 if (page == 0) return 1; 465 465 pagebase = page & ~(ftl_nand_type->pagesperblock - 1); 466 466 if ((nand_read_page(bank, page, ftl_buffer, 467 - (uint32_t*)0, 1, 0) & 0x11F) != 0) return 1; 467 + NULL, 1, 0) & 0x11F) != 0) return 1; 468 468 if (memcmp(&ftl_buffer[0x18], "BBT", 4) != 0) return 1; 469 469 unk1 = ((uint16_t*)ftl_buffer)[0x10]; 470 470 unk2 = ((uint16_t*)ftl_buffer)[0x11]; ··· 478 478 if (page2 >= (uint32_t)(ftl_nand_type->pagesperblock - 8)) 479 479 break; 480 480 if ((nand_read_page(bank, pagebase + page2, ftl_buffer, 481 - (void*)0, 1, 0) & 0x11F) == 0) 481 + NULL, 1, 0) & 0x11F) == 0) 482 482 { 483 483 memcpy(bbt, ftl_buffer, 0x410); 484 484 return 0; ··· 609 609 static struct ftl_vfl_cxt_type* ftl_vfl_get_newest_cxt(void) 610 610 { 611 611 uint32_t i, maxusn; 612 - struct ftl_vfl_cxt_type* cxt = (struct ftl_vfl_cxt_type*)0; 612 + struct ftl_vfl_cxt_type* cxt = NULL; 613 613 maxusn = 0; 614 614 for (i = 0; i < ftl_banks; i++) 615 615 if (ftl_vfl_cxt[i].usn >= maxusn) ··· 896 896 { 897 897 for (i = 0; i < ftl_banks; i++) 898 898 { 899 - void* databuf = (void*)0; 900 - void* sparebuf = (void*)0; 899 + void* databuf = NULL; 900 + void* sparebuf = NULL; 901 901 if (buffer) databuf = (void*)((uint32_t)buffer + 0x800 * i); 902 902 if (sparebuffer) sparebuf = (void*)((uint32_t)sparebuffer + 0x40 * i); 903 903 uint32_t ret = ftl_vfl_read(vpage + i, databuf, sparebuf, checkempty, remaponfail); ··· 1171 1171 return 1; 1172 1172 } 1173 1173 1174 + DEBUGF("FTL: Successfully read FTL context block\n"); 1174 1175 uint32_t pagestoread = ftl_nand_type->userblocks >> 10; 1175 1176 if ((ftl_nand_type->userblocks & 0x1FF) != 0) pagestoread++; 1176 1177 ··· 1253 1254 total += ftl_erasectr[i]; 1254 1255 } 1255 1256 DEBUGF("FTL: Erase counters: Minimum: %d, maximum %d, average: %d, total: %d\n", 1256 - min, max, total / ((*ftl_nand_type).userblocks + 23), total); 1257 + min, max, total / (ftl_nand_type->userblocks + 23), total); 1257 1258 #endif 1258 1259 #endif 1259 1260 ··· 1272 1273 if (ftl_log[i].scatteredvblock == 0xFFFF) continue; 1273 1274 if (ftl_log[i].logicalvblock == block) return &ftl_log[i]; 1274 1275 } 1275 - return (struct ftl_log_type*)0; 1276 + return NULL; 1276 1277 } 1277 1278 #endif 1278 1279 ··· 1304 1305 uint32_t abspage = ftl_map[block] * ppb + page; 1305 1306 #ifndef FTL_READONLY 1306 1307 struct ftl_log_type* logentry = ftl_get_log_entry(block); 1307 - if (logentry != (struct ftl_log_type*)0) 1308 + if (logentry != NULL) 1308 1309 { 1309 1310 #ifdef FTL_TRACE 1310 1311 DEBUGF("FTL: Block %d has a log entry\n", block); ··· 1324 1325 1325 1326 #ifndef FTL_READONLY 1326 1327 if (count >= i + ftl_banks && !(page & (ftl_banks - 1)) 1327 - && logentry == (struct ftl_log_type*)0) 1328 + && logentry == NULL) 1328 1329 #else 1329 1330 if (count >= i + ftl_banks && !(page & (ftl_banks - 1))) 1330 1331 #endif ··· 1437 1438 bestidx = idx; 1438 1439 } 1439 1440 } 1440 - if (bestidx == 0xFFFFFFFF) panicf("Out of pool blocks!"); 1441 + if (bestidx == 0xFFFFFFFF) panicf("FTL: Out of pool blocks!"); 1441 1442 block = ftl_cxt.blockpool[bestidx]; 1442 1443 if (bestidx != ftl_cxt.nextfreeidx) 1443 1444 { ··· 1763 1764 uint32_t i; 1764 1765 uint32_t ppb = ftl_nand_type->pagesperblock * ftl_banks; 1765 1766 uint32_t age = 0xFFFFFFFF, used = 0; 1766 - if (entry == (struct ftl_log_type*)0) 1767 + if (entry == NULL) 1767 1768 { 1768 1769 for (i = 0; i < 0x11; i++) 1769 1770 { ··· 1778 1779 entry = &ftl_log[i]; 1779 1780 } 1780 1781 } 1781 - if (entry == (struct ftl_log_type*)0) return 1; 1782 + if (entry == NULL) return 1; 1782 1783 } 1783 1784 else if (entry->pagescurrent < ppb / 2) 1784 1785 { ··· 1811 1812 { 1812 1813 uint32_t i; 1813 1814 struct ftl_log_type* entry = ftl_get_log_entry(block); 1814 - if (entry != (struct ftl_log_type*)0) 1815 + if (entry != NULL) 1815 1816 { 1816 1817 entry->usn = ftl_cxt.nextblockusn - 1; 1817 1818 return entry; ··· 1827 1828 } 1828 1829 } 1829 1830 1830 - if (entry == (struct ftl_log_type*)0) 1831 + if (entry == NULL) 1831 1832 { 1832 1833 if (ftl_cxt.freecount < 3) panicf("FTL: Detected a pool block leak!"); 1833 1834 else if (ftl_cxt.freecount == 3) 1834 - if (ftl_remove_scattered_block((struct ftl_log_type*)0) != 0) 1835 - return (struct ftl_log_type*)0; 1835 + if (ftl_remove_scattered_block(NULL) != 0) 1836 + return NULL; 1836 1837 entry = ftl_log; 1837 1838 while (entry->scatteredvblock != 0xFFFF) entry = &entry[1]; 1838 1839 entry->scatteredvblock = ftl_allocate_pool_block(); 1839 1840 if (entry->scatteredvblock == 0xFFFF) 1840 - return (struct ftl_log_type*)0; 1841 + return NULL; 1841 1842 } 1842 1843 1843 1844 ftl_init_log_entry(entry); ··· 1915 1916 for (i = 0; i < ftl_nand_type->userblocks; i++) 1916 1917 { 1917 1918 if (ftl_erasectr[ftl_map[i]] > max) max = ftl_erasectr[ftl_map[i]]; 1918 - if (ftl_get_log_entry(i) != (struct ftl_log_type*)0) continue; 1919 + if (ftl_get_log_entry(i) != NULL) continue; 1919 1920 if (ftl_erasectr[ftl_map[i]] < min) 1920 1921 { 1921 1922 minidx = i; ··· 1987 1988 uint32_t page = (sector + i) % ppb; 1988 1989 1989 1990 struct ftl_log_type* logentry = ftl_allocate_log_entry(block); 1990 - if (logentry == (struct ftl_log_type*)0) 1991 + if (logentry == NULL) 1991 1992 { 1992 1993 mutex_unlock(&ftl_mtx); 1993 1994 return -5; ··· 2048 2049 #endif 2049 2050 ftl_remove_scattered_block(logentry); 2050 2051 logentry = ftl_allocate_log_entry(block); 2051 - if (logentry == (struct ftl_log_type*)0) 2052 + if (logentry == NULL) 2052 2053 { 2053 2054 mutex_unlock(&ftl_mtx); 2054 2055 return -7; ··· 2180 2181 blockwiped = 1; 2181 2182 for (i = 0; i < ftl_nand_type->pagesperblock; i++) 2182 2183 { 2183 - result = nand_read_page(0, i, ftl_buffer, (uint32_t*)0, 1, 1); 2184 + result = nand_read_page(0, i, ftl_buffer, NULL, 1, 1); 2184 2185 if ((result & 0x11F) == 0) 2185 2186 { 2186 2187 blockwiped = 0;