Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp1497683pxm; Thu, 24 Feb 2022 04:28:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJyWhENHy1b3v5vSnjNNZetkqWHmoupctd36hHAbzpxIMWFjnia9t/E6JPc2bHNQtroqpwse X-Received: by 2002:a05:6402:26cb:b0:3fa:3817:1f78 with SMTP id x11-20020a05640226cb00b003fa38171f78mr2071494edd.219.1645705700796; Thu, 24 Feb 2022 04:28:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645705700; cv=none; d=google.com; s=arc-20160816; b=dfmQh4ksBTjLtTxvg1TUQt39bhJKCyE80XBiN95z+bw+e8F0bubUC/AXyMSi7AuSf9 vtZLg1tpM0B+RCVPINNRZKecoxESkZFu+s4CJpI4R6tmhZQEW4Tmn75t0BAcmkI6VSsf 30v5Tm5qCJMeQLUzK8hwp55mUQcgI+d1mSrl5BBvgRpHut68QZInbq0xq0vUHTMTbO59 Tra2+w13eq7TOPptTzPb37rpRleOJyLMASRnhkYGwKIxNguIq8AZfFdO6TrEJ3B8DyKq 4Ee81TsYw0vH/7WvzQr3m2HTdxwEPJ/30QFfyNcklazIAluJP6FHecVBfEqUMGAJ7iY9 uy0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=A3PA5uHrq+T2Nkf5exnvhLrK7YnPSzvJxpI3oMDVV9U=; b=xxbHmc139ElMtCpDSSoZYuR34AA230TttVprTYvrS0OioiVXCGakQkWmOlmfO0HZon 2NglQvqvAmaYEOVsfhnHYJnedk1Zi38M4908NVReAWp158LTd0wB5KtMUWowilrGyGfl YtN93BMxI30zvRwNF7ZYVR7RgHjrGXbMnWTri35hdIYFeHNQb6XDTR2XLmvKQyBEMOE8 CA7INPAXQLyXpELQPYwma5nOxOBqn4V/pEtozy8ZZuqzZauT5b6n7v+x+c4oh7F6uC1j 5MbD+YJN9mWOC5PPFWrZQOZUP5wHMuQc1gmUY6L+jbgKBWDG+rkAkLT4Goqvl0Cqggw2 w63Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=rNfUenic; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u7si1399648eju.711.2022.02.24.04.27.55; Thu, 24 Feb 2022 04:28:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=rNfUenic; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233829AbiBXL0k (ORCPT + 99 others); Thu, 24 Feb 2022 06:26:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53014 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229594AbiBXL0i (ORCPT ); Thu, 24 Feb 2022 06:26:38 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E590129A56B; Thu, 24 Feb 2022 03:26:08 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0509461806; Thu, 24 Feb 2022 11:26:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DE968C340E9; Thu, 24 Feb 2022 11:26:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1645701967; bh=c9g/jUJtCUw9sivZ3lkoycxnPjQ1WqrUDK+4vvMZAhg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=rNfUenic21FUYcVgChtpf/OKbUtHvXzNJTMffYLsbZRJ+ydTkUPhK6jQSqZUCUXrF lSR0NyoGcrNUJ3fH7EkgdKI5ChXw1/kKiLnKHsK0afT7hfZSkKr7cD6CvQBmPxmukA PETIYkqoOWChOY1svgopA/zWJ+2V6cLgS5I/ZyjA= Date: Thu, 24 Feb 2022 12:26:04 +0100 From: Greg Kroah-Hartman To: Cristiano Giuffrida Cc: Jakob , Linus Torvalds , Linux Kernel Mailing List , linux-arch , Thomas Gleixner , Arnd Bergman , Andy Shevchenko , Andrew Morton , Kees Cook , Mike Rapoport , "Gustavo A. R. Silva" , Brian Johannesmeyer , "Bos, H.J." Subject: Re: [RFC PATCH 03/13] usb: remove the usage of the list iterator after the loop Message-ID: References: <20220217184829.1991035-1-jakobkoschel@gmail.com> <20220217184829.1991035-4-jakobkoschel@gmail.com> <6DFD3D91-B82C-469C-8771-860C09BD8623@gmail.com> <86C4CE7D-6D93-456B-AA82-F8ADEACA40B7@gmail.com> <6d191223d93249a98511177d4af08420@pexch012b.vu.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 On Thu, Feb 24, 2022 at 11:46:40AM +0100, Cristiano Giuffrida wrote: > I think the "problem" with this solution is that it doesn't prevent > `tmp` from being used outside the loop still (and people getting it > wrong again)? It would be good to have 'struct gr_request *tmp;' being > visible only inside the loop (i.e., declared in the macro). That is a larger change, one that we can hopefully make when changing to introduce the temp variable in the loop_for_each() macro as Linus described elsewhere in the thread. But for now, it should be pretty obvious to not touch tmp again after the loop is done. That should make it easier to check for stuff like this as well in an automated fashion (i.e. the loop variable is only touched inside the loop.) thanks, greg k-h