Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp569098lqb; Wed, 29 May 2024 04:39:26 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVAPVW2q/n2PGbCON98yaCFhWkk9j+7PA2drUHCa6olKTA2ymbJwBAgM+7j1pdFoSCcN3qJ75Wc4YytwiRSlMnzsZJ//qz92qWVAFAYrw== X-Google-Smtp-Source: AGHT+IEG/acUHZt8tj9I/6dHhyf717RVP080qIairk4V1WXfIjQ9mgKCTT8uQawzwUAMw7SPVd7I X-Received: by 2002:a05:620a:29c9:b0:793:1c4:a1ed with SMTP id af79cd13be357-794ab097b3dmr1995910785a.43.1716982766166; Wed, 29 May 2024 04:39:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716982766; cv=pass; d=google.com; s=arc-20160816; b=sYHtIIyqrO6iKjXd5r9VESUHKf2eQHQ6LDdwsQpHt7ucqZBpuBpqN2C/xf0e1xSsFH t6plec5V4Nuq+tbUUF31ZtY9jMXnJYyvmTh2WvYyVGD+D0GToC9SH9mDr/Ym7yDF2Cbe F32dDrOaFrgqa/95EHgXeSeGjUxLJH+4GtezIV96MGNnke3O8RmWRLPPWEuDe9d0cVWL DqUSI7zIUlSFadVc+lZ7aD8qSZXa0Mu0WWtv13e1TkhRkRWiBSDvRSv2gq654GtxvqH+ QJTLtJMSt3XyHVNEfjspom9lHmb47XzSzZHispgOE/xylEjW3I060nSU1ZsOg2LwU0QL V7Jg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:date:from:dkim-signature; bh=bk03fDdTOYoIQcRERwwO8FkerBoy75MUxyZZ7yDSjco=; fh=+BPxZPxMjwZDc/Y0QM8+FcoaQVSspw8m6i1Fn80TJrk=; b=HcBmQJwKe4ygAJP2R/xZbKTAdmpy1+7/Rj3s27adRwdtj/8Xk4bCJwVd6DoTp+hl6/ 3FxcZOgiMxcOr0GXtB1raaawAceqJKnm2T0ZKa+xaOyJlITyj2TDg9exgH6YfZIuF17N jjbB/yNVbC+lkVJqVmsKMH8C8oudRbdxzvt+BBBFZfEm2EZhykvbI+WGDEO4iD9FJ6ie 8IClg6yoAzo/h16u2IyKwYVlwcE8MBeEyryfIPP0d2k9QxgI0qzYhk5i+Wvqa5ToHxmE 8haiwpiNfUZkVu0GhBiBgEWuoAybh4vQXe3CwDHz2TDUB1rIDLk1VkBY5/6rvD874WWx OChQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="ft/nY9Uu"; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-194033-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-194033-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id af79cd13be357-794abd43fcasi1215633385a.475.2024.05.29.04.39.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 May 2024 04:39:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-194033-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="ft/nY9Uu"; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-194033-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-194033-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id E0E951C21070 for ; Wed, 29 May 2024 11:39:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CEC1C180A68; Wed, 29 May 2024 11:39:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ft/nY9Uu" Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 63B0E13DDB1; Wed, 29 May 2024 11:39:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716982757; cv=none; b=tnTkWp4PSc6ucZT6FnyCjj43HqrRfKRUIjMxK4lI3uajPHz0CaTFhgG9nb1KMgbeDZGKFWSbdzDy5K63axROB88SaELszW6Vvc5reb8T/RqWfAgwx+EReqHPDN3W9yea2nZTBQyGdlGJ1TMlby5h7eGCNiGLQ1cHas9MyxpLG2k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716982757; c=relaxed/simple; bh=ABNoG0fHjxK7+Y4VtVxmK4PT7HekVb+DSJ6wavwbP0c=; h=From:Date:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=amKHvUriEYW6I4DLE9hFir1KLRBzgSxGiCVeGj4Sj8LsgqcLxd7KwS/nVGgV04n9Hnb5ywb5V6+5/7+Hj0qd5DMkulgME0cDZMgc/cBMJlkbeF+PLcZwHNp0BFxNLm0zbV9hflrZC2UUwdPea+ihft3JUdZ3fbEWUzhAB/wJmTc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ft/nY9Uu; arc=none smtp.client-ip=209.85.128.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-42011507a54so4845445e9.0; Wed, 29 May 2024 04:39:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716982754; x=1717587554; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:date:from:from:to:cc:subject:date:message-id:reply-to; bh=bk03fDdTOYoIQcRERwwO8FkerBoy75MUxyZZ7yDSjco=; b=ft/nY9UuxBLkBeStLTjy+s+vQrRnMzKdKWY2px1DGxY9ZumrGW/73wtI8PFsxsXsGj rg0DphCOsCMX+X504tg8/XxMrY8sgtnqheOd5/lCHRN7dqjUmqZuKx3JeeD1jo6yA/cv jkbMe8eIaz8VrQLI/x3P8uJ/SZE57l659lVTVpI7qVFIXWalTPriVpcjgoNiRIye5P1V ycxcwpOqXcAQhxWpX5iMLtRFAxkCv5lr6t71jdwt5+GO6DS3wceUoZkjDzrHdNlZt5MQ 1tIX//UHuw9v9pG5rtmowO1omGn31aq47DrNCX4BzmGfitd5WN9U9GofU3iBVOYJG2hK BhuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716982754; x=1717587554; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:date:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=bk03fDdTOYoIQcRERwwO8FkerBoy75MUxyZZ7yDSjco=; b=F+zGI5crcmmKhv7xUhVYkHN71yT16euCrzXHrqUZRxoUlIIHOP6klbJk74McVgjgl2 JRsE9anSkkeT9cpHhCorY4jGGgRCdfEWmkLTv5WViaPrbH9UsVYFDKiqk6lewFyJ1jnD az6yqqWwuk3gutlA+Zuf+Wef0/91K3F/17xtK2tfBGSQAp4XCKEuavCqJNRpH/J+s6XQ IAFf7iw08C270lzokN10erBBUnLfpXKhPTa/GKmFcbiHywpDQDeA+8uOXYrWETrf3Fzm bame3i1x5/ZCTbycAWeI+1lXbypBaWpW1UbARmK98TucNtEMFk0KA+12jRwghiVW8C01 J0Gg== X-Forwarded-Encrypted: i=1; AJvYcCW2SXuqab+2mrfQ9Ja0xo+1SFbFi9rzZBsle4FGc8nx6XoA3X9J7KJRt+T90tno0TE/QY+GVYRENCZrUHZA3yJydkxOo0FwQmz0nBE1i1vQ05XAW4djaBcRXjskvIsxM0DA814ohscLiynHabeijHfrhpgl266aZ8mG X-Gm-Message-State: AOJu0YzrIgnT7mLV+XQxTC6I0lpBMi77MP2oCpdlNyD2BoPHpfnGXXeP aWmPR6dzzC+Yh3GKHvz2TJNByr1Y6tKeLmDCthhRtT1ZXJafgme/ X-Received: by 2002:a05:600c:3514:b0:415:ff48:59fc with SMTP id 5b1f17b1804b1-42122ae4462mr14441845e9.8.1716982753497; Wed, 29 May 2024 04:39:13 -0700 (PDT) Received: from krava (2001-1ae9-1c2-4c00-726e-c10f-8833-ff22.ip6.tmcz.cz. [2001:1ae9:1c2:4c00:726e:c10f:8833:ff22]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-421089cd6f7sm177175905e9.46.2024.05.29.04.39.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 May 2024 04:39:13 -0700 (PDT) From: Jiri Olsa X-Google-Original-From: Jiri Olsa Date: Wed, 29 May 2024 13:39:10 +0200 To: Thorsten Blum Cc: Alexei Starovoitov , Daniel Borkmann , "David S. Miller" , Jakub Kicinski , Jesper Dangaard Brouer , John Fastabend , Andrii Nakryiko , Martin KaFai Lau , Eduard Zingerman , Song Liu , Yonghong Song , KP Singh , Stanislav Fomichev , Hao Luo , netdev@vger.kernel.org, bpf@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] bpf, devmap: Remove unnecessary if check in for loop Message-ID: References: <20240529101900.103913-2-thorsten.blum@toblux.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240529101900.103913-2-thorsten.blum@toblux.com> On Wed, May 29, 2024 at 12:19:01PM +0200, Thorsten Blum wrote: > The iterator variable dst cannot be NULL and the if check can be > removed. > > Remove it and fix the following Coccinelle/coccicheck warning reported > by itnull.cocci: > > ERROR: iterator variable bound on line 762 cannot be NULL > > Signed-off-by: Thorsten Blum Acked-by: Jiri Olsa jirka > --- > kernel/bpf/devmap.c | 3 --- > 1 file changed, 3 deletions(-) > > diff --git a/kernel/bpf/devmap.c b/kernel/bpf/devmap.c > index 4e2cdbb5629f..7f3b34452243 100644 > --- a/kernel/bpf/devmap.c > +++ b/kernel/bpf/devmap.c > @@ -760,9 +760,6 @@ int dev_map_redirect_multi(struct net_device *dev, struct sk_buff *skb, > for (i = 0; i < dtab->n_buckets; i++) { > head = dev_map_index_hash(dtab, i); > hlist_for_each_entry_safe(dst, next, head, index_hlist) { > - if (!dst) > - continue; > - > if (is_ifindex_excluded(excluded_devices, num_excluded, > dst->dev->ifindex)) > continue; > -- > 2.45.1 >