From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lf1-f46.google.com (mail-lf1-f46.google.com [209.85.167.46]) (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 323D015C1 for ; Mon, 28 Feb 2022 20:15:07 +0000 (UTC) Received: by mail-lf1-f46.google.com with SMTP id t13so11326534lfd.9 for ; Mon, 28 Feb 2022 12:15:06 -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=d4O8QGZdzbitVnuZ0FWyJU6WBF0zzhaUR8L4icnX2U8qTh04mqe3Uw8mbeBZ9JR9vB lwyucScGELqbsWEGAv5B7L4ETa4cnOBQ+3mWTW8m2p1RzL7ktxliNZQxb2s90c2oBYwv e7Vx2KlFNeO3T8KozbOIKxwx2a0zHbzkUcLfgLMvvHwJaxRzEOXhc/4Ol4l/AYmkLyEe QAbPPiEweO1QUhAVL2pwSqv5Hz6WGWqpFaJ8wtXlSM7HCeGW4lXQVKA19L1B1Z60s0qd LQs1pC3idNruz4n6m0zRjkMB0NZ2WGGr+6gdtI8kKyzd1PrujxvPoN099OEtV6/8Q92L 3pEA== X-Gm-Message-State: AOAM530pRszwZFAtrQZCa5r/eSB24+pB8L5faRRGLHTWCg1lCJf5jfd8 6GnprHsmCaGh6sDx7isRDOU0XOnlJhhVBmqeZGU= X-Google-Smtp-Source: ABdhPJx43tOsYZQIYXIZoGwtxuPmSGjvY0Hgs/pbVEhIlZ6i9BJQY/4tJuIC9ChkqttW6EnH+bss1A== X-Received: by 2002:ac2:4423:0:b0:438:cc25:81ae with SMTP id w3-20020ac24423000000b00438cc2581aemr13270395lfl.212.1646079304953; Mon, 28 Feb 2022 12:15:04 -0800 (PST) Received: from mail-lj1-f170.google.com (mail-lj1-f170.google.com. [209.85.208.170]) by smtp.gmail.com with ESMTPSA id v21-20020a2e9915000000b002452577587esm1507026lji.16.2022.02.28.12.15.01 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 28 Feb 2022 12:15:02 -0800 (PST) Received: by mail-lj1-f170.google.com with SMTP id u7so18971495ljk.13 for ; Mon, 28 Feb 2022 12:15:01 -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) Precedence: bulk X-Mailing-List: linux-staging@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: 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" 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 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0A4DAC433F5 for ; Mon, 28 Feb 2022 20:15:17 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 99D4810E67A; Mon, 28 Feb 2022 20:15:16 +0000 (UTC) Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4F64D10E67A for ; Mon, 28 Feb 2022 20:15:15 +0000 (UTC) Received: by mail-ej1-x62e.google.com with SMTP id hw13so27106688ejc.9 for ; Mon, 28 Feb 2022 12:15:15 -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=fmoXautVpvmaORCiin4xzQ6DE6dwWi1lQpq2+o7Pi3SUdRPsCBSifVVATzOI0oG2zO pxc6PrRrcJPpaI8mK9R+4WySF3wR0IgWd1sPDrWl1byZDGKIGuocztzGy9aOscMPHv6W 3ACtxtXmNMqDUdlJrcbb+mwaArEky0rwSzhfw9fOPv1GRFWdhPN2Kjs0kIH4C3jeVJ3E QwwLDM2dWknZMqcgr7ei9y6FoY9n3Q3FxtmdVveAf/8zFJGoiMHj5T0WiE0QCgpsiCqd gNi6CX+rZOHFh1LoGydx6dfuSMSeWbiqnLE7QJuw6i/wBKfykk5+IB6kYjyGj48wkB0d 9W5Q== X-Gm-Message-State: AOAM531cnTqLGAhhm/dZcalzhgGp6jXNsuuk0ZOAzTdQoUWKVqeCBXra J8w44CE3u2NmCW3qBlNRypi85Fu48Bm9182L30k= X-Google-Smtp-Source: ABdhPJyocnxXC7YQ4B3BU8C462qWaxjHTE7bWSBCR0DEDa4tfD0Y0XJ2rso+j1ZElfdRz51Oc2HyRw== X-Received: by 2002:a17:906:4f0a:b0:6ce:e4fc:34d0 with SMTP id t10-20020a1709064f0a00b006cee4fc34d0mr16250157eju.717.1646079313621; Mon, 28 Feb 2022 12:15:13 -0800 (PST) Received: from mail-ed1-f45.google.com (mail-ed1-f45.google.com. [209.85.208.45]) by smtp.gmail.com with ESMTPSA id u5-20020a170906b10500b006ce6fa4f510sm4609820ejy.165.2022.02.28.12.15.11 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 28 Feb 2022 12:15:12 -0800 (PST) Received: by mail-ed1-f45.google.com with SMTP id i11so19175962eda.9 for ; Mon, 28 Feb 2022 12:15:11 -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: To: =?UTF-8?Q?Christian_K=C3=B6nig?= Content-Type: text/plain; charset="UTF-8" Subject: Re: [Intel-gfx] [PATCH 2/6] treewide: remove using list iterator after loop body as a ptr X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-wireless , alsa-devel@alsa-project.org, KVM list , "Gustavo A. R. Silva" , linux-iio@vger.kernel.org, nouveau@lists.freedesktop.org, Rasmus Villemoes , dri-devel , Cristiano Giuffrida , "Bos, H.J." , linux1394-devel@lists.sourceforge.net, drbd-dev@lists.linbit.com, linux-arch , CIFS , linux-aspeed@lists.ozlabs.org, linux-scsi , linux-rdma , linux-staging@lists.linux.dev, amd-gfx list , 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 , dma , Christophe JAILLET , Jakob Koschel , 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, samba-technical@lists.samba.org, Linux Kernel Mailing List , Linux F2FS Dev Mailing List , tipc-discussion@lists.sourceforge.net, Linux Crypto Mailing List , linux-fsdevel , linux-mediatek@lists.infradead.org, Andrew Morton , linuxppc-dev , Mike Rapoport Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" 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 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8116BC433F5 for ; Mon, 28 Feb 2022 20:20:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=7l0BUULsEfQsfiPEaQsGY/qs6dtSisLeJifcxX8P9Xc=; b=yYiKcMTCdLyJbF bYzi7uQvzp7KO74IiQXXDer0SeTbp9rdlMnbUkJA9r0QUJ6079EhQlGIgnc6DvTX82mB2Rz53GvG5 bgqHpMLBXQv6IaR1fEpIpPqLSx2yBhiYNZA/o2sGvVopgXAD11JXqdcvCyEFzlBgyHE3yD642hpnq /ncMgrYZgSGnj65aW98gNzK/gLV2i7BHYUwknL3npzKZNpyfDk0GV8R1q7UIj9qe1aL+m655p+/gW v0yKJ8XG/bVYdsLWDcZdhLM+ID1OzAbt0nKbng5L5yLJLWLFfsqSV4HgPzxucTOAFp9z1uAgnrhKh Nvi2Kka451WZ4hpOvoJg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nOmVW-00E08a-QA; Mon, 28 Feb 2022 20:20:35 +0000 Received: from mail-lj1-x236.google.com ([2a00:1450:4864:20::236]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nOmVQ-00E04s-Mc for linux-mediatek@lists.infradead.org; Mon, 28 Feb 2022 20:20:32 +0000 Received: by mail-lj1-x236.google.com with SMTP id l12so7148545ljh.12 for ; Mon, 28 Feb 2022 12:20:28 -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=iYVbIHWERuOtt8RLlEta4f1qrcJUqKzcSLThy8wieMMVCg30mt46CZnleHVhb6jmqx DW2i/zXGxnJlzEmBehrJFUvPUL81Z2LWBahacu9LR3kc0UdRTim4r53WuU3RZsKJMpC6 VrNhJhEc1m/NHzi8LxIcjzrfEV+XTXP0sRIiOrY7hq4e9/xULnh2nnhJsVYZ1L7DJ+d2 ijCsQ9KLnjN6uf4FCHFEq+LgBYkmcsgRb2t7PIDbOg4+UlgicxV/B/1I56NmyF9mvBfo 7am5bGHEnPCxPYWWx76MJIfa69Xd7qLvRZgOXKnjNN+sApKiN9PzHMJ2pmPGZtO27rJH k87A== X-Gm-Message-State: AOAM532gYpBpbjupTAjhIWq3r3FJxr5tN/8wq5GRKen/Y72hEU0Gt/RY DDoX/P4r3xzw8au+WE2a4dAC6gZ1Uj1PD4zF9iA= X-Google-Smtp-Source: ABdhPJwQ8O7oB6U06WNhmwhgVY/csJq2yyNK5vRS7oWBVqq8xha2EBU3DQ0Tne7gN7m+CJV5E3q2Lw== X-Received: by 2002:a2e:980f:0:b0:246:3fb6:816b with SMTP id a15-20020a2e980f000000b002463fb6816bmr15742757ljj.242.1646079626712; Mon, 28 Feb 2022 12:20:26 -0800 (PST) Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com. [209.85.167.42]) by smtp.gmail.com with ESMTPSA id y13-20020ac2420d000000b004433cddf621sm1120310lfh.119.2022.02.28.12.20.26 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 28 Feb 2022 12:20:26 -0800 (PST) Received: by mail-lf1-f42.google.com with SMTP id t13so11348121lfd.9 for ; Mon, 28 Feb 2022 12:20:26 -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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220228_122028_769369_7D9CFD7C X-CRM114-Status: GOOD ( 13.01 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.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 _______________________________________________ Linux-mediatek mailing list Linux-mediatek@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-mediatek 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 lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 08909C433F5 for ; Mon, 28 Feb 2022 20:21:59 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.94.2) (envelope-from ) id 1nOmWt-0007me-Ff; Mon, 28 Feb 2022 20:21:58 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nOmWr-0007mY-VL for linux-f2fs-devel@lists.sourceforge.net; Mon, 28 Feb 2022 20:21:56 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Type:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Sender:Reply-To:Content-Transfer-Encoding :Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=Rhevy6fb5H45VxDHjLDNCxtPhjJ0u7uFLdfSx9pxlIs=; b=Cs+SR2GX0ehSq8soLrPI+CRGca GrniFisBnVhkNCNELygjAVzPUHo2eu9mYpWP/54/Ll1TRq/VhHFAzfsPPUcKzFRSYABnrW2WNYF+z mlcjiFqHePaZN1FXVkT17G4gvF91ipLe/vnmD+dp+ZkpleikkcwwC+Dn+W2muxf4HZeI=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References: MIME-Version:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=Rhevy6fb5H45VxDHjLDNCxtPhjJ0u7uFLdfSx9pxlIs=; b=VxZb9I4VKobaemUdN++0Uy7I1f jtPD5W80WdDzEZSBSnvjBUu9WIKNeQYZxTfqhkPepk54HV/LOgXATi0EUJyuwpglTKvbnW64w8HyL TXRZ3fbPw6JOOfVUPL4eGx+pj/3eScxuZQ+KLLxC78ypUWXrUFwYruIpenK/k9TVwW4Y=; Received: from mail-ej1-f41.google.com ([209.85.218.41]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.94.2) id 1nOmWo-000TYx-OG for linux-f2fs-devel@lists.sourceforge.net; Mon, 28 Feb 2022 20:21:56 +0000 Received: by mail-ej1-f41.google.com with SMTP id gb39so27221626ejc.1 for ; Mon, 28 Feb 2022 12:21:54 -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=pAI78ke8eAD4GcTIpBTlCa5YY0FHW+Vj/yTA/ACq8IY8yXrr6B2CXSHrRkfqWzK0RC sc3RurRPpcKCE8sdjm2oPMar3Qo50tBOPCeeRW50go9AftYrjSUjn414PtGFaaOYa2SE j+15yxraO/tOhQaiF8NMHPhN6Lksmi8MaVLsx5tzz9FLzkaY0xc0p5h0o/8MvbVsenOj UkZmqxqHshfWTWuJpOQ85yQvq+6hZU8I2qygiN83nNPQqLmgZh/sHX+1QtjBKyBp3oBn HxSka9E1nThOEs/Sv0qkhGgapE8/USkWu+mgxjhkLXpw16ugdrnJsn0NK9s7lRklnZEU 3tUQ== X-Gm-Message-State: AOAM531sF+2DfPP4d2jDbhhqs9XNoKHCOlWjhwVtACWD3hMKiClZ5DfK pvLf9adjGulVszsIEHwqrcHIszrqPh1WJZc5sWs= X-Google-Smtp-Source: ABdhPJzVawjNpNtDbS/J04wYV2k7c0vYhfzgRQtTfbCOUYC6FRF4OLv+l8jiLjgeDICJIlLZB15GfA== X-Received: by 2002:a17:907:2bf7:b0:6cf:86bc:4e2e with SMTP id gv55-20020a1709072bf700b006cf86bc4e2emr16763815ejc.200.1646079708186; Mon, 28 Feb 2022 12:21:48 -0800 (PST) Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com. [209.85.221.49]) by smtp.gmail.com with ESMTPSA id n13-20020a1709062bcd00b006cf71d46a1csm4613497ejg.136.2022.02.28.12.21.47 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 28 Feb 2022 12:21:47 -0800 (PST) Received: by mail-wr1-f49.google.com with SMTP id j22so17178019wrb.13 for ; Mon, 28 Feb 2022 12:21:47 -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: To: =?UTF-8?Q?Christian_K=C3=B6nig?= X-Headers-End: 1nOmWo-000TYx-OG Subject: Re: [f2fs-dev] [PATCH 2/6] treewide: remove using list iterator after loop body as a ptr X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-wireless , alsa-devel@alsa-project.org, KVM list , "Gustavo A. R. Silva" , linux-iio@vger.kernel.org, nouveau@lists.freedesktop.org, Rasmus Villemoes , dri-devel , Cristiano Giuffrida , "Bos, H.J." , linux1394-devel@lists.sourceforge.net, drbd-dev@lists.linbit.com, linux-arch , CIFS , linux-aspeed@lists.ozlabs.org, linux-scsi , linux-rdma , linux-staging@lists.linux.dev, amd-gfx list , 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 , dma , Christophe JAILLET , Jakob Koschel , 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, samba-technical@lists.samba.org, Linux Kernel Mailing List , Linux F2FS Dev Mailing List , tipc-discussion@lists.sourceforge.net, Linux Crypto Mailing List , linux-fsdevel , linux-mediatek@lists.infradead.org, Andrew Morton , linuxppc-dev , Mike Rapoport Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net 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 _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel 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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4FB61C433F5 for ; Wed, 2 Mar 2022 08:46:48 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 73CC21E84; Wed, 2 Mar 2022 09:45:56 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 73CC21E84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1646210806; bh=xifc2+AFPj/tojwnRIgVe4BTLNCZLXseaVUwMtQOeBU=; h=References:In-Reply-To:From:Date:Subject:To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=TVq/lV80ngUiA1dsx2j4VbODt2cd3WrRSOeRFQzInsQR+26Dir3nGACg/kASWOPaG 74L+3Vecfz5rJmypO71Pr3jaCyh9aZHl433eTHkMJSrC3Gl14WXuMccbE9KWaR5j9U bnGWIEeShGmVKHSC+vin/Aryc5ny32FVNIpf0yok= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id A7B38F8061E; Wed, 2 Mar 2022 09:34:05 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 12E96F80054; Mon, 28 Feb 2022 21:15:12 +0100 (CET) Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [IPv6:2a00:1450:4864:20::131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id F3640F80054 for ; Mon, 28 Feb 2022 21:15:05 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz F3640F80054 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="SFiiDask" Received: by mail-lf1-x131.google.com with SMTP id t13so11326460lfd.9 for ; Mon, 28 Feb 2022 12:15:05 -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=NhngGRzS3/Ds2VxhthvOVSsIIhiI+o7JBj3AE2L70065GVQ++P68QE9L/EzJpsX2L4 eUrqwb/DbEm1EP8HSNtgOiNPmq41QgkxQdqeJ6BijjIVazPgw1wmHfqEe9DbIThchaTl wpRlXySwzUajKA/8MneP4kWxM72k2FMlO3812pTwrrC/CM76FYihacrrYnPCFTF4YjmP 4IL3ClrXWYYroDn4Pryp8ymYUa8VeaejaCSDUXA2tw8oQB4VrJss0c63XWQ7JtiJ0ZTg oIlCn7T1MDtmT7h1k5PlaepxL2mMm0cjBYkOrHOumK8rp7iBrQ0hII5y7RW9KdNygDMn v+pg== X-Gm-Message-State: AOAM530mJE+jletTrbI/OgA7SFiUmfC4NqJ+8gEbTE0/S/3BQFaM9ZKT T+Pm1JK+zETiknnLp0Yud443ryJ6r/bLt2nYEbg= X-Google-Smtp-Source: ABdhPJwApsIUuO9rqtEfulGAzJaAJbabtnAgoIUwy7S2JYd1LN2yBZqueL1kXirMDaKLmRcaDg8KXQ== X-Received: by 2002:ac2:57cf:0:b0:439:94e:7c4a with SMTP id k15-20020ac257cf000000b00439094e7c4amr13753187lfo.23.1646079304143; Mon, 28 Feb 2022 12:15:04 -0800 (PST) Received: from mail-lj1-f169.google.com (mail-lj1-f169.google.com. [209.85.208.169]) by smtp.gmail.com with ESMTPSA id k3-20020a05651239c300b00443c5f9175bsm1122881lfu.46.2022.02.28.12.15.01 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 28 Feb 2022 12:15:01 -0800 (PST) Received: by mail-lj1-f169.google.com with SMTP id y24so3129ljh.11 for ; Mon, 28 Feb 2022 12:15:01 -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?= Content-Type: text/plain; charset="UTF-8" X-Mailman-Approved-At: Wed, 02 Mar 2022 09:33:36 +0100 Cc: linux-wireless , alsa-devel@alsa-project.org, KVM list , "Gustavo A. R. Silva" , linux-iio@vger.kernel.org, nouveau@lists.freedesktop.org, Rasmus Villemoes , dri-devel , Cristiano Giuffrida , "Bos, H.J." , linux1394-devel@lists.sourceforge.net, drbd-dev@lists.linbit.com, linux-arch , CIFS , linux-aspeed@lists.ozlabs.org, linux-scsi , linux-rdma , linux-staging@lists.linux.dev, amd-gfx list , 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 , dma , Christophe JAILLET , Jakob Koschel , 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, samba-technical@lists.samba.org, Linux Kernel Mailing List , Linux F2FS Dev Mailing List , tipc-discussion@lists.sourceforge.net, Linux Crypto Mailing List , linux-fsdevel , linux-mediatek@lists.infradead.org, Andrew Morton , linuxppc-dev , Mike Rapoport X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" 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 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8A5C6C433FE for ; Tue, 1 Mar 2022 04:37:49 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 416F410EB44; Tue, 1 Mar 2022 04:37:22 +0000 (UTC) Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5529410E67A for ; Mon, 28 Feb 2022 20:15:06 +0000 (UTC) Received: by mail-lf1-x12a.google.com with SMTP id d23so23274904lfv.13 for ; Mon, 28 Feb 2022 12:15:06 -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=uo6GM13r282qnrH3y7+oaQ+rmekvJE7LbqHzUe2Ny0omaeeGuyoUmGRKcphac7hUmD tLpmB5YOmdrbHy2gxFQQA3zcJirCyAjFl472XauJka/AQJ55EWU298X+w285ZSJPoGz3 7a7lVMMA15xcV+fBWmnSckgSy07aQ/rAXlmumN23+v1A03+fvnPSyeA4K1w/GiOBrc5E Ca/KJxHfhOPyMU/g5W0bw027dis7u0gC4P0frE+cTIaL46wEoymlJIfJtRD8KSXJK6qU 2q82qzs3tY5jXSx17SZIWTUFv2YZEWYZqXcWCtgtf13uvaXzS8wwCXY7DGXzccCqnQkA Gcvw== X-Gm-Message-State: AOAM531kU4+6hvw3AHEfE4PLh+4x/utzep5m4a6xrJQUba8XeBLRT+Zw 9QmOVYvsIWiFqAr/RhZY9lIjWRB0tqtOCknlCu4= X-Google-Smtp-Source: ABdhPJx7t7wS/wqy1thJuAckMjSc8BbGlQj8C8seAoQvYYytzmHHhA/L9KXxtBv4tQ/bDau9bImuBQ== X-Received: by 2002:a05:6512:2097:b0:443:eaaa:3ddb with SMTP id t23-20020a056512209700b00443eaaa3ddbmr13373662lfr.185.1646079304351; Mon, 28 Feb 2022 12:15:04 -0800 (PST) Received: from mail-lj1-f169.google.com (mail-lj1-f169.google.com. [209.85.208.169]) by smtp.gmail.com with ESMTPSA id g13-20020a2ea4ad000000b0023382d8819esm1468754ljm.69.2022.02.28.12.15.01 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 28 Feb 2022 12:15:01 -0800 (PST) Received: by mail-lj1-f169.google.com with SMTP id u7so18971493ljk.13 for ; Mon, 28 Feb 2022 12:15:01 -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: To: =?UTF-8?Q?Christian_K=C3=B6nig?= Content-Type: text/plain; charset="UTF-8" X-Mailman-Approved-At: Tue, 01 Mar 2022 04:37:20 +0000 Subject: Re: [Nouveau] [PATCH 2/6] treewide: remove using list iterator after loop body as a ptr X-BeenThere: nouveau@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Nouveau development list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-wireless , alsa-devel@alsa-project.org, KVM list , "Gustavo A. R. Silva" , linux-iio@vger.kernel.org, nouveau@lists.freedesktop.org, Rasmus Villemoes , dri-devel , Cristiano Giuffrida , "Bos, H.J." , linux1394-devel@lists.sourceforge.net, drbd-dev@lists.linbit.com, linux-arch , CIFS , linux-aspeed@lists.ozlabs.org, linux-scsi , linux-rdma , linux-staging@lists.linux.dev, amd-gfx list , 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 , dma , Christophe JAILLET , Jakob Koschel , 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, samba-technical@lists.samba.org, Linux Kernel Mailing List , Linux F2FS Dev Mailing List , tipc-discussion@lists.sourceforge.net, Linux Crypto Mailing List , linux-fsdevel , linux-mediatek@lists.infradead.org, Andrew Morton , linuxppc-dev , Mike Rapoport Errors-To: nouveau-bounces@lists.freedesktop.org Sender: "Nouveau" 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Linus Torvalds Date: Mon, 28 Feb 2022 12:14:44 -0800 Subject: [Intel-wired-lan] [PATCH 2/6] treewide: remove using list iterator after loop body as a ptr In-Reply-To: References: <20220228110822.491923-1-jakobkoschel@gmail.com> <20220228110822.491923-3-jakobkoschel@gmail.com> <2e4e95d6-f6c9-a188-e1cd-b1eae465562a@amd.com> Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: intel-wired-lan@osuosl.org List-ID: 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