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 530B3C433EF for ; Mon, 28 Feb 2022 20:47:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229819AbiB1UsI (ORCPT ); Mon, 28 Feb 2022 15:48:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55672 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229756AbiB1UsG (ORCPT ); Mon, 28 Feb 2022 15:48:06 -0500 Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [IPv6:2a00:1450:4864:20::12e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0631A1116 for ; Mon, 28 Feb 2022 12:47:27 -0800 (PST) Received: by mail-lf1-x12e.google.com with SMTP id b11so23427032lfb.12 for ; Mon, 28 Feb 2022 12:47:26 -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=qhbC6eV8gO++7ErI4p8jtmcwHU0MP2/Ov9cpdMFArow=; b=WVa5dIiqx38h7wrDwDC1XUsKJKiBFCag4a2cDDwm9PX3cUtT8qqZ7IT4jQUgf/P4m+ SFGMe+WsS02R4cGzO91FNZKGdT/lUA2soxV9cxmDWvmKG61T36jSK+GypeHu4wmj47J3 J2dEWo9WRu5EKgz1ZgjNDbSUreOeJ25KIOWY4= 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=qhbC6eV8gO++7ErI4p8jtmcwHU0MP2/Ov9cpdMFArow=; b=UtwlBgqcFMGkYyu3RFsmRer2G2W61M1OuHkg5FhN07b/cE9SieFSe/zQKYU6ZmiiQI fogdbbTJG67dsXgfjboQCoOOJH6V5Ve/2tkXVgJHA60ULnwS3ZaphgZFe0/D0Xiqjpby +6I8LeBzDLeW2S3B0rH5Mwrj8WNLypIM30CusNaTZSHk8QtIeB5K8gwwdL3Y4j+yuJbi uM1sl7Lj0uJCotKkyZih5GlCc9C2JPfaHSXDeAj0DWeoon40TqErNj90zyAmXVAz1LD6 fdlh1HtPUvP7ThXv1GUxzDA52Qkt9nJxooTlgNzrvirkdMXEJJtD7BFgh7tzTvwvbZfc gvUg== X-Gm-Message-State: AOAM532SF9pCKLGevXos9tsieJjt6aWyAlTJ++JBZDC00CXfOF/WIgSE 93yiHtVUQtK3sFHYQllHJZ7E6ScUX8vFohX6KtA= X-Google-Smtp-Source: ABdhPJyW6Xgjlesymv+vk82dPmElB82lLPpPS/7mWrmAOgfzc5iO8a4vl5iUoFKCcAaU2YwS53W1DA== X-Received: by 2002:ac2:4c10:0:b0:444:8c:e717 with SMTP id t16-20020ac24c10000000b00444008ce717mr13699779lfq.117.1646081245144; Mon, 28 Feb 2022 12:47:25 -0800 (PST) Received: from mail-lj1-f171.google.com (mail-lj1-f171.google.com. [209.85.208.171]) by smtp.gmail.com with ESMTPSA id s28-20020ac2465c000000b00443ec4ac8f6sm1129899lfo.177.2022.02.28.12.47.24 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 28 Feb 2022 12:47:24 -0800 (PST) Received: by mail-lj1-f171.google.com with SMTP id u7so19077503ljk.13 for ; Mon, 28 Feb 2022 12:47:24 -0800 (PST) X-Received: by 2002:a05:6512:e8a:b0:443:7b8c:579a with SMTP id bi10-20020a0565120e8a00b004437b8c579amr13784522lfb.687.1646080877791; Mon, 28 Feb 2022 12:41:17 -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:41:01 -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: Johannes Berg Cc: Matthew Wilcox , =?UTF-8?Q?Christian_K=C3=B6nig?= , 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:29 PM Johannes Berg wrote: > > If we're willing to change the API for the macro, we could do > > list_for_each_entry(type, pos, head, member) > > and then actually take advantage of -Wshadow? See my reply to Willy. There is no way -Wshadow will ever happen. I considered that (type, pos, head, member) kind of thing, to the point of trying it for one file, but it ends up as horrendous syntax. It turns out that declaring the type separately really helps, and avoids crazy long lines among other things. It would be unacceptable for another reason too - the amount of churn would just be immense. Every single use of that macro (and related macros) would change, even the ones that really don't need it or want it (ie the good kinds that already only use the variable inside the loop). So "typeof(pos) pos" may be ugly - but it's a very localized ugly. Linus