Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp4765454ioa; Wed, 27 Apr 2022 10:35:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy9bxGbNW3CRCIrpqnch17d5QQw6bpLWmxlldMFv9Kr6otnaA/sUuLu1F6Kj4r1yMDK/rjA X-Received: by 2002:a63:e409:0:b0:382:6cc1:ae26 with SMTP id a9-20020a63e409000000b003826cc1ae26mr25690394pgi.583.1651080910866; Wed, 27 Apr 2022 10:35:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651080910; cv=none; d=google.com; s=arc-20160816; b=zBbgnkJjmDkdYvB+Gf2qw65bG2p2c+HCdKvTefppL+6Y/a0XGNy4exiISAJOtdMHxg +ctyOIu8dUaknnHk2jrLBbdpNFIaKpGELY3zU20t8N5GiKsRy8rqRiJRcm+zJhoBvaN7 DGErRB1cSojaylYoofXfN5VYUS4uK65oGnoVlULbR1t3GwAAT1G9Y15S/ZOrUwoKXrXt wMYqZsdYSGR3I/bdEQzc6d/5377d/NzCk3k42uPJnYa3wo9tmIbA4N2M28rNfXYEvr7l peQXa5tSwFuDcHYNbo1m2XrNdtpwvnXl8jd9Xi2I26KxIq8L8Mou//IWP2mLHQGYVCI9 r7Vw== 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:dkim-signature; bh=KzJMoZjWVKvEwV/GJNINKsGUom0afQp6p2J9kR2X+1A=; b=b4/VLdA7/jKe4jXdPvSbKQLf2c7vO+CpeTcZhfafopnrClLb9zdT9sgl98rwrzTFsX m1wY8OgeQUVrgnQ5+oFLjG4hGhHEocZrCULquyyFhrlhQYjRpSir2BvQYtsr6Gt7VCGu Y12D5WYEX+6XkoHkKyVqo6ZYI1TLxJqAihpfLL5SjZ2GyTMzLypUnfz0ITqiVNPqHWA8 ubXMscp0grhbzKzgNI/Xmw3khWAFOnEYXYc3df+tpWCs3Ko0sHvpoLeOWWD9BA0hGyyV 0i7WyGBINA4ypUgV4VqCuUJ8+ws9Rf9vMf91PQbWqsOzpTIeoMJX5ycPiyPSHrppQBod CLHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=lC3FpZJZ; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id j9-20020a056a00234900b0050d2678fcb8si2242459pfj.171.2022.04.27.10.35.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Apr 2022 10:35:10 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=lC3FpZJZ; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2873A2F3B7; Wed, 27 Apr 2022 10:08:22 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243828AbiD0RL3 (ORCPT + 99 others); Wed, 27 Apr 2022 13:11:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237739AbiD0RL1 (ORCPT ); Wed, 27 Apr 2022 13:11:27 -0400 Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C9FA2F01A for ; Wed, 27 Apr 2022 10:08:16 -0700 (PDT) Received: by mail-ed1-x534.google.com with SMTP id d6so2689317ede.8 for ; Wed, 27 Apr 2022 10:08:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=KzJMoZjWVKvEwV/GJNINKsGUom0afQp6p2J9kR2X+1A=; b=lC3FpZJZChRNp5v8Tjj2ytKLNkOo2nrzVgqDJDx9y8C3aVrk2qTWYs4lU+JelF0tcN n3OXD0ZI0MompxoG3ZfX8y+BNXuGt1lGMipvWHfnYCGOo+vj2/NtD1iyW0mFracMd8OQ OGMtsYexxrVZOkKSS4DRdVEZKuN8Z7/xo81dE1Fcmc6xMXKyaG/hw3up/nT1OGLwLA3s 7FnTW9FTxchyVRZr2KcYebg28OC5Z0qj9xKGKo4zjwVdDgilpLw8P6NYHsXEQHZk4hk6 3a4Nzy3tV+11mhjkJ0UBoJqbLTWVtcP8k2hqPJ+l8UK/crbi189hi/EbjL2fCi8PZifL NRkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=KzJMoZjWVKvEwV/GJNINKsGUom0afQp6p2J9kR2X+1A=; b=DX6mYJ/5fy4gfJp0yfSPqisNF49v8yiPUdlmlYAObaWCMOqLXFnuh+1+BCHVZtx5bc Ev8CLrXuBp4vhlqs1jRRo1b6SNq5G0ujUEpUQBICEqLjSemYDeY7A9XJUuGQIxfzsnry fv0SySZepZ/6iN6dkVyHi21LrsYnF8eQbKC5e8D4Bn9+Py0+Mo9HCGKnaJJO4PCY81ea 4DjH52aAYPXh/941zB4ylFXTLsT5UQz//rq39Wy8j40QWQFLHuznSGe7ns7u9zO5OdpA dYbC4LFW2WfODS5d3+w3kXabwomWHdeBGK8VbxgRfxJc/W2BpCkKg7lQndFeZPPKV2qw 8auw== X-Gm-Message-State: AOAM530wcv4TGIiaEBZM6iFUV5DCR9IIabzEzFPd/aAirKS8TfoDG4y5 VHXlbx+hMtikqVDcEWG+xes= X-Received: by 2002:a05:6402:26c5:b0:425:f7f0:fb6c with SMTP id x5-20020a05640226c500b00425f7f0fb6cmr11705055edd.133.1651079294833; Wed, 27 Apr 2022 10:08:14 -0700 (PDT) Received: from localhost.localdomain (i130160.upc-i.chello.nl. [62.195.130.160]) by smtp.googlemail.com with ESMTPSA id z3-20020a50cd03000000b00425d72fd0besm6694359edi.97.2022.04.27.10.08.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Apr 2022 10:08:14 -0700 (PDT) From: Jakob Koschel To: Steven Rostedt Cc: Ingo Molnar , linux-kernel@vger.kernel.org, Jakob Koschel Subject: [PATCH v2 0/4] Remove usage of list iterator after the loop body Date: Wed, 27 Apr 2022 19:07:30 +0200 Message-Id: <20220427170734.819891-1-jakobkoschel@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In preparation to limit the scope of the list iterator variable to the traversal loop, use a dedicated pointer to point to the found element [1]. Link: https://lore.kernel.org/all/CAHk-=wgRr_D8CB-D9Kg-c=EHreAsk5SqXPwr9Y7k9sA6cWXJ6w@mail.gmail.com/ [1] v1->v2: - fix NULL ptr dereference in subsystem_open() (Steven Rostedt) - don't use the iterator in PATCH 3/4 when not necessary (Steven Rostedt) Jakob Koschel (4): tracing: Remove usage of list iterator after the loop body tracing: Remove usage of list iterator variable after the loop tracing: Replace usage of found with dedicated list iterator variable tracing: Remove check of list iterator against head past the loop body kernel/trace/ftrace.c | 20 ++++++++++++-------- kernel/trace/trace_eprobe.c | 14 ++++++++------ kernel/trace/trace_events.c | 27 +++++++++++++-------------- kernel/trace/trace_events_hist.c | 15 +++++++-------- kernel/trace/trace_events_trigger.c | 24 +++++++++++------------- kernel/trace/trace_output.c | 13 +++++++++---- 6 files changed, 60 insertions(+), 53 deletions(-) base-commit: 46cf2c613f4b10eb12f749207b0fd2c1bfae3088 -- 2.25.1