Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3347384pxj; Tue, 1 Jun 2021 03:16:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwbipGQMIvWqG2WMI/7Orakr6l1rw9bIj5HTfd0W849v9alUZlB9LPH45ED0+KMLdsC0KP0 X-Received: by 2002:a17:906:1dc2:: with SMTP id v2mr28726423ejh.8.1622542566391; Tue, 01 Jun 2021 03:16:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622542566; cv=none; d=google.com; s=arc-20160816; b=Ph1u6jZu8/AJp82saP8d3zfiwiD0q0jQ55Lhj/QgnvjTidLvAejnr0Q6AKWNsH9ZNz /qFZg1ZNBK0viQ29sCThE+HUiwGmhEqUQx+sKwCo6/54NQVLVFnD7dm/Mbmkv5BH673B 87xhO/MYZ82zBkhrAfFcwMKMt5IAunf2y8IHY9aBt4sJsYSZPeJvtgYLY3h78xFcW3W/ eCj/86x6aArIQJwgvWc5xgOH19joA+mPw5h3GEFYFUw2AK0tHGj5fjBg9VJBj8ujtyuM +dLHc8c45T0sf6GL2ShbrM1iLuFsbcAl76HNkd6oNSFfWKXlfyOpDftM+vKOoUKmA5Rm twWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=qKI7EcbsXTHO2QTIMScd8fUBWjbGKBIAk+4ExxlIwok=; b=T692b/RFpzcM2LKpKgAGGsCCu8ZXUhpTFwN1ZNHfok7PMWIgp5hZp56t3psNsZvTBC NqLvH6EgNAof7CJ2Ud+n1g2TM+mC8PT+eFuSqGgM6OX3soWD/5ID4w2HPn58s4Ci5d4Z 051sJNxgKglg5GHsxPZLxlNDtsml+VXNSxs6VbysYyUju9LM0sNvjp0fU7NUU/45z3zL jIFA+/jr6PxMk7rqVn7rcIIOkYXN3tfYoSL2buuPTffAjEPUF9zbej5VG2yfDSFSEXXD 3hD8MDBSoAVOJnaxPhNAazEDTCgHSuwMXjaf+bidZyzZ3YtEWlPwEmzRJv8qKST8xaA+ b2pg== 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=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u23si7934852ejt.28.2021.06.01.03.15.42; Tue, 01 Jun 2021 03:16:06 -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=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233126AbhFAKNC (ORCPT + 99 others); Tue, 1 Jun 2021 06:13:02 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:39423 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231228AbhFAKNC (ORCPT ); Tue, 1 Jun 2021 06:13:02 -0400 Received: from mail-wr1-f69.google.com ([209.85.221.69]) by youngberry.canonical.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1lo1Mm-0006fi-7M for linux-kernel@vger.kernel.org; Tue, 01 Jun 2021 10:11:20 +0000 Received: by mail-wr1-f69.google.com with SMTP id k25-20020a5d52590000b0290114dee5b660so2975520wrc.16 for ; Tue, 01 Jun 2021 03:11:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=qKI7EcbsXTHO2QTIMScd8fUBWjbGKBIAk+4ExxlIwok=; b=X39NaJnMK/gdMqCNTIbpSVTsNDaVUVaDlGrfP59EwM3vfqCfNMp4S+14DGvEMMFeub CQOSm3CjsykGYVdMJuhsbCcfWFVjHBYXihBIv3PyiGfZ8Mx2xl/oeCes3D9m4u4MsyUI jObq4si5a9CNMUg6bN4ehaHGuHLMdVNvi7J7kK9EPqqqXYBslPQQBJrpRZsFpfnBpxkL cflJSYfxZmQAqdJeRj/TW4PqMtbXwnr9t1e9xsVxpOdno0N/ospJVbXyz/6QGaj6Hm7J ZS57XQSH3ADYB40aV3u5OOf1vYWP104+bMj2lCyn/6KxlnUp17ovw/uuzeYb1VSdn2mp YyaA== X-Gm-Message-State: AOAM530HujxjHQmhalthFGTK5gzneqEuOwsDiaZVgfhqKbiDxWCl2lV/ OFVODd17zqh0/ojW9a1FDseO0RxYohrsygbfpFrlAx07t09/aiNLvbi/tGzIJGRa6mPzeBGrnV9 eh18OSPt89RcXB9F7SBGmithMCElFyOQ86e+aubDaDA== X-Received: by 2002:adf:f5c9:: with SMTP id k9mr8718699wrp.180.1622542279879; Tue, 01 Jun 2021 03:11:19 -0700 (PDT) X-Received: by 2002:adf:f5c9:: with SMTP id k9mr8718687wrp.180.1622542279772; Tue, 01 Jun 2021 03:11:19 -0700 (PDT) Received: from [192.168.1.115] (xdsl-188-155-185-9.adslplus.ch. [188.155.185.9]) by smtp.gmail.com with ESMTPSA id 30sm2746863wrl.37.2021.06.01.03.11.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 01 Jun 2021 03:11:19 -0700 (PDT) Subject: Re: [PATCH] NFC: nci: Remove redundant assignment to len To: Yang Li Cc: davem@davemloft.net, kuba@kernel.org, nathan@kernel.org, ndesaulniers@google.com, linux-nfc@lists.01.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com References: <1622540990-102660-1-git-send-email-yang.lee@linux.alibaba.com> From: Krzysztof Kozlowski Message-ID: Date: Tue, 1 Jun 2021 12:11:18 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <1622540990-102660-1-git-send-email-yang.lee@linux.alibaba.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/06/2021 11:49, Yang Li wrote: > Variable 'len' is set to conn_info->max_pkt_payload_len but this > value is never read as it is overwritten with a new value later on, > hence it is a redundant assignment and can be removed. > > Clean up the following clang-analyzer warning: > > net/nfc/nci/hci.c:164:3: warning: Value stored to 'len' is never read > [clang-analyzer-deadcode.DeadStores] > > Reported-by: Abaci Robot > Signed-off-by: Yang Li > --- > net/nfc/nci/hci.c | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/net/nfc/nci/hci.c b/net/nfc/nci/hci.c > index 9686514..d6732e5 100644 > --- a/net/nfc/nci/hci.c > +++ b/net/nfc/nci/hci.c > @@ -161,8 +161,6 @@ static int nci_hci_send_data(struct nci_dev *ndev, u8 pipe, > *(u8 *)skb_push(skb, 1) = data_type; > > do { > - len = conn_info->max_pkt_payload_len; > - > /* If last packet add NCI_HFP_NO_CHAINING */ > if (i + conn_info->max_pkt_payload_len - > (skb->len + 1) >= data_len) { > Reviewed-by: Krzysztof Kozlowski Best regards, Krzysztof