5.4.124-rc1 review
Subsystems (3)
Greg Kroah-Hartman
maintainerPATCH 172/177 drivers/net/ethernet: clean up unused assignments
In reply to Greg Kroah-HartmanFrom: Jesse Brandeburg <[email protected]>
commit 7c8c0291f84027558bd5fca5729cbcf288c510f4 upstream.
As part of the W=1 compliation series, these lines all created warnings about unused variables that were assigned a value. Most of them are from register reads, but some are just picking up a return value from a function and never doing anything with it.
Fixed warnings:.../ethernet/brocade/bna/bnad.c:3280:6: warning: variable ‘rx_count’ set but not used [-Wunused-but-set-variable] .../ethernet/brocade/bna/bnad.c:3280:6: warning: variable ‘rx_count’ set but not used [-Wunused-but-set-variable] .../ethernet/cortina/gemini.c:512:6: warning: variable ‘val’ set but not used [-Wunused-but-set-variable] .../ethernet/cortina/gemini.c:2110:21: warning: variable ‘config0’ set but not used [-Wunused-but-set-variable] .../ethernet/cavium/liquidio/octeon_device.c:1327:6: warning: variable ‘val32’ set but not used [-Wunused-but-set-variable] .../ethernet/cavium/liquidio/octeon_device.c:1358:6: warning: variable ‘val32’ set but not used [-Wunused-but-set-variable] .../ethernet/dec/tulip/media.c:322:8: warning: variable ‘setup’ set but not used [-Wunused-but-set-variable] .../ethernet/dec/tulip/de4x5.c:4928:13: warning: variable ‘r3’ set but not used [-Wunused-but-set-variable] .../ethernet/micrel/ksz884x.c:1652:7: warning: variable ‘dummy’ set but not used [-Wunused-but-set-variable] .../ethernet/micrel/ksz884x.c:1652:7: warning: variable ‘dummy’ set but not used [-Wunused-but-set-variable] .../ethernet/micrel/ksz884x.c:1652:7: warning: variable ‘dummy’ set but not used [-Wunused-but-set-variable] .../ethernet/micrel/ksz884x.c:1652:7: warning: variable ‘dummy’ set but not used [-Wunused-but-set-variable] .../ethernet/micrel/ksz884x.c:4981:6: warning: variable ‘rx_status’ set but not used [-Wunused-but-set-variable] .../ethernet/micrel/ksz884x.c:6510:6: warning: variable ‘rc’ set but not used [-Wunused-but-set-variable] .../ethernet/micrel/ksz884x.c:6087: warning: cannot understand function prototype: 'struct hw_regs ' .../ethernet/microchip/lan743x_main.c:161:6: warning: variable ‘int_en’ set but not used [-Wunused-but-set-variable] .../ethernet/microchip/lan743x_main.c:1702:6: warning: variable ‘int_sts’ set but not used [-Wunused-but-set-variable] .../ethernet/microchip/lan743x_main.c:3041:6: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable] .../ethernet/natsemi/ns83820.c:603:6: warning: variable ‘tbisr’ set but not used [-Wunused-but-set-variable] .../ethernet/natsemi/ns83820.c:1207:11: warning: variable ‘tanar’ set but not used [-Wunused-but-set-variable] .../ethernet/marvell/mvneta.c:754:6: warning: variable ‘dummy’ set but not used [-Wunused-but-set-variable] .../ethernet/neterion/vxge/vxge-traffic.c:33:6: warning: variable ‘val64’ set but not used [-Wunused-but-set-variable] .../ethernet/neterion/vxge/vxge-traffic.c:160:6: warning: variable ‘val64’ set but not used [-Wunused-but-set-variable] .../ethernet/neterion/vxge/vxge-traffic.c:490:6: warning: variable ‘val32’ set but not used [-Wunused-but-set-variable] .../ethernet/neterion/vxge/vxge-traffic.c:2378:6: warning: variable ‘val64’ set but not used [-Wunused-but-set-variable] .../ethernet/packetengines/yellowfin.c:1063:18: warning: variable ‘yf_size’ set but not used [-Wunused-but-set-variable] .../ethernet/realtek/8139cp.c:1242:6: warning: variable ‘rc’ set but not used [-Wunused-but-set-variable] .../ethernet/mellanox/mlx4/en_tx.c:858:6: warning: variable ‘ring_cons’ set but not used [-Wunused-but-set-variable] .../ethernet/sis/sis900.c:792:6: warning: variable ‘status’ set but not used [-Wunused-but-set-variable] .../ethernet/sfc/falcon/farch.c:878:11: warning: variable ‘rx_ev_pkt_type’ set but not used [-Wunused-but-set-variable] .../ethernet/sfc/falcon/farch.c:877:23: warning: variable ‘rx_ev_mcast_pkt’ set but not used [-Wunused-but-set-variable] .../ethernet/sfc/falcon/farch.c:877:7: warning: variable ‘rx_ev_hdr_type’ set but not used [-Wunused-but-set-variable] .../ethernet/sfc/falcon/farch.c:876:7: warning: variable ‘rx_ev_other_err’ set but not used [-Wunused-but-set-variable] .../ethernet/sfc/falcon/farch.c:1646:21: warning: variable ‘buftbl_min’ set but not used [-Wunused-but-set-variable] .../ethernet/sfc/falcon/farch.c:2535:32: warning: variable ‘spec’ set but not used [-Wunused-but-set-variable] .../ethernet/via/via-velocity.c:880:6: warning: variable ‘curr_status’ set but not used [-Wunused-but-set-variable] .../ethernet/ti/tlan.c:656:6: warning: variable ‘rc’ set but not used [-Wunused-but-set-variable] .../ethernet/ti/davinci_emac.c:1230:6: warning: variable ‘num_tx_pkts’ set but not used [-Wunused-but-set-variable] .../ethernet/synopsys/dwc-xlgmac-common.c:516:8: warning: variable ‘str’ set but not used [-Wunused-but-set-variable] .../ethernet/ti/cpsw_new.c:1662:22: warning: variable ‘priv’ set but not used [-Wunused-but-set-variable]
The register reads should be OK, because the current implementation of readl and friends will always execute even without an lvalue.
When it makes sense, just remove the lvalue assignment and the local. Other times, just remove the offending code, and occasionally, just mark the variable as maybe unused since it could be used in an ifdef or debug scenario.
Only compile tested with W=1.
--- drivers/net/ethernet/brocade/bna/bnad.c | 7 +--- drivers/net/ethernet/dec/tulip/de4x5.c | 4 +- drivers/net/ethernet/dec/tulip/media.c | 5 --- drivers/net/ethernet/mellanox/mlx4/en_tx.c | 2 - drivers/net/ethernet/micrel/ksz884x.c | 3 -- drivers/net/ethernet/microchip/lan743x_main.c | 6 +--- drivers/net/ethernet/neterion/vxge/vxge-traffic.c | 32 +++++++--------------- drivers/net/ethernet/sfc/falcon/farch.c | 29 +++++++------------ drivers/net/ethernet/sis/sis900.c | 5 +-- drivers/net/ethernet/synopsys/dwc-xlgmac-common.c | 2 - drivers/net/ethernet/ti/davinci_emac.c | 5 +-- drivers/net/ethernet/ti/tlan.c | 4 -- drivers/net/ethernet/via/via-velocity.c | 13 -------- 13 files changed, 36 insertions(+), 81 deletions(-)
drivers/net/ethernet/brocade/bna/bnad.c +2 -5
@@ -3282,7 +3282,7 @@ bnad_change_mtu(struct net_device *netde {int err, mtu;struct bnad *bnad =netdev_priv (netdev); -u32 rx_count =0 , frame, new_frame; +u32 frame, new_frame;mutex_lock (&bnad->conf_mutex);
@@ -3298,12 +3298,9 @@ bnad_change_mtu(struct net_device *netde/* only when transition is over 4K */ if ((frame <=4096 && new_frame >4096 ) || (frame >4096 && new_frame <=4096 )) - rx_count =bnad_reinit_rx (bnad); +bnad_reinit_rx (bnad); } -/* rx_count > 0 - new rx created -* - Linux set err = 0 and return -*/ err =bnad_mtu_set (bnad, new_frame);if (err) err = -EBUSY ;
drivers/net/ethernet/dec/tulip/de4x5.c +2 -2
@@ -4927,11 +4927,11 @@ mii_get_oui(u_char phyaddr, u_long ioaddu_char breg[2]; } a; int i, r2, r3, ret=0;*/ -int r2, r3; +int r2;/* Read r2 and r3 */ r2 =mii_rd (MII_ID0 , phyaddr, ioaddr); - r3 =mii_rd (MII_ID1 , phyaddr, ioaddr); +mii_rd (MII_ID1 , phyaddr, ioaddr);/* SEEQ and Cypress way * / / * Shuffle r2 and r3 * / a.reg=0;
drivers/net/ethernet/dec/tulip/media.c +0 -5
@@ -319,13 +319,8 @@ void tulip_select_media(struct net_devicbreak ; }case 5 :case 6 : { -u16 setup[5 ]; - new_csr6 =0 ;/* FIXME */ -for (i =0 ; i <5 ; i++) - setup[i] =get_u16 (&p[i*2 +1 ]); -if (startup && mtable->has_reset) {struct medialeaf *rleaf = &mtable->mleaf[mtable->has_reset];unsigned char *rst = rleaf->leafdata;
drivers/net/ethernet/mellanox/mlx4/en_tx.c +1 -1
@@ -868,6 +868,7 @@ netdev_tx_t mlx4_en_xmit(struct sk_buffstruct mlx4_en_tx_desc *tx_desc;struct mlx4_wqe_data_seg *data;struct mlx4_en_tx_info *tx_info; +u32 __maybe_unused ring_cons;int tx_ind;int nr_txbb;int desc_size;
@@ -881,7 +882,6 @@ netdev_tx_t mlx4_en_xmit(struct sk_buffbool stop_queue;bool inline_ok;u8 data_offset; -u32 ring_cons;bool bf_ok; tx_ind =skb_get_queue_mapping (skb);
drivers/net/ethernet/micrel/ksz884x.c +1 -2
@@ -1649,8 +1649,7 @@ static inline void set_tx_len(struct ksz#define HW_DELAY (hw, reg) \ do { \ - u16 dummy; \ - dummy = readw(hw->io + reg); \ + readw(hw->io + reg); \ } while (0)/**
drivers/net/ethernet/microchip/lan743x_main.c +2 -4
@@ -156,9 +156,8 @@ static void lan743x_tx_isr(void *contextstruct lan743x_tx *tx = context;struct lan743x_adapter *adapter = tx->adapter;bool enable_flag = true; -u32 int_en =0 ; - int_en =lan743x_csr_read (adapter,INT_EN_SET ); +lan743x_csr_read (adapter,INT_EN_SET );if (flags &LAN743X_VECTOR_FLAG_SOURCE_ENABLE_CLEAR ) {lan743x_csr_write (adapter,INT_EN_CLR ,INT_BIT_DMA_TX_ (tx->channel_number));
@@ -1631,10 +1630,9 @@ static int lan743x_tx_napi_poll(struct nbool start_transmitter = false;unsigned long irq_flags =0 ;u32 ioc_bit =0 ; -u32 int_sts =0 ; ioc_bit =DMAC_INT_BIT_TX_IOC_ (tx->channel_number); - int_sts =lan743x_csr_read (adapter,DMAC_INT_STS ); +lan743x_csr_read (adapter,DMAC_INT_STS );if (tx->vector_flags &LAN743X_VECTOR_FLAG_SOURCE_STATUS_W2C )lan743x_csr_write (adapter,DMAC_INT_STS , ioc_bit);spin_lock_irqsave (&tx->ring_lock, irq_flags);
drivers/net/ethernet/neterion/vxge/vxge-traffic.c +11 -21
@@ -30,8 +30,6 @@*/ enum vxge_hw_status vxge_hw_vpath_intr_enable (struct __vxge_hw_vpath_handle *vp) { -u64 val64; -struct __vxge_hw_virtualpath *vpath;struct vxge_hw_vpath_reg __iomem *vp_reg;enum vxge_hw_status status =VXGE_HW_OK ;
@@ -84,7 +82,7 @@ enum vxge_hw_status vxge_hw_vpath_intr_e__vxge_hw_pio_mem_write32_upper ((u32 )VXGE_HW_INTR_MASK_ALL , &vp_reg->xgmac_vp_int_status); - val64 =readq (&vp_reg->vpath_general_int_status); +readq (&vp_reg->vpath_general_int_status);/* Mask unwanted interrupts */
@@ -157,8 +155,6 @@ exit:enum vxge_hw_status vxge_hw_vpath_intr_disable (struct __vxge_hw_vpath_handle *vp) { -u64 val64; -struct __vxge_hw_virtualpath *vpath;enum vxge_hw_status status =VXGE_HW_OK ;struct vxge_hw_vpath_reg __iomem *vp_reg;
@@ -179,8 +175,6 @@ enum vxge_hw_status vxge_hw_vpath_intr_d (u32 )VXGE_HW_INTR_MASK_ALL , &vp_reg->vpath_general_int_mask); - val64 =VXGE_HW_TIM_CLR_INT_EN_VP (1 << (16 - vpath->vp_id)); -writeq (VXGE_HW_INTR_MASK_ALL , &vp_reg->kdfcctl_errors_mask); __vxge_hw_pio_mem_write32_upper((u32)VXGE_HW_INTR_MASK_ALL,
@@ -487,9 +481,7 @@ void vxge_hw_device_unmask_all(struct __*/ void vxge_hw_device_flush_io (struct __vxge_hw_device *hldev) { -u32 val32; - - val32 =readl (&hldev->common_reg->titan_general_int_status); +readl (&hldev->common_reg->titan_general_int_status); }/**
@@ -1716,8 +1708,8 @@ void vxge_hw_fifo_txdl_free(struct __vxgenum vxge_hw_status vxge_hw_vpath_mac_addr_add (struct __vxge_hw_vpath_handle *vp, -u8 (macaddr )[ETH_ALEN ], -u8 (macaddr_mask )[ETH_ALEN ], +u8 *macaddr, +u8 *macaddr_mask,enum vxge_hw_vpath_mac_addr_add_mode duplicate_mode) {u32 i;
@@ -1779,8 +1771,8 @@ exit:enum vxge_hw_status vxge_hw_vpath_mac_addr_get (struct __vxge_hw_vpath_handle *vp, -u8 (macaddr )[ETH_ALEN ], -u8 (macaddr_mask )[ETH_ALEN ]) +u8 *macaddr, +u8 *macaddr_mask) {u32 i;u64 data1 =0ULL ;
@@ -1831,8 +1823,8 @@ exit:enum vxge_hw_status vxge_hw_vpath_mac_addr_get_next (struct __vxge_hw_vpath_handle *vp, -u8 (macaddr )[ETH_ALEN ], -u8 (macaddr_mask )[ETH_ALEN ]) +u8 *macaddr, +u8 *macaddr_mask) {u32 i;u64 data1 =0ULL ;
@@ -1884,8 +1876,8 @@ exit:enum vxge_hw_status vxge_hw_vpath_mac_addr_delete (struct __vxge_hw_vpath_handle *vp, -u8 (macaddr )[ETH_ALEN ], -u8 (macaddr_mask )[ETH_ALEN ]) +u8 *macaddr, +u8 *macaddr_mask) {u32 i;u64 data1 =0ULL ;
@@ -2375,7 +2367,6 @@ enum vxge_hw_status vxge_hw_vpath_poll_ru8 t_code;enum vxge_hw_status status =VXGE_HW_OK ;void *first_rxdh; -u64 val64 =0 ;int new_count =0 ; ring->cmpl_cnt =0 ;
@@ -2403,8 +2394,7 @@ enum vxge_hw_status vxge_hw_vpath_poll_r }writeq (VXGE_HW_PRC_RXD_DOORBELL_NEW_QW_CNT (new_count), &ring->vp_reg->prc_rxd_doorbell); - val64 = -readl (&ring->common_reg->titan_general_int_status); +readl (&ring->common_reg->titan_general_int_status); ring->doorbell_cnt =0 ; } }
drivers/net/ethernet/sfc/falcon/farch.c +11 -18
@@ -870,17 +870,12 @@ static u16 ef4_farch_handle_rx_not_ok(st {struct ef4_channel *channel =ef4_rx_queue_channel (rx_queue);struct ef4_nic *efx = rx_queue->efx; -bool rx_ev_buf_owner_id_err, rx_ev_ip_hdr_chksum_err; +bool __maybe_unused rx_ev_buf_owner_id_err, rx_ev_ip_hdr_chksum_err;bool rx_ev_tcp_udp_chksum_err, rx_ev_eth_crc_err;bool rx_ev_frm_trunc, rx_ev_drib_nib, rx_ev_tobe_disc; -bool rx_ev_other_err, rx_ev_pause_frm; -bool rx_ev_hdr_type, rx_ev_mcast_pkt; -unsigned rx_ev_pkt_type; +bool rx_ev_pause_frm; - rx_ev_hdr_type =EF4_QWORD_FIELD (*event,FSF_AZ_RX_EV_HDR_TYPE ); - rx_ev_mcast_pkt =EF4_QWORD_FIELD (*event,FSF_AZ_RX_EV_MCAST_PKT ); rx_ev_tobe_disc =EF4_QWORD_FIELD (*event,FSF_AZ_RX_EV_TOBE_DISC ); - rx_ev_pkt_type =EF4_QWORD_FIELD (*event,FSF_AZ_RX_EV_PKT_TYPE ); rx_ev_buf_owner_id_err =EF4_QWORD_FIELD (*event,FSF_AZ_RX_EV_BUF_OWNER_ID_ERR ); rx_ev_ip_hdr_chksum_err = EF4_QWORD_FIELD(*event,
@@ -893,10 +888,6 @@ static u16 ef4_farch_handle_rx_not_ok(st 0 : EF4_QWORD_FIELD(*event, FSF_AA_RX_EV_DRIB_NIB)); rx_ev_pause_frm =EF4_QWORD_FIELD (*event,FSF_AZ_RX_EV_PAUSE_FRM_ERR ); -/* Every error apart from tobe_disc and pause_frm */ - rx_ev_other_err = (rx_ev_drib_nib | rx_ev_tcp_udp_chksum_err | - rx_ev_buf_owner_id_err | rx_ev_eth_crc_err | - rx_ev_frm_trunc | rx_ev_ip_hdr_chksum_err);/* Count errors that are not in MAC stats. Ignore expected * checksum errors during self-test. */
@@ -916,6 +907,13 @@ static u16 ef4_farch_handle_rx_not_ok(st* to a FIFO overflow. */ #ifdef DEBUG + { +/* Every error apart from tobe_disc and pause_frm */ + +bool rx_ev_other_err = (rx_ev_drib_nib | rx_ev_tcp_udp_chksum_err | + rx_ev_buf_owner_id_err | rx_ev_eth_crc_err | + rx_ev_frm_trunc | rx_ev_ip_hdr_chksum_err); +if (rx_ev_other_err &&net_ratelimit ()) {netif_dbg (efx, rx_err, efx->net_dev, " RX queue %d unexpected RX event "
@@ -932,6 +930,7 @@ static u16 ef4_farch_handle_rx_not_ok(st rx_ev_tobe_disc ?" [TOBE_DISC]" :"" , rx_ev_pause_frm ? " [PAUSE]" : ""); } + }#endif /* The frame must be discarded if any of these are true. */
@@ -1643,15 +1642,11 @@ void ef4_farch_rx_push_indir_table(struc*/ void ef4_farch_dimension_resources (struct ef4_nic *efx,unsigned sram_lim_qw) { -unsigned vi_count, buftbl_min; +unsigned vi_count;/* Account for the buffer table entries backing the datapath channels * and the descriptor caches for those channels. */ - buftbl_min = ((efx->n_rx_channels *EF4_MAX_DMAQ_SIZE + - efx->n_tx_channels *EF4_TXQ_TYPES *EF4_MAX_DMAQ_SIZE + - efx->n_channels *EF4_MAX_EVQ_SIZE ) - *sizeof (ef4_qword_t) /EF4_BUF_SIZE ); vi_count =max (efx->n_channels, efx->n_tx_channels *EF4_TXQ_TYPES ); efx->tx_dc_base = sram_lim_qw - vi_count *TX_DC_ENTRIES ;
@@ -2532,7 +2527,6 @@ int ef4_farch_filter_remove_safe(structenum ef4_farch_filter_table_id table_id;struct ef4_farch_filter_table *table;unsigned int filter_idx; -struct ef4_farch_filter_spec *spec;int rc; table_id =ef4_farch_filter_id_table_id (filter_id);
@@ -2543,7 +2537,6 @@ int ef4_farch_filter_remove_safe(struct filter_idx =ef4_farch_filter_id_index (filter_id);if (filter_idx >= table->size)return -ENOENT ; - spec = &table->spec[filter_idx];spin_lock_bh (&efx->filter_lock); rc =ef4_farch_filter_remove (efx, table, filter_idx, priority);
drivers/net/ethernet/sis/sis900.c +2 -3
@@ -787,10 +787,9 @@ static u16 sis900_default_phy(struct netstatic void sis900_set_capability (struct net_device *net_dev,struct mii_phy *phy) {u16 cap; -u16 status; - status =mdio_read (net_dev, phy->phy_addr,MII_STATUS ); - status =mdio_read (net_dev, phy->phy_addr,MII_STATUS ); +mdio_read (net_dev, phy->phy_addr,MII_STATUS ); +mdio_read (net_dev, phy->phy_addr,MII_STATUS ); cap =MII_NWAY_CSMA_CD | ((phy->status & MII_STAT_CAN_TX_FDX)? MII_NWAY_TX_FDX:0) |
drivers/net/ethernet/synopsys/dwc-xlgmac-common.c +1 -1
@@ -513,7 +513,7 @@ void xlgmac_get_all_hw_features(struct xvoid xlgmac_print_all_hw_features (struct xlgmac_pdata *pdata) { -char *str =NULL ; +char __maybe_unused *str =NULL ;XLGMAC_PR ("\n" );XLGMAC_PR ("=====================================================\n" );
drivers/net/ethernet/ti/davinci_emac.c +2 -3
@@ -1226,7 +1226,7 @@ static int emac_poll(struct napi_structstruct net_device *ndev = priv->ndev;struct device *emac_dev = &ndev->dev;u32 status =0 ; -u32 num_tx_pkts =0 , num_rx_pkts =0 ; +u32 num_rx_pkts =0 ;/* Check interrupt vectors and call packet processing */ status =emac_read (EMAC_MACINVECTOR );
@@ -1237,8 +1237,7 @@ static int emac_poll(struct napi_struct mask =EMAC_DM646X_MAC_IN_VECTOR_TX_INT_VEC ;if (status & mask) { - num_tx_pkts =cpdma_chan_process (priv->txchan, -EMAC_DEF_TX_MAX_SERVICE ); +cpdma_chan_process (priv->txchan,EMAC_DEF_TX_MAX_SERVICE ); }/* TX processing */ mask =EMAC_DM644X_MAC_IN_VECTOR_RX_INT_VEC ;
drivers/net/ethernet/ti/tlan.c +1 -3
@@ -673,7 +673,6 @@ module_exit(tlan_exit);static void __init tlan_eisa_probe (void ) {long ioaddr; -int rc = -ENODEV ;int irq;u16 device_id;
@@ -738,8 +737,7 @@ static void __init tlan_eisa_probe(void/* Setup the newly found eisa adapter */ - rc =tlan_probe1 (NULL , ioaddr, irq, -12 ,NULL ); +tlan_probe1 (NULL , ioaddr, irq,12 ,NULL );continue ; out:
drivers/net/ethernet/via/via-velocity.c +0 -13
@@ -865,26 +865,13 @@ static u32 check_connection_type(struct*/ static int velocity_set_media_mode (struct velocity_info *vptr,u32 mii_status) { -u32 curr_status;struct mac_regs __iomem *regs = vptr->mac_regs; vptr->mii_status =mii_check_media_mode (vptr->mac_regs); - curr_status = vptr->mii_status & (~VELOCITY_LINK_FAIL );/* Set mii link status */ set_mii_flow_control (vptr); -/* -Check if new status is consistent with current status -if (((mii_status & curr_status) & VELOCITY_AUTONEG_ENABLE) || -(mii_status==curr_status)) { -vptr->mii_status=mii_check_media_mode(vptr->mac_regs); -vptr->mii_status=check_connection_type(vptr->mac_regs); -VELOCITY_PRT(MSG_LEVEL_INFO, "Velocity link no change\n"); -return 0; -} -*/ -if (PHYID_GET_PHY_ID (vptr->phy_id) ==PHYID_CICADA_CS8201 )MII_REG_BITS_ON (AUXCR_MDPPS ,MII_NCONFIG , vptr->mac_regs);
Greg Kroah-Hartman
maintainerPATCH 173/177 net: hns3: check the return of skb_checksum_help()
In reply to Greg Kroah-HartmanFrom: Yunsheng Lin <[email protected]>
commit 9bb5a495424fd4bfa672eb1f31481248562fa156 upstream.
Currently skb_checksum_help()'s return is ignored, but it may return error when it fails to allocate memory when linearizing.
So adds checking for the return of skb_checksum_help().
--- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-)
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c +3 -7
@@ -810,8 +810,6 @@ static bool hns3_tunnel_csum_bug(struct l4.udp->dest == htons(4790))))return false; -skb_checksum_help (skb); -return true; }
@@ -889,8 +887,7 @@ static int hns3_set_l2l3l4(struct sk_buf/* the stack computes the IP header already, * driver calculate l4 checksum when not TSO. */ -skb_checksum_help (skb); -return 0 ; +return skb_checksum_help (skb); }hns3_set_outer_l2l3l4 (skb, ol4_proto, ol_type_vlan_len_msec);
@@ -935,7 +932,7 @@ static int hns3_set_l2l3l4(struct sk_bufbreak ;case IPPROTO_UDP :if (hns3_tunnel_csum_bug (skb)) -break ; +return skb_checksum_help (skb);hns3_set_field (*type_cs_vlan_tso,HNS3_TXD_L4CS_B ,1 ); hns3_set_field(*type_cs_vlan_tso, HNS3_TXD_L4T_S,
@@ -960,8 +957,7 @@ static int hns3_set_l2l3l4(struct sk_buf/* the stack computes the IP header already, * driver calculate l4 checksum when not TSO. */ -skb_checksum_help (skb); -return 0 ; +return skb_checksum_help (skb); }return 0 ;
Greg Kroah-Hartman
maintainerPATCH 174/177 Revert "Revert "ALSA: usx2y: Fix potential NULL pointer dereference""
In reply to Greg Kroah-HartmanFrom: Greg Kroah-Hartman <[email protected]>
commit 27b57bb76a897be80494ee11ee4e85326d19383d upstream.
This reverts commit 4667a6fc1777ce071504bab570d3599107f4790f.
Takashi writes:
I have already started working on the bigger cleanup of this driver code based on 5.13-rc1, so could you drop this revert?
I missed our previous discussion about this, my fault for applying it.
--- sound/usb/usx2y/usb_stream.c | 5 +++++ 1 file changed, 5 insertions(+)
sound/usb/usx2y/usb_stream.c +5 -0
@@ -91,7 +91,12 @@ static int init_urbs(struct usb_stream_kfor (u =0 ; u <USB_STREAM_NURBS ; ++u) { sk->inurb[u] =usb_alloc_urb (sk->n_o_ps,GFP_KERNEL ); +if (!sk->inurb[u]) +return -ENOMEM ; + sk->outurb[u] =usb_alloc_urb (sk->n_o_ps,GFP_KERNEL ); +if (!sk->outurb[u]) +return -ENOMEM ; } if (init_pipe_urbs(sk, use_packsize, sk->inurb, indata, dev, in_pipe) ||
Greg Kroah-Hartman
maintainerPATCH 175/177 net: hso: bail out on interrupt URB allocation failure
In reply to Greg Kroah-HartmanFrom: Johan Hovold <[email protected]>
commit 4d52ebc7ace491d58f96d1f4a1cb9070c506b2e7 upstream.
Commit 31db0dbd7244 ("net: hso: check for allocation failure in hso_create_bulk_serial_device()") recently started returning an error when the driver fails to allocate resources for the interrupt endpoint and tiocmget functionality.
For consistency let's bail out from probe also if the URB allocation fails.
--- drivers/net/usb/hso.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/net/usb/hso.c +7 -7
@@ -2636,14 +2636,14 @@ static struct hso_device *hso_create_bul } tiocmget->urb =usb_alloc_urb (0 ,GFP_KERNEL ); -if (tiocmget->urb) { -mutex_init (&tiocmget->mutex); -init_waitqueue_head (&tiocmget->waitq); - }else -hso_free_tiomget (serial); - } -else +if (!tiocmget->urb) + goto exit; + +mutex_init (&tiocmget->mutex); +init_waitqueue_head (&tiocmget->waitq); + }else { num_urbs =1 ; + }if (hso_serial_common_create (serial, num_urbs,BULK_URB_RX_SIZE ,BULK_URB_TX_SIZE ))
Greg Kroah-Hartman
maintainerPATCH 176/177 neighbour: Prevent Race condition in neighbour subsytem
In reply to Greg Kroah-HartmanFrom: Chinmay Agarwal <[email protected]>
commit eefb45eef5c4c425e87667af8f5e904fbdd47abf upstream.
Following Race Condition was detected:
<CPU A, t0>: Executing: __netif_receive_skb() ->__netif_receive_skb_core() -> arp_rcv() -> arp_process().arp_process() calls __neigh_lookup() which takes a reference on neighbour entry 'n'.
Moves further along, arp_process() and calls neigh_update()-> __neigh_update(). Neighbour entry is unlocked just before a call to neigh_update_gc_list.
This unlocking paves way for another thread that may take a reference on the same and mark it dead and remove it from gc_list.
<CPU B, t1> - neigh_flush_dev() is under execution and calls neigh_mark_dead(n) marking the neighbour entry 'n' as dead. Also n will be removed from gc_list.
Moves further along neigh_flush_dev() and calls neigh_cleanup_and_release(n), but since reference count increased in t1, 'n' couldn't be destroyed.
<CPU A, t3>- Code hits neigh_update_gc_list, with neighbour entry set as dead.
<CPU A, t4> - arp_process() finally calls neigh_release(n), destroying the neighbour entry and we have a destroyed ntry still part of gc_list.
--- net/core/neighbour.c | 4 ++++ 1 file changed, 4 insertions(+)
net/core/neighbour.c +4 -0
@@ -132,6 +132,9 @@ static void neigh_update_gc_list(structwrite_lock_bh (&n->tbl->lock);write_lock (&n->lock); +if (n->dead) + goto out; +/* remove from the gc list if new state is permanent or if neighbor * is externally learned; otherwise entry should be on the gc list */
@@ -148,6 +151,7 @@ static void neigh_update_gc_list(structatomic_inc (&n->tbl->gc_entries); } +out:write_unlock (&n->lock);write_unlock_bh (&n->tbl->lock); }
Greg Kroah-Hartman
maintainerPATCH 177/177 usb: core: reduce power-on-good delay time of root hub
In reply to Greg Kroah-HartmanFrom: Chunfeng Yun <[email protected]>
commit 90d28fb53d4a51299ff324dede015d5cb11b88a2 upstream.
Return the exactly delay time given by root hub descriptor, this helps to reduce resume time etc.
Due to the root hub descriptor is usually provided by the host controller driver, if there is compatibility for a root hub, we can fix it easily without affect other root hub
--- drivers/usb/core/hub.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/usb/core/hub.h +4 -2
@@ -148,8 +148,10 @@ static inline unsigned hub_power_on_good {unsigned delay = hub->descriptor->bPwrOn2PwrGood *2 ; -/* Wait at least 100 msec for power to become stable */ -return max (delay,100U ); +if (!hub->hdev->parent)/* root hub */ +return delay; +else /* Wait at least 100 msec for power to become stable */ +return max (delay,100U ); } static inline int hub_port_debounce_be_connected(struct usb_hub *hub,
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.4.124 release. There are 177 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed, 02 Jun 2021 13:06:20 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 9 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.4.124-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.4.y
and the diffstat can be found below.thanks,
greg k-h
Tested on arm64 and x86 for 5.4.124-rc1,
Kernel repo:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
Branch: linux-5.4.y
Version: 5.4.124-rc1
Commit: 4142e74be32ee4ca40200301fcabfca32800f9c5
Compiler: gcc version 7.3.0 (GCC)
arm64:
--------------------------------------------------------------------
Testcase Result Summary:
total: 8897
passed: 8897
failed: 0
timeout: 0
--------------------------------------------------------------------
x86:
--------------------------------------------------------------------
Testcase Result Summary:
total: 8897
passed: 8897
failed: 0
timeout: 0
--------------------------------------------------------------------
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.4.124 release. There are 177 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed, 02 Jun 2021 13:06:20 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.4.124-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.4.y
and the diffstat can be found below.thanks,
greg k-h
On ARCH_BRCMSTB, using 32-bit and 64-bit ARM kernels:
Signature · 1 line
Florian
Quoted 10 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.4.124 release. There are 177 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed, 02 Jun 2021 13:06:20 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.4.124-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.4.y
and the diffstat can be found below.thanks,
greg k-h
Results from Linaro’s test farm.
No regressions on arm64, arm, x86_64, and i386.
## Build
* kernel: 5.4.124-rc1
* git: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
* git branch: linux-5.4.y
* git commit: 4142e74be32ee4ca40200301fcabfca32800f9c5
* git describe: v5.4.122-186-g4142e74be32e
* test details:
https://qa-reports.linaro.org/lkft/linux-stable-rc-linux-5.4.y/build/v5.4.122-186-g4142e74be32e
## No regressions (compared to v5.4.122-8-g69500752c057)
## No fixes (compared to v5.4.122-8-g69500752c057)
## Test result summary
total: 70304, pass: 58035, fail: 849, skip: 10732, xfail: 688,
## Build Summary
* arc: 10 total, 10 passed, 0 failed
* arm: 192 total, 192 passed, 0 failed
* arm64: 26 total, 26 passed, 0 failed
* i386: 14 total, 14 passed, 0 failed
* mips: 45 total, 45 passed, 0 failed
* parisc: 9 total, 9 passed, 0 failed
* powerpc: 27 total, 27 passed, 0 failed
* riscv: 21 total, 21 passed, 0 failed
* s390: 9 total, 9 passed, 0 failed
* sh: 18 total, 18 passed, 0 failed
* sparc: 9 total, 9 passed, 0 failed
* x86_64: 26 total, 26 passed, 0 failed
## Test suites summary
* fwts
* igt-gpu-tools
* kselftest-android
* kselftest-breakpoints
* kselftest-capabilities
* kselftest-cgroup
* kselftest-clone3
* kselftest-core
* kselftest-cpu-hotplug
* kselftest-cpufreq
* kselftest-drivers
* kselftest-efivarfs
* kselftest-filesystems
* kselftest-firmware
* kselftest-fpu
* kselftest-futex
* kselftest-gpio
* kselftest-intel_pstate
* kselftest-ipc
* kselftest-ir
* kselftest-kcmp
* kselftest-kvm
* kselftest-lib
* kselftest-livepatch
* kselftest-lkdtm
* kselftest-membarrier
* kselftest-memfd
* kselftest-memory-hotplug
* kselftest-mincore
* kselftest-mount
* kselftest-mqueue
* kselftest-net
* kselftest-netfilter
* kselftest-nsfs
* kselftest-openat2
* kselftest-pid_namespace
* kselftest-pidfd
* kselftest-proc
* kselftest-pstore
* kselftest-ptrace
* kselftest-rseq
* kselftest-rtc
* kselftest-seccomp
* kselftest-sigaltstack
* kselftest-size
* kselftest-splice
* kselftest-static_keys
* kselftest-sync
* kselftest-sysctl
* kselftest-timens
* kselftest-timers
* kselftest-tmpfs
* kselftest-tpm2
* kselftest-user
* kselftest-vm
* kselftest-x86
* kselftest-zram
* kvm-unit-tests
* libhugetlbfs
* linux-log-parser
* ltp-cap_bounds-tests
* ltp-commands-tests
* ltp-containers-tests
* ltp-controllers-tests
* ltp-cpuhotplug-tests
* ltp-crypto-tests
* ltp-cve-tests
* ltp-dio-tests
* ltp-fcntl-locktests-tests
* ltp-filecaps-tests
* ltp-fs-tests
* ltp-fs_bind-tests
* ltp-fs_perms_simple-tests
* ltp-fsx-tests
* ltp-hugetlb-tests
* ltp-io-tests
* ltp-ipc-tests
* ltp-math-tests
* ltp-mm-tests
* ltp-nptl-tests
* ltp-open-posix-tests
* ltp-pty-tests
* ltp-sched-tests
* ltp-securebits-tests
* ltp-syscalls-tests
* ltp-tracing-tests
* network-basic-tests
* packetdrill
* perf
* rcutorture
* v4l2-compliance
--
Naresh Kamboju
https://lkft.linaro.org
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.4.124 release. There are 177 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed, 02 Jun 2021 13:06:20 +0000. Anything received after that time might be too late.
Build results:
total: 157 pass: 157 fail: 0 Qemu test results: total: 428 pass: 428 fail: 0
Guenter