Discover which code snippets in open source project is need to be fixed.
We have provided a tool to collect code snippets with FIXME comments and upload them here.
See more * to just write CCERRCLR with CCERR value...
563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 | for (i = 0; i < 8; i++) {
if (edma_read(ctlr, EDMA_CCERR) & BIT(i)) {
/* Clear the corresponding IPR bits */
edma_write(ctlr, EDMA_CCERRCLR, BIT(i));
/* NOTE: not reported!! */
}
}
}
if ((edma_read_array(ctlr, EDMA_EMR, 0) == 0) &&
(edma_read_array(ctlr, EDMA_EMR, 1) == 0) &&
(edma_read(ctlr, EDMA_QEMR) == 0) &&
(edma_read(ctlr, EDMA_CCERR) == 0))
break;
cnt++;
if (cnt > 10)
|
expected to support all sample rates. When lower sample rate used, no audio input.
420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 | if (AUDIO_BUS_MODE_MASTER == para->bus_mode) {
val = BM_ESAI_TCCR_THCKD | //HCKT is output (bit23=1)
BM_ESAI_TCCR_TFSD | //FST is output (bit22=1)
BM_ESAI_TCCR_TCKD | //SCKT is output (bit21=1)
BM_ESAI_TCCR_TCKP | //tX clock polarity bit 18, clock out on falling edge
ESAI_TCCR_TDC(para->channel_number - 1); //frame rate devider
if (SAMPLERATE_44_1KHz == para->sample_rate) {
/*
* So the Tx_CLK = Fsys/2/((TPM+1) + (TFP+1)) = 133/2/(6*4) = 2.771MHz.
* the HCKT = Fsys/2/((TPM+1) = 133/2/6 = 11.08MHz.
* The Tx_CLK is not very accurate for 44.1K sample rate(2.822MHz).
*/
val |= ESAI_TCCR_TFP(3) | // clk div 4
ESAI_TCCR_TPSR_BYPASS | //bypass
ESAI_TCCR_TPM(5);
} else if(SAMPLERATE_16KHz == para->sample_rate){
|
unicode
436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 | ekbd.unicode = 0;
/* send event to server */
rtgui_server_post_event(&ekbd.parent, sizeof(struct rtgui_event_kbd));
}
break;
case SDL_QUIT:
SDL_Quit();
quit = 1;
break;
default:
break;
}
|
unicode
418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 | ekbd.unicode = 0;
/* send event to server */
rtgui_server_post_event(&ekbd.parent, sizeof(struct rtgui_event_kbd));
}
break;
case SDL_KEYDOWN:
{
struct rtgui_event_kbd ekbd;
ekbd.parent.type = RTGUI_EVENT_KBD;
ekbd.parent.sender = RT_NULL;
ekbd.type = RTGUI_KEYDOWN;
ekbd.wid = RT_NULL;
ekbd.mod = event.key.keysym.mod;
ekbd.key = event.key.keysym.sym;
|
177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 | memset((void*)VMM_BEGIN, 0, VMM_SIZE);
flp = filp_open(filename, O_RDONLY, S_IRWXU);
if (IS_ERR(flp))
{
printk("vmm loader: open file failed. "
"Return 0x%p\n", flp);
return -1;
}
/* get file size */
file_sz = vfs_llseek(flp, 0, SEEK_END);
vfs_llseek(flp, 0, SEEK_SET);
oldfs = get_fs();
set_fs(get_ds());
|
size. It can be omitted if it is known that the data cache has no dirty data.
82 83 84 85 86 87 88 89 90 91 92 93 94 | __asm(" MRC p15, #0, r1, c1, c0, #0 ; Read SCTLR configuration data");
__asm(" BIC r1, r1, #0x1 <<2");
__asm(" DSB");
__asm(" MCR p15, #0, r1, c1, c0, #0 ; disabled data cache");
}
#elif __GNUC__
int __rt_ffs(int value)
{
return __builtin_ffs(value);
}
#endif
/*@}*/
|
interrupts come, this can be misleading.
280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 | #if 0
if (_vmm_context->virq_pended)
{
vmm_info("=================================\n");
vmm_info("VMM WARING: VIRQ pended in user mode\n");
dump_vmm = 1;
}
#endif
}
else if ((cpsr & MODEMASK) == SVCMODE && sp->pc < 0xbf000000)
{
vmm_info("=================================\n");
vmm_info("VMM WARING: executing usr code in svc mode\n");
dump_vmm = 1;
}
}
|
Deal with it - check crc32, check for duplicate node, check times and discard the older one
753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 | up(&f->sem);
jffs2_do_clear_inode(c, f);
return -EIO;
}
/* OK. We're happy */
f->metadata = frag_first(&f->fragtree)->node;
jffs2_free_node_frag(frag_first(&f->fragtree));
f->fragtree.rb_node = NULL;//f->fragtree = RB_ROOT; // modify it for vs
break;
}
if (f->inocache->state == INO_STATE_READING)
jffs2_set_inocache_state(c, f->inocache, INO_STATE_PRESENT);
return 0;
}
|
If this fails, there seems to be a memory leak. Find it.
662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 | up(&f->sem);
jffs2_do_clear_inode(c, f);
return ret?ret:-EIO;
}
crc = crc32(0, latest_node, sizeof(*latest_node)-8);
if (crc != je32_to_cpu(latest_node->node_crc)) {
JFFS2_ERROR("CRC failed for read_inode of inode %u at physical location 0x%x\n",
f->inocache->ino, ref_offset(fn->raw));
up(&f->sem);
jffs2_do_clear_inode(c, f);
return -EIO;
}
switch(jemode_to_cpu(latest_node->mode) & S_IFMT) {
case S_IFDIR:
|
point()
460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 | err = jffs2_flash_read(c, (ref_offset(ref)),
min_t(uint32_t, ref_totlen(c, NULL, ref), sizeof(node)),
&retlen, (void *)&node);
if (err) {
JFFS2_ERROR("error %d reading node at 0x%08x in get_inode_nodes()\n", err, ref_offset(ref));
goto free_out;
}
switch (je16_to_cpu(node.u.nodetype)) {
case JFFS2_NODETYPE_DIRENT:
JFFS2_DBG_READINODE("node at %08x (%d) is a dirent node\n", ref_offset(ref), ref_flags(ref));
if (retlen < sizeof(node.d)) {
JFFS2_ERROR("short read dirent at %#08x\n", ref_offset(ref));
err = -EIO;
|