Fix checkpatch warnings
authorHugo Villeneuve <hugo@hugovil.com>
Thu, 13 Feb 2014 04:16:18 +0000 (23:16 -0500)
committerHugo Villeneuve <hugo@hugovil.com>
Thu, 13 Feb 2014 05:25:19 +0000 (00:25 -0500)
src/cli/main.c
src/common/cpu8051.c
src/common/opcode2c.pl
src/common/timers.c

index fca5d9e..35f78d0 100644 (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);
        }
 
index 10bc2d2..5a00709 100644 (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;
                        }
index 27c9f56..5268785 100755 (executable)
@@ -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";
index 3e7f3ec..53c2fb1 100644 (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;