diff mbox series

[v2] can: softing: Remove redundant variable ptr

Message ID 1619520767-80948-1-git-send-email-jiapeng.chong@linux.alibaba.com
State New
Headers show
Series [v2] can: softing: Remove redundant variable ptr | expand

Commit Message

Jiapeng Chong April 27, 2021, 10:52 a.m. UTC
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 <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
Changes in v2:
  -Make the commit message more clearer.

 drivers/net/can/softing/softing_main.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Marc Kleine-Budde April 30, 2021, 2:22 p.m. UTC | #1
On 27.04.2021 18:52:47, Jiapeng Chong wrote:
> 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 <abaci@linux.alibaba.com>

> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>

> ---

> Changes in v2:

>   -Make the commit message more clearer.


Thanks - Applied to linux-can-next/testing

regards,
Marc

-- 
Pengutronix e.K.                 | Marc Kleine-Budde           |
Embedded Linux                   | https://www.pengutronix.de  |
Vertretung West/Dortmund         | Phone: +49-231-2826-924     |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-5555 |
diff mbox series

Patch

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 */