linux/drivers/net/ethernet
Andrew Gabbasov 68b9f0865b ravb: Fix bit fields checking in ravb_hwtstamp_get()
In the function ravb_hwtstamp_get() in ravb_main.c with the existing
values for RAVB_RXTSTAMP_TYPE_V2_L2_EVENT (0x2) and RAVB_RXTSTAMP_TYPE_ALL
(0x6)

if (priv->tstamp_rx_ctrl & RAVB_RXTSTAMP_TYPE_V2_L2_EVENT)
	config.rx_filter = HWTSTAMP_FILTER_PTP_V2_L2_EVENT;
else if (priv->tstamp_rx_ctrl & RAVB_RXTSTAMP_TYPE_ALL)
	config.rx_filter = HWTSTAMP_FILTER_ALL;

if the test on RAVB_RXTSTAMP_TYPE_ALL should be true,
it will never be reached.

This issue can be verified with 'hwtstamp_config' testing program
(tools/testing/selftests/net/hwtstamp_config.c). Setting filter type
to ALL and subsequent retrieving it gives incorrect value:

$ hwtstamp_config eth0 OFF ALL
flags = 0
tx_type = OFF
rx_filter = ALL
$ hwtstamp_config eth0
flags = 0
tx_type = OFF
rx_filter = PTP_V2_L2_EVENT

Correct this by converting if-else's to switch.

Fixes: c156633f13 ("Renesas Ethernet AVB driver proper")
Reported-by: Julia Lawall <julia.lawall@inria.fr>
Signed-off-by: Andrew Gabbasov <andrew_gabbasov@mentor.com>
Reviewed-by: Sergei Shtylyov <sergei.shtylyov@gmail.com>
Link: https://lore.kernel.org/r/20201026102130.29368-1-andrew_gabbasov@mentor.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2020-10-27 17:14:33 -07:00
..
3com networking changes for the 5.10 merge window 2020-10-15 18:42:13 -07:00
8390 lib8390: Use netif_msg_init to initialize msg_enable bits 2020-10-01 19:08:46 -07:00
adaptec
aeroflex
agere
alacritech
allwinner
alteon
altera
amazon
amd networking changes for the 5.10 merge window 2020-10-15 18:42:13 -07:00
apm
apple
aquantia net: remove unneeded break 2020-10-20 10:28:21 -07:00
arc
atheros net: atheros: Remove WARN_ON(in_interrupt()) 2020-09-29 14:02:53 -07:00
aurora
broadcom bnxt_en: Send HWRM_FUNC_RESET fw command unconditionally. 2020-10-26 18:26:35 -07:00
brocade net: bna: Use fallthrough pseudo-keyword 2020-10-03 17:33:23 -07:00
cadence macb: support the two tx descriptors on at91rm9200 2020-10-13 16:57:12 -07:00
calxeda
cavium net: thunderx: Use struct_size() helper in kmalloc() 2020-10-10 10:34:03 -07:00
chelsio chelsio/chtls: fix memory leaks in CPL handlers 2020-10-27 16:54:30 -07:00
cirrus
cisco net: remove unneeded break 2020-10-20 10:28:21 -07:00
cortina
davicom
dec
dlink
emulex
ezchip
faraday net: ftgmac100: Fix Aspeed ast2600 TX hang issue 2020-10-16 15:36:34 -07:00
freescale net: ucc_geth: Drop extraneous parentheses in comparison 2020-10-23 18:44:06 -07:00
fujitsu
google
hisilicon net: hns3: Clear the CMDQ registers before unmapping BAR region 2020-10-26 20:25:04 -07:00
huawei Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-10-05 18:40:01 -07:00
i825xx
ibm ibmvnic: save changed mac address to adapter->mac_addr 2020-10-21 20:54:02 -07:00
intel net: remove unneeded break 2020-10-20 10:28:21 -07:00
marvell pci-v5.10-changes 2020-10-22 12:41:00 -07:00
mediatek net: ethernet: mtk-star-emac: select REGMAP_MMIO 2020-10-21 18:11:17 -07:00
mellanox mlxsw: core: Fix use-after-free in mlxsw_emad_trans_finish() 2020-10-26 16:45:50 -07:00
micrel net: ksz884x: Use fallthrough pseudo-keyword 2020-10-03 17:33:23 -07:00
microchip
moxa
mscc net: mscc: ocelot: remove duplicate ocelot_port_dev_check 2020-10-13 17:04:43 -07:00
myricom
natsemi net: natsemi: Replace in_interrupt() usage. 2020-09-29 14:02:54 -07:00
neterion net: vxge: Remove in_interrupt() conditionals 2020-09-29 14:02:54 -07:00
netronome
ni
nvidia
nxp
oki-semi
packetengines
pasemi
pensando ionic: fix mem leak in rx_empty 2020-10-23 18:37:23 -07:00
qlogic RDMA 5.10 pull request 2020-10-17 11:18:18 -07:00
qualcomm
rdc
realtek r8169: fix operation under forced interrupt threading 2020-10-19 16:55:54 -07:00
renesas ravb: Fix bit fields checking in ravb_hwtstamp_get() 2020-10-27 17:14:33 -07:00
rocker Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-10-05 18:40:01 -07:00
samsung
seeq
sfc sfc: move initialisation of efx->filter_sem to efx_init_struct() 2020-10-20 21:22:23 -07:00
sgi
silan
sis
smsc
socionext netsec: ignore 'phy-mode' device property on ACPI systems 2020-10-20 15:59:43 -07:00
stmicro Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-10-05 18:40:01 -07:00
sun networking changes for the 5.10 merge window 2020-10-15 18:42:13 -07:00
synopsys
tehuti
ti Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-10-15 12:43:21 -07:00
toshiba
tundra
via Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-10-05 18:40:01 -07:00
wiznet
xilinx
xircom
xscale
dnet.c
dnet.h
ec_bhf.c
ethoc.c
fealnx.c
jme.c
jme.h
Kconfig
korina.c net: korina: cast KSEG0 address to pointer in kfree 2020-10-19 17:00:00 -07:00
lantiq_etop.c
lantiq_xrx200.c
Makefile