Fix checkpatch warnings

This commit is contained in:
Hugo Villeneuve
2014-02-12 23:16:18 -05:00
parent ba0e6b3b86
commit 8bfc53036a
4 changed files with 21 additions and 19 deletions

View File

@@ -32,7 +32,7 @@ main(int argc, char **argv)
if (options.filename != NULL) {
rc = hexfile_load(options.filename);
if (rc == false)
if (!rc)
exit(1);
}

View File

@@ -173,7 +173,8 @@ cpu8051_interrupt_fire(int interrupt_no, int priority)
static int
cpu8051_interrupt_enabled(int interrupt_no)
{
return (memory_read_direct(_IE_) & INTERRUPT_MASK(interrupt_no)) ? 1 : 0;
return (memory_read_direct(_IE_) & INTERRUPT_MASK(interrupt_no)) ?
1 : 0;
}
static void
@@ -200,8 +201,9 @@ cpu8051_check_interrupts(void)
if (cpu8051_interrupt_enabled(INTERRUPT_1) &&
cpu8051_interrupt_fire(INTERRUPT_1, i) &&
(memory_read_direct(_TCON_) & 0x20)) {
memory_write_direct(_TCON_,
memory_read_direct(_TCON_) & 0xDF);
memory_write_direct(
_TCON_,
memory_read_direct(_TCON_) & 0xDF);
cpu8051_process_interrupt(0x0B, i);
return;
}
@@ -209,8 +211,9 @@ cpu8051_check_interrupts(void)
if (cpu8051_interrupt_enabled(INTERRUPT_3) &&
cpu8051_interrupt_fire(INTERRUPT_3, i) &&
(memory_read_direct(_TCON_) & 0x80)) {
memory_write_direct(_TCON_,
memory_read_direct(_TCON_) & 0x7F);
memory_write_direct(
_TCON_,
memory_read_direct(_TCON_) & 0x7F);
cpu8051_process_interrupt(0x1B, i);
return;
}

View File

@@ -834,17 +834,13 @@ print INST_DEF "\n";
print INST_DEF "/* Exported variables. */\n";
print INST_DEF "#ifdef INSTRUCTIONS_8051_M\n";
print INST_DEF "OPCODE_FP opcode_table[256] = {\n";
for( $i=0; $i<256; $i++ ) {
$ifunc=substr($instfunction[$i], 9);
if( $i < 255 ) {
print INST_DEF " cpu8051_$ifunc,\n";
}
else {
print INST_DEF " cpu8051_$ifunc\n";
print INST_DEF "};\n";
}
}
for ($i = 0; $i < 256; $i++) {
$ifunc = substr($instfunction[$i], 9);
print INST_DEF "\tcpu8051_$ifunc,\n";
}
print INST_DEF "};\n";
print INST_DEF "#else\n";
print INST_DEF "OPCODE_FP opcode_table[256];\n";
print INST_DEF "#endif\n\n\n";

View File

@@ -59,7 +59,8 @@ timer_increment_check_overflow(uint8_t counter_address, uint8_t tf_mask)
tmp &= 0xFF;
if (tmp == 0) {
/* If overflow set TFx */
memory_write_direct(_TCON_, memory_read_direct(_TCON_) | tf_mask);
memory_write_direct(_TCON_,
memory_read_direct(_TCON_) | tf_mask);
}
memory_write_direct(counter_address, tmp); /* Save new value. */
@@ -103,7 +104,9 @@ process_timer(uint8_t tl, uint8_t th, uint8_t tf_mask, uint8_t TR, uint8_t mode,
tmp &= 0xFF;
if (tmp == 0) {
/* If overflow -> reload and set TF0 */
memory_write_direct(_TCON_, memory_read_direct(_TCON_) | tf_mask);
memory_write_direct(
_TCON_,
memory_read_direct(_TCON_) | tf_mask);
memory_write_direct(tl, memory_read_direct(th));
} else {
memory_write_direct(tl, tmp);
@@ -153,7 +156,7 @@ timers_check(void)
/* Timer 1 */
tr = memory_read_direct(_TCON_) & 0x40;
mode = (memory_read_direct(_TMOD_) & 0x30) >> 4 ;
mode = (memory_read_direct(_TMOD_) & 0x30) >> 4;
gate = memory_read_direct(_TMOD_) & 0x80;
timer_counter = memory_read_direct(_TMOD_) & 0x40;