linux/drivers/net/ethernet/brocade/bna
Arnd Bergmann a5af839253 bna: avoid writing uninitialized data into hw registers
The latest gcc-7 snapshot warns about bfa_ioc_send_enable/bfa_ioc_send_disable
writing undefined values into the hardware registers:

drivers/net/ethernet/brocade/bna/bfa_ioc.c: In function 'bfa_iocpf_sm_disabling_entry':
arch/arm/include/asm/io.h:109:22: error: '*((void *)&disable_req+4)' is used uninitialized in this function [-Werror=uninitialized]
arch/arm/include/asm/io.h:109:22: error: '*((void *)&disable_req+8)' is used uninitialized in this function [-Werror=uninitialized]

The two functions look like they should do the same thing, but only one
of them initializes the time stamp and clscode field. The fact that we
only get a warning for one of the two functions seems to be arbitrary,
based on the inlining decisions in the compiler.

To address this, I'm making both functions do the same thing:

- set the clscode from the ioc structure in both
- set the time stamp from ktime_get_real_seconds (which also
  avoids the signed-integer overflow in 2038 and extends the
  well-defined behavior until 2106).
- zero-fill the reserved field

Fixes: 8b230ed8ec ("bna: Brocade 10Gb Ethernet device driver")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-03-24 12:49:12 -07:00
..
Kconfig bna: QLogic BR-series Adapters Driver Rebranding 2015-02-21 22:05:22 -05:00
Makefile bna: remove obsolete use of EXTRA_CFLAGS 2015-06-10 21:59:02 -07:00
bfa_cee.c bna: get rid of private macros for manipulation with lists 2015-06-11 15:57:17 -07:00
bfa_cee.h bna: QLogic BR-series Adapters Driver Rebranding 2015-02-21 22:05:22 -05:00
bfa_cs.h bna: get rid of duplicate and unused macros 2015-06-11 15:57:15 -07:00
bfa_defs.h bna: get rid of duplicate and unused macros 2015-06-11 15:57:15 -07:00
bfa_defs_cna.h bna: replace pragma(pack) with attribute __packed 2015-06-11 15:57:15 -07:00
bfa_defs_mfg_comm.h bna: remove superfluous parentheses 2015-06-21 10:29:02 -07:00
bfa_defs_status.h bna: QLogic BR-series Adapters Driver Rebranding 2015-02-21 22:05:22 -05:00
bfa_ioc.c bna: avoid writing uninitialized data into hw registers 2017-03-24 12:49:12 -07:00
bfa_ioc.h bna: fix timeout API argument type 2015-06-11 15:57:17 -07:00
bfa_ioc_ct.c bna: remove superfluous parentheses 2015-06-21 10:29:02 -07:00
bfa_msgq.c bna: get rid of private macros for manipulation with lists 2015-06-11 15:57:17 -07:00
bfa_msgq.h bna: QLogic BR-series Adapters Driver Rebranding 2015-02-21 22:05:22 -05:00
bfi.h bna: get rid of duplicate and unused macros 2015-06-11 15:57:15 -07:00
bfi_cna.h bna: replace pragma(pack) with attribute __packed 2015-06-11 15:57:15 -07:00
bfi_enet.h bna: use BIT(x) instead of (1 << x) 2015-06-11 15:57:15 -07:00
bfi_reg.h bna: QLogic BR-series Adapters Driver Rebranding 2015-02-21 22:05:22 -05:00
bna.h bna: make pointers to read-only inputs const 2015-06-21 10:29:01 -07:00
bna_enet.c bna: use designated initializers 2016-12-17 11:56:57 -05:00
bna_hw_defs.h bna: use BIT(x) instead of (1 << x) 2015-06-11 15:57:15 -07:00
bna_tx_rx.c bna: fix list corruption 2016-03-01 15:19:43 -05:00
bna_types.h bna: check for dma mapping errors 2015-09-20 21:36:57 -07:00
bnad.c drivers: net: generalize napi_complete_done() 2017-01-30 15:10:42 -05:00
bnad.h bna: remove useless linked list 2016-08-08 15:41:27 -07:00
bnad_debugfs.c bna: integer overflow bug in debugfs 2017-03-21 17:43:16 -07:00
bnad_ethtool.c net: brocade: bna: use new api ethtool_{get|set}_link_ksettings 2016-11-30 10:29:02 -05:00
cna.h bna: get rid of private macros for manipulation with lists 2015-06-11 15:57:17 -07:00
cna_fwimg.c bna: use netdev_* and dev_* instead of printk and pr_* 2015-06-11 15:57:18 -07:00