Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

USB: serial: digi_acceleport: clean up urb->status usage

This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.


Cc: <linux-usb-devel@lists.sourceforge.net>
Cc: Peter Berger <pberger@brimson.com>
Cc: Al Borchers <borchers@steinerpoint.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

+26 -17
+26 -17
drivers/usb/serial/digi_acceleport.c
··· 1324 1324 struct digi_port *priv; 1325 1325 struct digi_serial *serial_priv; 1326 1326 int ret = 0; 1327 + int status = urb->status; 1327 1328 1328 1329 1329 - dbg( "digi_write_bulk_callback: TOP, urb->status=%d", urb->status ); 1330 + dbg("digi_write_bulk_callback: TOP, urb status=%d", status); 1330 1331 1331 1332 /* port and serial sanity check */ 1332 1333 if( port == NULL || (priv=usb_get_serial_port_data(port)) == NULL ) { 1333 - err("%s: port or port->private is NULL, status=%d", __FUNCTION__, 1334 - urb->status ); 1334 + err("%s: port or port->private is NULL, status=%d", 1335 + __FUNCTION__, status); 1335 1336 return; 1336 1337 } 1337 1338 serial = port->serial; 1338 1339 if( serial == NULL || (serial_priv=usb_get_serial_data(serial)) == NULL ) { 1339 - err("%s: serial or serial->private is NULL, status=%d", __FUNCTION__, urb->status ); 1340 + err("%s: serial or serial->private is NULL, status=%d", 1341 + __FUNCTION__, status); 1340 1342 return; 1341 1343 } 1342 1344 ··· 1742 1740 struct digi_port *priv; 1743 1741 struct digi_serial *serial_priv; 1744 1742 int ret; 1743 + int status = urb->status; 1745 1744 1746 1745 1747 1746 dbg( "digi_read_bulk_callback: TOP" ); 1748 1747 1749 1748 /* port sanity check, do not resubmit if port is not valid */ 1750 1749 if( port == NULL || (priv=usb_get_serial_port_data(port)) == NULL ) { 1751 - err("%s: port or port->private is NULL, status=%d", __FUNCTION__, 1752 - urb->status ); 1750 + err("%s: port or port->private is NULL, status=%d", 1751 + __FUNCTION__, status); 1753 1752 return; 1754 1753 } 1755 1754 if( port->serial == NULL 1756 1755 || (serial_priv=usb_get_serial_data(port->serial)) == NULL ) { 1757 - err("%s: serial is bad or serial->private is NULL, status=%d", __FUNCTION__, urb->status ); 1756 + err("%s: serial is bad or serial->private is NULL, status=%d", 1757 + __FUNCTION__, status); 1758 1758 return; 1759 1759 } 1760 1760 1761 1761 /* do not resubmit urb if it has any status error */ 1762 - if( urb->status ) { 1763 - err("%s: nonzero read bulk status: status=%d, port=%d", __FUNCTION__, urb->status, priv->dp_port_num ); 1762 + if (status) { 1763 + err("%s: nonzero read bulk status: status=%d, port=%d", 1764 + __FUNCTION__, status, priv->dp_port_num); 1764 1765 return; 1765 1766 } 1766 1767 ··· 1804 1799 struct digi_port *priv = usb_get_serial_port_data(port); 1805 1800 int opcode = ((unsigned char *)urb->transfer_buffer)[0]; 1806 1801 int len = ((unsigned char *)urb->transfer_buffer)[1]; 1807 - int status = ((unsigned char *)urb->transfer_buffer)[2]; 1802 + int port_status = ((unsigned char *)urb->transfer_buffer)[2]; 1808 1803 unsigned char *data = ((unsigned char *)urb->transfer_buffer)+3; 1809 1804 int flag,throttled; 1810 1805 int i; 1806 + int status = urb->status; 1811 1807 1812 1808 /* do not process callbacks on closed ports */ 1813 1809 /* but do continue the read chain */ ··· 1817 1811 1818 1812 /* short/multiple packet check */ 1819 1813 if( urb->actual_length != len + 2 ) { 1820 - err("%s: INCOMPLETE OR MULTIPLE PACKET, urb->status=%d, port=%d, opcode=%d, len=%d, actual_length=%d, status=%d", __FUNCTION__, urb->status, priv->dp_port_num, opcode, len, urb->actual_length, status ); 1814 + err("%s: INCOMPLETE OR MULTIPLE PACKET, urb status=%d, " 1815 + "port=%d, opcode=%d, len=%d, actual_length=%d, " 1816 + "port_status=%d", __FUNCTION__, status, priv->dp_port_num, 1817 + opcode, len, urb->actual_length, port_status); 1821 1818 return( -1 ); 1822 1819 } 1823 1820 ··· 1835 1826 /* receive data */ 1836 1827 if( opcode == DIGI_CMD_RECEIVE_DATA ) { 1837 1828 1838 - /* get flag from status */ 1829 + /* get flag from port_status */ 1839 1830 flag = 0; 1840 1831 1841 1832 /* overrun is special, not associated with a char */ 1842 - if( status & DIGI_OVERRUN_ERROR ) { 1833 + if (port_status & DIGI_OVERRUN_ERROR) { 1843 1834 tty_insert_flip_char( tty, 0, TTY_OVERRUN ); 1844 1835 } 1845 1836 1846 1837 /* break takes precedence over parity, */ 1847 1838 /* which takes precedence over framing errors */ 1848 - if( status & DIGI_BREAK_ERROR ) { 1839 + if (port_status & DIGI_BREAK_ERROR) { 1849 1840 flag = TTY_BREAK; 1850 - } else if( status & DIGI_PARITY_ERROR ) { 1841 + } else if (port_status & DIGI_PARITY_ERROR) { 1851 1842 flag = TTY_PARITY; 1852 - } else if( status & DIGI_FRAMING_ERROR ) { 1843 + } else if (port_status & DIGI_FRAMING_ERROR) { 1853 1844 flag = TTY_FRAME; 1854 1845 } 1855 1846 1856 - /* data length is len-1 (one byte of len is status) */ 1847 + /* data length is len-1 (one byte of len is port_status) */ 1857 1848 --len; 1858 1849 1859 1850 len = tty_buffer_request_room(tty, len);