Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp5174170pxu; Thu, 10 Dec 2020 15:09:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJyv1IRPuEnEob4tvmeaGOXhlE5Cck8xNJlAPZ2v5LiO0yoAplheM+SHbWeP4MN0W8SDivEj X-Received: by 2002:a50:d6d3:: with SMTP id l19mr9463050edj.376.1607641743985; Thu, 10 Dec 2020 15:09:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607641743; cv=none; d=google.com; s=arc-20160816; b=SM/jlnXcfcCb5KbPdgIezic9GgUHqoJ36iH5OZ7kFX3HK8sTrWWVJ1CkFDSsN6bi7z m0kdakxZ46LVQo1Klx9NDOQZJdUTmVINnHiHc8DBD/tAqoGWn8kK4XF4CJFOr4wi45K4 JuaIJ87Fs3ruy1Dm9ATI03XKIOWsdy94MM+HeSelCDIFWBkl8VxU3MQtw8WqQJKeHlCo j8LuFJMbZmPfzKQh6KMTbEol7yZzWNaiCQffIVqDmutQQ/lwNL0g8ilOGNqXsbXImGeD 8ZfCtk0V/q75nIlWZJY169LSdUilBB7p8eQ4Xofx7WdA+VraR0kQXHh7u7hy5emLNGfc sr8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=9DrlhiU6CCg8zOUru48W4/3W69Hm08iuuEh6tksy5R8=; b=Y589IFZ/K9RmvllEkYeQy9yQIHxpULHFbeFlV7FJDOcHbYvSwCHycFbBxtUbSZv0GW n+pMzLsd54qbKyfIiqGqNkqDc+RqOB0OBubl5rVf32Medq7cFZmPitKxz5sNAHMK2Khu VqVT5ms5FHV1jWKuoQ4duWvLwI+ATSjgWJMsLmynU17QkxChL8uCn+AMS3Pu1bRDK6az MMQFCGyZx/5q015VkJ0GUrBzpKqNqJHI8humYlOTVwGTJ20uQpYk9FqO2ebFqRu/MvMV aS4grlz9I+Egz+Vw6OcmHNFLwTw7UKmJUsRcAnWxYunKrLcdPcp9IunDPtkCsx+AK63P H1vg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d3si3911179edj.258.2020.12.10.15.08.41; Thu, 10 Dec 2020 15:09:03 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732287AbgLJJZJ (ORCPT + 99 others); Thu, 10 Dec 2020 04:25:09 -0500 Received: from s2.neomailbox.net ([5.148.176.60]:48109 "EHLO s2.neomailbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728371AbgLJJZJ (ORCPT ); Thu, 10 Dec 2020 04:25:09 -0500 From: Antonio Quartulli To: "Jason A. Donenfeld" , Jakub Kicinski , wireguard@lists.zx2c4.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Antonio Quartulli Subject: [PATCH] wireguard: avoid double unlikely() notation when using IS_ERR() Date: Thu, 10 Dec 2020 09:55:05 +0100 Message-Id: <20201210085505.21575-1-a@unstable.cc> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The definition of IS_ERR() already applies the unlikely() notation when checking the error status of the passed pointer. For this reason there is no need to have the same notation outside of IS_ERR() itself. Clean up code by removing redundant notation. Signed-off-by: Antonio Quartulli --- drivers/net/wireguard/device.c | 2 +- drivers/net/wireguard/socket.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireguard/device.c b/drivers/net/wireguard/device.c index a3ed49cd95c3..cd51a2afa28e 100644 --- a/drivers/net/wireguard/device.c +++ b/drivers/net/wireguard/device.c @@ -157,7 +157,7 @@ static netdev_tx_t wg_xmit(struct sk_buff *skb, struct net_device *dev) } else { struct sk_buff *segs = skb_gso_segment(skb, 0); - if (unlikely(IS_ERR(segs))) { + if (IS_ERR(segs)) { ret = PTR_ERR(segs); goto err_peer; } diff --git a/drivers/net/wireguard/socket.c b/drivers/net/wireguard/socket.c index c33e2c81635f..e9c35130846c 100644 --- a/drivers/net/wireguard/socket.c +++ b/drivers/net/wireguard/socket.c @@ -71,7 +71,7 @@ static int send4(struct wg_device *wg, struct sk_buff *skb, ip_rt_put(rt); rt = ip_route_output_flow(sock_net(sock), &fl, sock); } - if (unlikely(IS_ERR(rt))) { + if (IS_ERR(rt)) { ret = PTR_ERR(rt); net_dbg_ratelimited("%s: No route to %pISpfsc, error %d\n", wg->dev->name, &endpoint->addr, ret); @@ -138,7 +138,7 @@ static int send6(struct wg_device *wg, struct sk_buff *skb, } dst = ipv6_stub->ipv6_dst_lookup_flow(sock_net(sock), sock, &fl, NULL); - if (unlikely(IS_ERR(dst))) { + if (IS_ERR(dst)) { ret = PTR_ERR(dst); net_dbg_ratelimited("%s: No route to %pISpfsc, error %d\n", wg->dev->name, &endpoint->addr, ret); -- 2.29.2