linux-imx/drivers/tty
Arnd Bergmann 070d8f38c8 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: Jiri Slaby <jslaby@suse.cz>
2017-05-09 08:19:43 +02:00
..
hvc xen/events: don't bind non-percpu VIRQs with percpu chip 2015-06-03 11:33:07 +02:00
ipwireless tty: Fix low_latency BUG 2014-05-05 14:24:38 +02:00
serial tty/serial: atmel: fix race condition (TX+DMA) 2017-04-11 08:04:41 +02:00
vt tty: vt, fix bogus division in csi_J 2016-11-24 16:23:37 +01:00
amiserial.c TTY: amiserial, remove unnecessary platform_set_drvdata() 2013-08-27 16:24:33 -07:00
bfin_jtag_comm.c
cyclades.c
ehv_bytechan.c TTY: ehv_bytechan: add missing platform_driver_unregister() when module exit 2013-05-20 12:15:59 -07:00
goldfish.c
isicom.c
Kconfig
Makefile tty: Add timed, writer-prioritized rw semaphore 2013-05-20 12:30:32 -07:00
metag_da.c
moxa.c
moxa.h
mxser.c tty: mxser: Fix build warning introduced by dfc7b837c7 (Re: linux-next: build warning after merge of the tty.current tree) 2013-05-22 10:26:02 -07:00
mxser.h
n_gsm.c tty: n_gsm: Fix for modems with brk in modem status control 2014-02-22 13:32:26 -08:00
n_hdlc.c tty: n_hdlc: get rid of racy n_hdlc.tbuf 2017-03-13 21:40:42 +01:00
n_r3964.c
n_tracerouter.c
n_tracesink.c
n_tracesink.h
n_tty.c tty: audit: Fix audit source 2016-11-28 22:22:57 +01:00
nozomi.c tty: nozomi: avoid a harmless gcc warning 2017-05-09 08:19:43 +02:00
pty.c pty: make sure super_block is still valid in final /dev/tty close 2016-02-24 10:23:17 +01:00
rocket_int.h
rocket.c TTY: rocket, fix more no-PCI warnings 2013-05-20 12:15:59 -07:00
rocket.h
synclink_gt.c TTY: synclink_gt: fix DTR being raised on hang up 2013-04-12 14:08:17 -07:00
synclink.c TTY: synclink: replace bitmasks add operation with OR operation. 2013-07-29 12:47:37 -07:00
synclinkmp.c TTY: snyclinkmp: calculating wrong addresses 2013-07-24 15:23:38 -07:00
sysrq.c sysrq: attach sysrq handler correctly for 32-bit kernel 2017-01-26 17:40:43 +01:00
tty_audit.c tty: audit: Fix audit source 2016-11-28 22:22:57 +01:00
tty_buffer.c tty: Fix GPF in flush_to_ldisc() 2016-02-23 17:54:30 +01:00
tty_io.c tty: Fix unsafe ldisc reference via ioctl(TIOCGETD) 2016-02-23 17:54:31 +01:00
tty_ioctl.c TTY: fix tty_wait_until_sent on 64-bit machines 2015-03-12 17:31:17 +01:00
tty_ldisc.c tty: Prevent ldisc drivers from re-using stale tty fields 2016-11-18 11:41:11 +01:00
tty_ldsem.c tty: Fix hang at ldsem_down_read() 2014-01-09 12:25:07 -08:00
tty_mutex.c
tty_port.c tty_port: Fix refcounting leak in tty_port_tty_hangup() 2013-07-26 16:34:00 -07:00