Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp4383636pxy; Tue, 27 Apr 2021 03:54:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxKP7w2ERdQNErj7DlpvdPPMwpNxkZ4UUW49pDMMhpskIxa3E/wEK4jcdRuzjiR3mh1Z/uO X-Received: by 2002:a17:90a:6c88:: with SMTP id y8mr27582210pjj.38.1619520844913; Tue, 27 Apr 2021 03:54:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619520844; cv=none; d=google.com; s=arc-20160816; b=yB7SO/2NAKTWYpyE/7dVD1Eyv4gpG5youkyULZbkvk756Z7OEis74/74SYnZqvraK/ QHqKi97c1nSZLM08riGOz2vBYkMrj8KVo49f6R5JLPSMSnIdYPiUcq/tOMh7ZDMdCmMc R6c61VfqejQGVJ6pHS/7pFK8UPbio+U/p1KSduytSJe+1ndZYufWgioyzlU8LFn+F3nB qAcXC1AcCy0jvBp2geDhW0iS5iBa5tfGOPUAwDmbEgVix+yrQwDFs1oPvmtfmdnuVz3A lyR3EAoBTe3y8WB487Mi9fciwp4bwG6m5OS7SI3AHeTP5c4c+Prmexh42m0/k1PWec79 31qA== 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=ce3x5NXtUNDhl9k6Vw4RIPTPNd4lJt2TUSs4aXOf8ZY=; b=LzfparQXE+QTirBA9Ckg2DNregktgWZNvxXRFokWywtISdwbHUgwAUGGvOE8LQqOeN 82bpHzpp5AYk5V9cod5lVcuDY00vqUhwq0eO4YdJ8HoFBXntsBQowSF1itYch8GVStIi waeIQvIshAIwT3+7F8W0Q/kLF/HqUUhMN2h7EzqRvpUB/n9JB2BxZLbn/c6zSHfAPIfC CIcyqClmf2ZEpu23gKbOpvAq76JzpsHi01jCxPTP4op3Ljxf4UITu+bJFS5dHW4qKtTA D6UubsUEuTXJcOQbmA95PWM64s2wfvqpoNdJJUwKc2H3JylgrgHA5pdtAigvmC5N4Ujq Pxlw== 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 f16si22139692plr.282.2021.04.27.03.53.52; Tue, 27 Apr 2021 03:54:04 -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 S235594AbhD0Kxn (ORCPT + 99 others); Tue, 27 Apr 2021 06:53:43 -0400 Received: from out4436.biz.mail.alibaba.com ([47.88.44.36]:55943 "EHLO out4436.biz.mail.alibaba.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230365AbhD0Kxn (ORCPT ); Tue, 27 Apr 2021 06:53:43 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R381e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04400;MF=jiapeng.chong@linux.alibaba.com;NM=1;PH=DS;RN=8;SR=0;TI=SMTPD_---0UWzhUGU_1619520768; Received: from j63c13417.sqa.eu95.tbsite.net(mailfrom:jiapeng.chong@linux.alibaba.com fp:SMTPD_---0UWzhUGU_1619520768) by smtp.aliyun-inc.com(127.0.0.1); Tue, 27 Apr 2021 18:52:57 +0800 From: Jiapeng Chong To: wg@grandegger.com Cc: mkl@pengutronix.de, davem@davemloft.net, kuba@kernel.org, linux-can@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Jiapeng Chong Subject: [PATCH v2] can: softing: Remove redundant variable ptr Date: Tue, 27 Apr 2021 18:52:47 +0800 Message-Id: <1619520767-80948-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 The value stored to ptr in the calculations this patch removes is not used, so the calculation and the assignment can be removed. Cleans up the following clang-analyzer warning: drivers/net/can/softing/softing_main.c:279:3: warning: Value stored to 'ptr' is never read [clang-analyzer-deadcode.DeadStores]. drivers/net/can/softing/softing_main.c:242:3: warning: Value stored to 'ptr' is never read [clang-analyzer-deadcode.DeadStores]. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong --- Changes in v2: -Make the commit message more clearer. drivers/net/can/softing/softing_main.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/net/can/softing/softing_main.c b/drivers/net/can/softing/softing_main.c index c44f341..cfc1325 100644 --- a/drivers/net/can/softing/softing_main.c +++ b/drivers/net/can/softing/softing_main.c @@ -239,7 +239,6 @@ static int softing_handle_1(struct softing *card) DPRAM_INFO_BUSSTATE2 : DPRAM_INFO_BUSSTATE]); /* timestamp */ tmp_u32 = le32_to_cpup((void *)ptr); - ptr += 4; ktime = softing_raw2ktime(card, tmp_u32); ++netdev->stats.rx_errors; @@ -276,7 +275,6 @@ static int softing_handle_1(struct softing *card) ktime = softing_raw2ktime(card, tmp_u32); if (!(msg.can_id & CAN_RTR_FLAG)) memcpy(&msg.data[0], ptr, 8); - ptr += 8; /* update socket */ if (cmd & CMD_ACK) { /* acknowledge, was tx msg */ -- 1.8.3.1