]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/char/sx.c
Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6
[linux-2.6-omap-h63xx.git] / drivers / char / sx.c
index c2490e270f1fc92b280b477eaff5605bbb4b79e6..a6b4f02bdceb06ba347d5241f6b479eacecbb36a 100644 (file)
@@ -1095,17 +1095,17 @@ static inline void sx_receive_chars (struct sx_port *port)
 
                sx_dprintk (SX_DEBUG_RECEIVE, "rxop=%d, c = %d.\n", rx_op, c); 
 
+               /* Don't copy past the end of the hardware receive buffer */
+               if (rx_op + c > 0x100) c = 0x100 - rx_op;
+
+               sx_dprintk (SX_DEBUG_RECEIVE, "c = %d.\n", c);
+
                /* Don't copy more bytes than there is room for in the buffer */
 
                c = tty_prepare_flip_string(tty, &rp, c);
 
                sx_dprintk (SX_DEBUG_RECEIVE, "c = %d.\n", c); 
 
-               /* Don't copy past the end of the hardware receive buffer */
-               if (rx_op + c > 0x100) c = 0x100 - rx_op;
-
-               sx_dprintk (SX_DEBUG_RECEIVE, "c = %d.\n", c);
-
                /* If for one reason or another, we can't copy more data, we're done! */
                if (c == 0) break;
 
@@ -2173,15 +2173,17 @@ static int probe_si (struct sx_board *board)
        if ( IS_SI1_BOARD(board)) {
                /* This should be an SI1 board, which has this
                   location writable... */
-               if (read_sx_byte (board, SI2_ISA_ID_BASE) != 0x10)
+               if (read_sx_byte (board, SI2_ISA_ID_BASE) != 0x10) {
                        func_exit ();
                        return 0; 
+               }
        } else {
                /* This should be an SI2 board, which has the bottom
                   3 bits non-writable... */
-               if (read_sx_byte (board, SI2_ISA_ID_BASE) == 0x10)
+               if (read_sx_byte (board, SI2_ISA_ID_BASE) == 0x10) {
                        func_exit ();
                        return 0; 
+               }
        }
 
        /* Now we're pretty much convinced that there is an SI board here, 
@@ -2192,15 +2194,17 @@ static int probe_si (struct sx_board *board)
        if ( IS_SI1_BOARD(board)) {
                /* This should be an SI1 board, which has this
                   location writable... */
-               if (read_sx_byte (board, SI2_ISA_ID_BASE) != 0x10)
+               if (read_sx_byte (board, SI2_ISA_ID_BASE) != 0x10) {
                        func_exit();
                        return 0; 
+               }
        } else {
                /* This should be an SI2 board, which has the bottom
                   3 bits non-writable... */
-               if (read_sx_byte (board, SI2_ISA_ID_BASE) == 0x10)
+               if (read_sx_byte (board, SI2_ISA_ID_BASE) == 0x10) {
                        func_exit ();
                        return 0; 
+               }
        }
 
        printheader ();