Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2507619pxj; Mon, 17 May 2021 03:18:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyQ5a/zBeqt+yiH6Zc/7o50oDKQGgTLx/kJ8WlaVEWikWeG/aZvYCvRb3Lk+mXPrEOF6Q67 X-Received: by 2002:a17:906:134e:: with SMTP id x14mr5677757ejb.190.1621246730240; Mon, 17 May 2021 03:18:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621246730; cv=none; d=google.com; s=arc-20160816; b=yB32mkRjOFFROpE+j9LUCDspQG3dDNof3vS+883lXsciJ2rhpCxr4VVlwguEAGvbGP Ld7yJaq5bWtUQ7Oz+5363hu5+L1SoMe/2efQerRijiMZJoh5IdUoQOBEP19Hg3H2v663 kEaeMc7/295yT5vzRKsrpKftDb3REhGeyWAzHAoCigNJ0mybSGNFhK9WrxcU1DXwuYeO egb5hChOesXoqc7gwJejFY6rew6HM9I7osG+/PUWNzEis2g2BR5I/tKopqcQ1qx6roJW XoUkk+NWwoX/q1HXSjgEd5FbktGdRre9GcL3H5FWVx3ITrTyENSyijNkwu8s8vB4fLkb ALhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=aCQZbzYb4HR89MayzjhIpukI0rHxfaqZWC6KNFOCUWs=; b=D/uwxd8b38MjvkCGH54rnPqBwtCBQ4ti5gzRRxxg07nsfjYj4SFdp3cae/MHgF1BT7 x/Ykd3VI6znYWsmORBs1gHQ4RX5m5WxX8NaZnj2M9hImNs6ly5njcfRge810oh8Fe6Cz TGaGY7L6z0REdudzNEeYRrDvSRILhOL2meqnHMuVo6mwKrDUIBqFS6bds/GCfA4NSQ3x D8WbiCyb0sly1tIBCvQZyjDejB9/mpm97tmkGVMHFQ/+yAgophrW6cEZR0PTHTlodK0R Qw7irT0HGdil2Voq1Cbxwp/jJxfptE3SOPApWa+OsgBMSsJew9ZpBhPHBZJO/J7SlkIZ c9+Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f10si4029884ejd.180.2021.05.17.03.18.26; Mon, 17 May 2021 03:18:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236350AbhEQKR0 (ORCPT + 99 others); Mon, 17 May 2021 06:17:26 -0400 Received: from out4436.biz.mail.alibaba.com ([47.88.44.36]:42459 "EHLO out4436.biz.mail.alibaba.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236352AbhEQKRA (ORCPT ); Mon, 17 May 2021 06:17:00 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R671e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04420;MF=jiapeng.chong@linux.alibaba.com;NM=1;PH=DS;RN=14;SR=0;TI=SMTPD_---0UZ9B-kz_1621246526; Received: from j63c13417.sqa.eu95.tbsite.net(mailfrom:jiapeng.chong@linux.alibaba.com fp:SMTPD_---0UZ9B-kz_1621246526) by smtp.aliyun-inc.com(127.0.0.1); Mon, 17 May 2021 18:15:32 +0800 From: Jiapeng Chong To: davem@davemloft.net Cc: kuba@kernel.org, ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, kafai@fb.com, songliubraving@fb.com, yhs@fb.com, john.fastabend@gmail.com, kpsingh@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, Jiapeng Chong Subject: [PATCH] net/packet: Remove redundant assignment to ret Date: Mon, 17 May 2021 18:15:25 +0800 Message-Id: <1621246525-65683-1-git-send-email-jiapeng.chong@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Variable ret is set to '0' or '-EBUSY', but this value is never read as it is not used later on, hence it is a redundant assignment and can be removed. Clean up the following clang-analyzer warning: net/packet/af_packet.c:3936:4: warning: Value stored to 'ret' is never read [clang-analyzer-deadcode.DeadStores]. net/packet/af_packet.c:3933:4: warning: Value stored to 'ret' is never read [clang-analyzer-deadcode.DeadStores]. No functional change. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong --- net/packet/af_packet.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index ae906eb..71dd6b9 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c @@ -3929,12 +3929,9 @@ static void packet_flush_mclist(struct sock *sk) return -EFAULT; lock_sock(sk); - if (po->rx_ring.pg_vec || po->tx_ring.pg_vec) { - ret = -EBUSY; - } else { + if (!po->rx_ring.pg_vec && !po->tx_ring.pg_vec) po->tp_tx_has_off = !!val; - ret = 0; - } + release_sock(sk); return 0; } -- 1.8.3.1