LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] net: hns3: remove redundant assignment of l2_hdr to itself
@ 2019-05-08 10:51 Colin King
  2019-05-08 12:13 ` Yunsheng Lin
  2019-05-08 16:44 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Colin King @ 2019-05-08 10:51 UTC (permalink / raw)
  To: Yisen Zhuang, Salil Mehta, David S . Miller, netdev
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

The pointer l2_hdr is being assigned to itself, this is redundant
and can be removed.

Addresses-Coverity: ("Evaluation order violation")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
index 18711e0f9bdf..196a3d780dcf 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
@@ -810,7 +810,7 @@ static int hns3_set_l2l3l4(struct sk_buff *skb, u8 ol4_proto,
 			   u8 il4_proto, u32 *type_cs_vlan_tso,
 			   u32 *ol_type_vlan_len_msec)
 {
-	unsigned char *l2_hdr = l2_hdr = skb->data;
+	unsigned char *l2_hdr = skb->data;
 	u32 l4_proto = ol4_proto;
 	union l4_hdr_info l4;
 	union l3_hdr_info l3;
-- 
2.20.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] net: hns3: remove redundant assignment of l2_hdr to itself
  2019-05-08 10:51 [PATCH] net: hns3: remove redundant assignment of l2_hdr to itself Colin King
@ 2019-05-08 12:13 ` Yunsheng Lin
  2019-05-08 16:44 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Yunsheng Lin @ 2019-05-08 12:13 UTC (permalink / raw)
  To: Colin King, Yisen Zhuang, Salil Mehta, David S . Miller, netdev
  Cc: kernel-janitors, linux-kernel

On 2019/5/8 18:51, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> The pointer l2_hdr is being assigned to itself, this is redundant
> and can be removed.
> 
> Addresses-Coverity: ("Evaluation order violation")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
> index 18711e0f9bdf..196a3d780dcf 100644
> --- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
> +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
> @@ -810,7 +810,7 @@ static int hns3_set_l2l3l4(struct sk_buff *skb, u8 ol4_proto,
>  			   u8 il4_proto, u32 *type_cs_vlan_tso,
>  			   u32 *ol_type_vlan_len_msec)
>  {
> -	unsigned char *l2_hdr = l2_hdr = skb->data;
> +	unsigned char *l2_hdr = skb->data;

Reviewed-by: Yunsheng Lin <linyunsheng@huawei.com>

Thanks.

>  	u32 l4_proto = ol4_proto;
>  	union l4_hdr_info l4;
>  	union l3_hdr_info l3;
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] net: hns3: remove redundant assignment of l2_hdr to itself
  2019-05-08 10:51 [PATCH] net: hns3: remove redundant assignment of l2_hdr to itself Colin King
  2019-05-08 12:13 ` Yunsheng Lin
@ 2019-05-08 16:44 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2019-05-08 16:44 UTC (permalink / raw)
  To: colin.king
  Cc: yisen.zhuang, salil.mehta, netdev, kernel-janitors, linux-kernel

From: Colin King <colin.king@canonical.com>
Date: Wed,  8 May 2019 11:51:35 +0100

> From: Colin Ian King <colin.king@canonical.com>
> 
> The pointer l2_hdr is being assigned to itself, this is redundant
> and can be removed.
> 
> Addresses-Coverity: ("Evaluation order violation")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Applied.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-05-08 16:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-08 10:51 [PATCH] net: hns3: remove redundant assignment of l2_hdr to itself Colin King
2019-05-08 12:13 ` Yunsheng Lin
2019-05-08 16:44 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).