Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp98465lqt; Wed, 5 Jun 2024 19:13:54 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWcldP/bDR8tNBQ7abxvE7OLw9VeJ1cJJc3fgM6I/+A/sC+yyP9P7h/23WSBfAD7h/cwFBfFaXHQFV3Zwu+Yxlsv08PPMOSoACGlp/MLg== X-Google-Smtp-Source: AGHT+IFqNjqenRdjK0bzHqAQwPj57SK2nTDQbpJQQQwEk9MRLmUTWAjMuRTphqgCCESsUB5QaOVt X-Received: by 2002:a05:622a:255:b0:43e:39db:360e with SMTP id d75a77b69052e-4402b6b5415mr50486641cf.65.1717640033870; Wed, 05 Jun 2024 19:13:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717640033; cv=pass; d=google.com; s=arc-20160816; b=bEi7ZDA6QiPUtNCXYkddaDDQ5uVJmf/PEocU47ScJMPhOy2nqu9N7fMkRvu/BLLm7P Ur0lHnuHu5tYV8flpPNvrsqtxL9d5QsOf/sU9AQafZNRMwXK8IxNZDNg7ojIgOBTWpru N3hu8EsHo6AuR1/TzXnie3f+5muvWNCYiOcD+MVFmcRfnaZ0q46tJunUF/W8PWhPHn5L Ddk7dskOnuFfH9b9I+tgymRsJAFqd40w6gWElABd4IjIRQFUD+72c5oujfvw6kSDvtPC D7tY+kBe+alYCvPNYGlXRgO6PKiGupr3drZGeD7WRLcLxz0t4YQ54h70QoNQi3272JjX 7USQ== 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:from:date:dkim-signature; bh=fRVnmlsc7QNkh6mX1rqWyPONrK5lstvoABVQOrhbpTU=; fh=4q8anW0BU2GjoE8wDb9Ygkn4kU34qchNnduE5MotJys=; b=CxZzP/FBjNs+/Cfv/ZkyA2NFh6ds+L6LdfiDU03LeCjFDFMXy1K8IZRJtGC5lxPCbj aXXM14h5jf8CNIgxp6odnqr1MDqYeljTsiykPvGARtxHXymqeXRVFwY5pnK6iSktWBrI U3bPE3LKBJt+xVYcj1w5iLv/Nofox39DugYLPLe4SMYI1M0x2THgBiDfWQ9DAxjAm1Gn t0EbclB4ywi0chs4gpEkzRSZKqJjUYG4yxLWE2elbtZGwCTwAcNaJubegoTaSCqEZTKF IoYcottESYSJD8EyMvozIRl6vyU/6ezZyKNF/1pZyzc2YfOKbf6XaOfy0DEDUUTmM3ID +AFQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="Ft/AAXQ1"; 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-203526-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203526-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 d75a77b69052e-44038b89ae1si4993131cf.785.2024.06.05.19.13.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 19:13:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-203526-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/AAXQ1"; 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-203526-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203526-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 5ECB81C22E78 for ; Thu, 6 Jun 2024 02:13:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B1622182BB; Thu, 6 Jun 2024 02:13:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Ft/AAXQ1" Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) (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 96F5B1758D; Thu, 6 Jun 2024 02:13:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717640021; cv=none; b=u3+TAowk9RKpIhpJEVVNS53uO7bGf3SwB9WRLTSuEdm1JTgiZBlG8bEeD4Air9opK7Vna24tT41p3F4yo0b0HRni48L5NBuDNedflY8WD9vv1+d2cqn+YptM6LLCWtJvOEs1lVTdIsbPFICw+oxR/dQSvXD5GDltqlEoo8Kuz+w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717640021; c=relaxed/simple; bh=dH5Lo1JA8dLCZsYd45JVwDzDzX4JrpI0pIOa2GxHYEQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=GjNUH0hCW3TSTutl+nFpjeE2w4Pbw00JboWOu8vzix+Xuv3kE0rs7v4PAdDIY4yQPgy7gKFwG4U9WfFoOo4ckfa1mky6d/MPRIj8hy0enxJM5nbfKA6v3dZNscm2BDAmYuGLbRmb8RPx+9HbEecPl0lp1tCy3F87ZYyEUGIhe7I= 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/AAXQ1; arc=none smtp.client-ip=209.85.214.172 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-pl1-f172.google.com with SMTP id d9443c01a7336-1f6342c5faaso4400855ad.2; Wed, 05 Jun 2024 19:13:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717640020; x=1718244820; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=fRVnmlsc7QNkh6mX1rqWyPONrK5lstvoABVQOrhbpTU=; b=Ft/AAXQ17hRYjoUM2exvMytWAm1Gep1YSN2yLh8AciKwJJ1C+UiNhEmWMGGrneW40g oHeW155DzQbDIn3YP0RYegOcJZO/mKooKONHnXL1CcLfiMebhw5VCpgS84xHNThjqXOJ WTnbyv3J5Z16ymjFDWNUiNyDEiyzxlbVFpafj+0tIzC8WSF+wI+GOqvNM82ypi0ue+M3 hNRMnySM3X7vNPHpo7P5fXU6vs6F9zS3afy2UBanLNM7FM5BPLgyD8r6HN9qN5GyVkiF /yk/WJP8jMwSa1BfRUX/fXADQEMDoKexuJ7YuIEjUH9g44UJOC9ndJ40gV8HiYcNqB5K PZrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717640020; x=1718244820; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=fRVnmlsc7QNkh6mX1rqWyPONrK5lstvoABVQOrhbpTU=; b=hI7s3slykKZu+5RD0OTqASjDDMDdeqAhm5XgstbE+VkHjlvjFEzCJbaPt60QRnCSFq 0tq0By27GmYlsCvZ1eAlwujENcd1z9iwM5RjPOdqk8V7BiK0MjCP4pvpreuHsyW5lWWf tayJ5wFA9pOaIv/das318KoW+VPz1woPHGe+ZCxQ4ZbAQ2tYz9oqDQ5QENRXrWPFi97A HWWpSKp4jTd22pNhrhYUQtsg8h+FkRmhGBIXm1aw8N2Z4TKRCu1QOeKOUJ6eb4KzMTjf fea3E7es6bzCn3RUK0tyPTViPpQwd8bIJ5YOj+vnBtGSMXTZx9GmcwHv04YLKFETSxZi vj0Q== X-Forwarded-Encrypted: i=1; AJvYcCVxYkeJFt3C2n+CuepP/NEBHRif0xAvDHLzDqxuxtCgOsGkfkKaMxjK3tS5N9+CoAp+JZn0tttSKlwjGLCqgTzgd2ZmzUbxiyQt+0aO4lrjhYacB+vfke2Mvw967f1x2LLPEq3+OkSaqpvkycWDr0fMbTI39z4J7YMLvXRIlBtzZ4Vqjd1f X-Gm-Message-State: AOJu0Yz0Yic2tDm2EOJ19Qa7OAGOcLi/CYrXaTGKfrgPTw61uyxW3L6l aqfcoxwu/PsolMSsouX24z9+r2X6RZUp6Rlm5AWnpauAltLYksx8 X-Received: by 2002:a17:902:da87:b0:1f6:673c:ff2f with SMTP id d9443c01a7336-1f6a5a8785fmr47274225ad.68.1717640019818; Wed, 05 Jun 2024 19:13:39 -0700 (PDT) Received: from Laptop-X1 ([2409:8a02:782b:80e0:aaca:87fa:f402:cc0f]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f6bd7ccfacsm2226765ad.167.2024.06.05.19.13.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 19:13:39 -0700 (PDT) Date: Thu, 6 Jun 2024 10:13:34 +0800 From: Hangbin Liu To: "Matthieu Baerts (NGI0)" Cc: mptcp@lists.linux.dev, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Shuah Khan , Petr Machata , netdev@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Geliang Tang Subject: Re: [PATCH net 3/3] selftests: net: lib: set 'i' as local Message-ID: References: <20240605-upstream-net-20240605-selftests-net-lib-fixes-v1-0-b3afadd368c9@kernel.org> <20240605-upstream-net-20240605-selftests-net-lib-fixes-v1-3-b3afadd368c9@kernel.org> 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: <20240605-upstream-net-20240605-selftests-net-lib-fixes-v1-3-b3afadd368c9@kernel.org> On Wed, Jun 05, 2024 at 11:21:18AM +0200, Matthieu Baerts (NGI0) wrote: > Without this, the 'i' variable declared before could be overridden by > accident, e.g. > > for i in "${@}"; do > __ksft_status_merge "${i}" ## 'i' has been modified > foo "${i}" ## using 'i' with an unexpected value > done > > After a quick look, it looks like 'i' is currently not used after having > been modified in __ksft_status_merge(), but still, better be safe than > sorry. I saw this while modifying the same file, not because I suspected > an issue somewhere. > > Fixes: 596c8819cb78 ("selftests: forwarding: Have RET track kselftest framework constants") > Acked-by: Geliang Tang > Signed-off-by: Matthieu Baerts (NGI0) > --- > tools/testing/selftests/net/lib.sh | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/tools/testing/selftests/net/lib.sh b/tools/testing/selftests/net/lib.sh > index e2f51102d7e1..9155c914c064 100644 > --- a/tools/testing/selftests/net/lib.sh > +++ b/tools/testing/selftests/net/lib.sh > @@ -27,6 +27,7 @@ __ksft_status_merge() > local -A weights > local weight=0 > > + local i > for i in "$@"; do > weights[$i]=$((weight++)) > done > > -- > 2.43.0 > Reviewed-by: Hangbin Liu