linux-uconsole/drivers/tty
Arnd Bergmann 58f80ccf09 tty: nozomi: avoid a harmless gcc warning
commit a4f642a8a3 upstream.

The nozomi wireless data driver has its own helper function to
transfer data from a FIFO, doing an extra byte swap on big-endian
architectures, presumably to bring the data back into byte-serial
order after readw() or readl() perform their implicit byteswap.

This helper function is used in the receive_data() function to
first read the length into a 32-bit variable, which causes
a compile-time warning:

drivers/tty/nozomi.c: In function 'receive_data':
drivers/tty/nozomi.c:857:9: warning: 'size' may be used uninitialized in this function [-Wmaybe-uninitialized]

The problem is that gcc is unsure whether the data was actually
read or not. We know that it is at this point, so we can replace
it with a single readl() to shut up that warning.

I am leaving the byteswap in there, to preserve the existing
behavior, even though this seems fishy: Reading the length of
the data into a cpu-endian variable should normally not use
a second byteswap on big-endian systems, unless the hardware
is aware of the CPU endianess.

There appears to be a lot more confusion about endianess in this
driver, so it probably has not worked on big-endian systems in
a long time, if ever, and I have no way to test it. It's well
possible that this driver has not been used by anyone in a while,
the last patch that looks like it was tested on the hardware is
from 2008.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-30 05:49:27 +02:00
..
hvc TTY/Serial driver patches for 4.4-rc1 2015-11-04 21:35:12 -08:00
ipwireless
serial tty/serial: atmel: RS485 half duplex w/DMA: enable RX after TX is done 2017-04-21 09:30:08 +02:00
vt vt: fix Scroll Lock LED trigger name 2017-01-09 08:07:47 +01:00
amiserial.c
bfin_jtag_comm.c
cyclades.c tty: Remove ASYNC_CLOSING checks in open()/hangup() methods 2015-10-17 21:11:29 -07:00
ehv_bytechan.c
goldfish.c
isicom.c
Kconfig
Makefile
metag_da.c
mips_ejtag_fdc.c ttyFDC: Fix build problems due to use of module_{init,exit} 2015-10-17 21:29:21 -07:00
moxa.c
moxa.h
mxser.c
mxser.h
n_gsm.c TTY: n_gsm, fix false positive WARN_ON 2016-06-01 12:15:52 -07:00
n_hdlc.c tty: n_hdlc: get rid of racy n_hdlc.tbuf 2017-03-15 09:57:10 +08:00
n_r3964.c tty: r3964: Replace/remove bogus tty lock use 2015-10-17 21:11:29 -07:00
n_tracerouter.c n_tracerouter: stop including <asm-generic/bug> 2015-10-15 00:21:10 +02:00
n_tracesink.c n_tracesink: stop including <asm-generic/bug> 2015-10-15 00:21:11 +02:00
n_tracesink.h
n_tty.c Fix OpenSSH pty regression on close 2016-06-01 12:15:52 -07:00
nozomi.c tty: nozomi: avoid a harmless gcc warning 2017-04-30 05:49:27 +02:00
pty.c devpts: clean up interface to pty drivers 2016-08-16 09:30:49 +02:00
rocket.c tty: Remove tty_port::close_wait 2015-10-17 21:11:29 -07:00
rocket.h
rocket_int.h
synclink.c tty: synclink, fix indentation 2015-10-17 21:14:06 -07:00
synclink_gt.c tty: Remove ASYNC_CLOSING checks in open()/hangup() methods 2015-10-17 21:11:29 -07:00
synclinkmp.c tty: Remove ASYNC_CLOSING checks in open()/hangup() methods 2015-10-17 21:11:29 -07:00
sysrq.c sysrq: attach sysrq handler correctly for 32-bit kernel 2017-01-19 20:17:21 +01:00
tty_audit.c tty: audit: Fix audit source 2015-11-20 16:19:54 -08:00
tty_buffer.c Fix OpenSSH pty regression on close 2016-06-01 12:15:52 -07:00
tty_io.c tty: Fix unsafe ldisc reference via ioctl(TIOCGETD) 2016-02-17 12:31:02 -08:00
tty_ioctl.c tty: Fix tty_send_xchar() lock order inversion 2015-11-20 16:19:54 -08:00
tty_ldisc.c tty: Prevent ldisc drivers from re-using stale tty fields 2016-11-21 10:06:40 +01:00
tty_ldsem.c
tty_mutex.c tty: Wait interruptibly for tty lock on reopen 2016-02-17 12:31:02 -08:00
tty_port.c tty: Abstract tty buffer work 2015-10-17 21:32:21 -07:00