From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7E43CC433FE for ; Mon, 28 Feb 2022 20:15:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229703AbiB1UQK (ORCPT ); Mon, 28 Feb 2022 15:16:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230033AbiB1UQE (ORCPT ); Mon, 28 Feb 2022 15:16:04 -0500 Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5EA275007C for ; Mon, 28 Feb 2022 12:15:17 -0800 (PST) Received: by mail-ed1-x535.google.com with SMTP id i11so19176178eda.9 for ; Mon, 28 Feb 2022 12:15:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Rhevy6fb5H45VxDHjLDNCxtPhjJ0u7uFLdfSx9pxlIs=; b=SFiiDaskyFzzbW4jCoUqiJYglpNWscp1lwtLHE93w8dRI3h8eXZkrLgebAKqQfA9oZ haXikdZXvfEB810zRURGwChdn/CvMC8Q7Pab3hpE0iVI/nf3FVJvcryQMcC1uZhcoZUU P6IZH9h2w6s9V+B5fc5q6pR5l/tJkcQrm5JJ0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Rhevy6fb5H45VxDHjLDNCxtPhjJ0u7uFLdfSx9pxlIs=; b=irCT2XLay2u1y3c01Ze0Zm2cb90tbUCoHQ9oux+rHyyUuYKhjy6UGJZCEc+2/TIldz O/rHVKxeXssoQLMVY1B/Y6JYeUn7+P2USQ2obYGC19ujH6NHofNqGxEipX3uDYBwE0tU hkCOOcHvwNTH3VxCgM3BMABUyI5IJV3IEWKOnXopE9bekfIOXjKUTKoiyGeAWh1/2DgM QYdjuK0MNaTS9DbGXJHw8TOCe9nv67knG44YDnLu+NFASTi9EfC11zIVvWHwlkBCb3TH YlwEnwioXE19YGS5XFCSpuCDhKR2T2l8E8axC2Zj2Y/86nBEg290XXNF7eVErJ5AJbrV C2OQ== X-Gm-Message-State: AOAM531Kncq7NPXO9sQvrEiUYqzanuOJ+v1XtvcxoS0//owKeZpJjyBG iJV36tmQWIgm2GVxDLut0hvUjeFsENp97XSoaeI= X-Google-Smtp-Source: ABdhPJzywyOTjghEOH1S/1jVpN+QAhmtpLAFi1/uPIMga5uD6DdzgwohKJnnJdcAhpijkClJhyMYkw== X-Received: by 2002:a05:6402:524e:b0:410:dedd:ea37 with SMTP id t14-20020a056402524e00b00410deddea37mr3726085edd.260.1646079315736; Mon, 28 Feb 2022 12:15:15 -0800 (PST) Received: from mail-ed1-f43.google.com (mail-ed1-f43.google.com. [209.85.208.43]) by smtp.gmail.com with ESMTPSA id by10-20020a0564021b0a00b00412ddfc6d12sm6541064edb.0.2022.02.28.12.15.12 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 28 Feb 2022 12:15:13 -0800 (PST) Received: by mail-ed1-f43.google.com with SMTP id s14so19269005edw.0 for ; Mon, 28 Feb 2022 12:15:12 -0800 (PST) X-Received: by 2002:a2e:924d:0:b0:246:370c:5618 with SMTP id v13-20020a2e924d000000b00246370c5618mr15110351ljg.358.1646079300900; Mon, 28 Feb 2022 12:15:00 -0800 (PST) MIME-Version: 1.0 References: <20220228110822.491923-1-jakobkoschel@gmail.com> <20220228110822.491923-3-jakobkoschel@gmail.com> <2e4e95d6-f6c9-a188-e1cd-b1eae465562a@amd.com> In-Reply-To: From: Linus Torvalds Date: Mon, 28 Feb 2022 12:14:44 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 2/6] treewide: remove using list iterator after loop body as a ptr To: =?UTF-8?Q?Christian_K=C3=B6nig?= Cc: Jakob Koschel , alsa-devel@alsa-project.org, linux-aspeed@lists.ozlabs.org, "Gustavo A. R. Silva" , linux-iio@vger.kernel.org, nouveau@lists.freedesktop.org, Rasmus Villemoes , dri-devel , Cristiano Giuffrida , amd-gfx list , samba-technical@lists.samba.org, linux1394-devel@lists.sourceforge.net, drbd-dev@lists.linbit.com, linux-arch , CIFS , KVM list , linux-scsi , linux-rdma , linux-staging@lists.linux.dev, "Bos, H.J." , Jason Gunthorpe , intel-wired-lan@lists.osuosl.org, kgdb-bugreport@lists.sourceforge.net, bcm-kernel-feedback-list@broadcom.com, Dan Carpenter , Linux Media Mailing List , Kees Cook , Arnd Bergman , Linux PM , intel-gfx , Brian Johannesmeyer , Nathan Chancellor , linux-fsdevel , Christophe JAILLET , v9fs-developer@lists.sourceforge.net, linux-tegra , Thomas Gleixner , Andy Shevchenko , Linux ARM , linux-sgx@vger.kernel.org, linux-block , Netdev , linux-usb@vger.kernel.org, linux-wireless , Linux Kernel Mailing List , Linux F2FS Dev Mailing List , tipc-discussion@lists.sourceforge.net, Linux Crypto Mailing List , dma , linux-mediatek@lists.infradead.org, Andrew Morton , linuxppc-dev , Mike Rapoport Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Mon, Feb 28, 2022 at 12:10 PM Linus Torvalds wrote: > > We can do > > typeof(pos) pos > > in the 'for ()' loop, and never use __iter at all. > > That means that inside the for-loop, we use a _different_ 'pos' than outside. The thing that makes me throw up in my mouth a bit is that in that typeof(pos) pos the first 'pos' (that we use for just the typeof) is that outer-level 'pos', IOW it's a *different* 'pos' than the second 'pos' in that same declaration that declares the inner level shadowing new 'pos' variable. If I was a compiler person, I would say "Linus, that thing is too ugly to live", and I would hate it. I'm just hoping that even compiler people say "that's *so* ugly it's almost beautiful". Because it does seem to work. It's not pretty, but hey, it's not like our headers are really ever be winning any beauty contests... Linus