Message ID | 20200921131026.91790-1-miaoqinglang@huawei.com |
---|---|
State | New |
Headers | show |
Series | [-next] enetc: simplify the return expression of enetc_vf_set_mac_addr() | expand |
>-----Original Message----- >From: Qinglang Miao <miaoqinglang@huawei.com> >Sent: Monday, September 21, 2020 4:10 PM >To: Claudiu Manoil <claudiu.manoil@nxp.com> >Cc: David S. Miller <davem@davemloft.net>; Jakub Kicinski ><kuba@kernel.org>; netdev@vger.kernel.org; linux-kernel@vger.kernel.org; >Qinglang Miao <miaoqinglang@huawei.com> >Subject: [PATCH -next] enetc: simplify the return expression of >enetc_vf_set_mac_addr() > >Simplify the return expression. > >Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com> Reviewed-by: Claudiu Manoil <claudiu.manoil@nxp.com>
From: Qinglang Miao <miaoqinglang@huawei.com> Date: Mon, 21 Sep 2020 21:10:26 +0800 > Simplify the return expression. > > Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com> Applied.
diff --git a/drivers/net/ethernet/freescale/enetc/enetc_vf.c b/drivers/net/ethernet/freescale/enetc/enetc_vf.c index f14576212..7b5c82c7e 100644 --- a/drivers/net/ethernet/freescale/enetc/enetc_vf.c +++ b/drivers/net/ethernet/freescale/enetc/enetc_vf.c @@ -78,16 +78,11 @@ static int enetc_vf_set_mac_addr(struct net_device *ndev, void *addr) { struct enetc_ndev_priv *priv = netdev_priv(ndev); struct sockaddr *saddr = addr; - int err; if (!is_valid_ether_addr(saddr->sa_data)) return -EADDRNOTAVAIL; - err = enetc_msg_vsi_set_primary_mac_addr(priv, saddr); - if (err) - return err; - - return 0; + return enetc_msg_vsi_set_primary_mac_addr(priv, saddr); } static int enetc_vf_set_features(struct net_device *ndev,
Simplify the return expression. Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com> --- drivers/net/ethernet/freescale/enetc/enetc_vf.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)