From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-f52.google.com (mail-ed1-f52.google.com [209.85.208.52]) (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 15CDF15BF for ; Mon, 28 Feb 2022 20:43:49 +0000 (UTC) Received: by mail-ed1-f52.google.com with SMTP id cm8so19318239edb.3 for ; Mon, 28 Feb 2022 12:43:48 -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=S/LNP14iVGpJY7HEU3KoWC3rGBeIOldyeXi/18P4YEg=; b=JCfpf2EkV0u8p2DIwI3SoZoRhHthQMEAy9/7LEkowc8JnTmPgsFXHlzh4U3t+Q6SEk Lc7ftzGO2kIrejoWkV3dzzd0jpx1zu67BigJ1Dmt6MH2aSREOTU5VOooJKZjMGKU+kco F0IyOo2hDxkf3WtcbllN4ffR7kqC0AZqO0I4w= 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=S/LNP14iVGpJY7HEU3KoWC3rGBeIOldyeXi/18P4YEg=; b=HrM631gscuLk3nJkTWj4Ltk+9V43MUnNV9c9TnEXz41VXvpmV0cyAoAyOSp1UyPF+o 8A5bdiZ5D7s6IB2YirmI53vxR4IvTR0LPqZgqSq7xL0hmoxrZOPUfbVK545GUSFR4gic WPQiZtMyML1dDbC2XCIkTqQ0oaNrgEwItNv+VfR3z0gyV4hAmliRE5CIixsmuW3hpP5+ B/WwknghWPhUnCvHPPMmJJA3crzTguYkrbLSoNKCzFbQDfuqzL1rr7Hf6LIY4m1kGjHw 03I3OZOF8IpJBeqFSA7cDCMZbY0Uflc08T/W61I7BYv1J1RhL6aVXIoTMyk4Bna0WTJ5 bCKA== X-Gm-Message-State: AOAM5315pAuJZ5Q0c++tn4JgtfeCvLFeVrZVyPMTlFGziPcbWZIg+pRs tRVZenUblNSscyrIwG0LNjsKyPIYnS+MBn7OQ3Q= X-Google-Smtp-Source: ABdhPJxRJm92LSC5d7m/polROENFso349QKROoJAO2+/G6GktBj00peZ7r5VQCqqls17Ng8ilMRQuQ== X-Received: by 2002:a05:6402:170e:b0:40b:657:ac3f with SMTP id y14-20020a056402170e00b0040b0657ac3fmr21139320edu.354.1646081027157; Mon, 28 Feb 2022 12:43:47 -0800 (PST) Received: from mail-ej1-f44.google.com (mail-ej1-f44.google.com. [209.85.218.44]) by smtp.gmail.com with ESMTPSA id c21-20020aa7c995000000b00400506d388bsm6492813edt.48.2022.02.28.12.43.46 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 28 Feb 2022 12:43:46 -0800 (PST) Received: by mail-ej1-f44.google.com with SMTP id qa43so733974ejc.12 for ; Mon, 28 Feb 2022 12:43:46 -0800 (PST) X-Received: by 2002:a2e:924d:0:b0:246:370c:5618 with SMTP id v13-20020a2e924d000000b00246370c5618mr15158756ljg.358.1646080652034; Mon, 28 Feb 2022 12:37:32 -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:37:15 -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: Matthew Wilcox Cc: =?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" On Mon, Feb 28, 2022 at 12:16 PM Matthew Wilcox wrote: > > Then we can never use -Wshadow ;-( I'd love to be able to turn it on; > it catches real bugs. Oh, we already can never use -Wshadow regardless of things like this. That bridge hasn't just been burned, it never existed in the first place. The whole '-Wshadow' thing simply cannot work with local variables in macros - something that we've used since day 1. Try this (as a "p.c" file): #define min(a,b) ({ \ typeof(a) __a = (a); \ typeof(b) __b = (b); \ __a < __b ? __a : __b; }) int min3(int a, int b, int c) { return min(a,min(b,c)); } and now do "gcc -O2 -S t.c". Then try it with -Wshadow. In other words, -Wshadow is simply not acceptable. Never has been, never will be, and that has nothing to do with the typeof(pos) pos kind of thing. Your argument just isn't an argument. 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 9A7CEC433F5 for ; Mon, 28 Feb 2022 20:38:00 +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=4/T8BRrZawbKJF3h2h2LgXpJsvHhiDBHRU67Xykyjz0=; b=rQuCn3a/TDbIFP XF1BsQi2altIoBiEbfdOqTZZrENlCwBaC/sZcaCWcaDGshqn5NMk1oVhS/mongBiuV3cAbI0ZYG0p z6bw/7BtNon9fGw5O+k9njoz3F2Vyl6FIEO99YEq7IW7pIu9N1HJKbeYEBhGJ8/MpwCTetl2hBxcO qkCoRVK2MWv6pDdNq01J3BQR5btgMQv84mao2EyHW+DPYd6M5FAd/Py/JIhHv0vB1fZk8pq0zibDX bqaxZsd5XdBgTLMLxy+zMvfsLOE2y58Lp7OO4XXK9t+bp9FoQAsFkuzeK6lrpQCWVP9qSAugTBaHw IzO1hFBpVAXsXF9/uJlw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nOmmE-00E2tx-LB; Mon, 28 Feb 2022 20:37:50 +0000 Received: from mail-lj1-x22a.google.com ([2a00:1450:4864:20::22a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nOmmB-00E2rw-IK for linux-mediatek@lists.infradead.org; Mon, 28 Feb 2022 20:37:48 +0000 Received: by mail-lj1-x22a.google.com with SMTP id y24so80401ljh.11 for ; Mon, 28 Feb 2022 12:37:46 -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=S/LNP14iVGpJY7HEU3KoWC3rGBeIOldyeXi/18P4YEg=; b=JCfpf2EkV0u8p2DIwI3SoZoRhHthQMEAy9/7LEkowc8JnTmPgsFXHlzh4U3t+Q6SEk Lc7ftzGO2kIrejoWkV3dzzd0jpx1zu67BigJ1Dmt6MH2aSREOTU5VOooJKZjMGKU+kco F0IyOo2hDxkf3WtcbllN4ffR7kqC0AZqO0I4w= 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=S/LNP14iVGpJY7HEU3KoWC3rGBeIOldyeXi/18P4YEg=; b=V9kVsi32Sy8sBHO03wisc4OiW52EWQXH+MXKVg6ILlzR1JBsUvQkVL0DKCOI8DzoTr ncEyYp6x4MUOJnEHCpmW3i4qH+oSPYwwVDLYT67whfFNh1Oem2msFxZo6aRKKfvG5aBM /9ZdOoXEDqTUm6Y2WJ8FdoObwC62rud3AksGTDd2kDMcA5XDt5L1gGNrN0Hu9YTyHYBE J1Kc4YRd8UIeyinKnpWSAvpcboc5mm+/0mFEZMeSJTAmcZxZArUv4q8FNGvfUYyzI/5y 7Nqh7Lt17/QPqPGI3tKI4Pa03IXBAaNliOzHTeEUo3MlZlorDwjhix5w7/5ompZPrY/w RMzg== X-Gm-Message-State: AOAM533zuwsOhAFQHCs00FMACDsR2Isw3oqGHfm7x5Ja6E0PvfEQlgu5 ynY1z0QfLbExtLJPpjBeRshFU+V8z470X53ViH8= X-Google-Smtp-Source: ABdhPJy7ZiGdGUz3MKsijNaz0Fk5ws6QDN5R17uu5/gae9LLnJ+hbynLSGwHseXK5jhYZnzPQslA2Q== X-Received: by 2002:a2e:7d16:0:b0:246:3451:5190 with SMTP id y22-20020a2e7d16000000b0024634515190mr15376762ljc.498.1646080665119; Mon, 28 Feb 2022 12:37:45 -0800 (PST) Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com. [209.85.167.49]) by smtp.gmail.com with ESMTPSA id y23-20020ac255b7000000b004304710b837sm1126828lfg.135.2022.02.28.12.37.42 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 28 Feb 2022 12:37:42 -0800 (PST) Received: by mail-lf1-f49.google.com with SMTP id w27so23433328lfa.5 for ; Mon, 28 Feb 2022 12:37:42 -0800 (PST) X-Received: by 2002:a2e:924d:0:b0:246:370c:5618 with SMTP id v13-20020a2e924d000000b00246370c5618mr15158756ljg.358.1646080652034; Mon, 28 Feb 2022 12:37:32 -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:37:15 -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: Matthew Wilcox Cc: =?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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220228_123747_615934_DCF8BAEA X-CRM114-Status: GOOD ( 10.96 ) 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:16 PM Matthew Wilcox wrote: > > Then we can never use -Wshadow ;-( I'd love to be able to turn it on; > it catches real bugs. Oh, we already can never use -Wshadow regardless of things like this. That bridge hasn't just been burned, it never existed in the first place. The whole '-Wshadow' thing simply cannot work with local variables in macros - something that we've used since day 1. Try this (as a "p.c" file): #define min(a,b) ({ \ typeof(a) __a = (a); \ typeof(b) __b = (b); \ __a < __b ? __a : __b; }) int min3(int a, int b, int c) { return min(a,min(b,c)); } and now do "gcc -O2 -S t.c". Then try it with -Wshadow. In other words, -Wshadow is simply not acceptable. Never has been, never will be, and that has nothing to do with the typeof(pos) pos kind of thing. Your argument just isn't an argument. 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 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 B75DEC433EF for ; Wed, 2 Mar 2022 08:47:37 +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 F0B691EF9; Wed, 2 Mar 2022 09:46:45 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz F0B691EF9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1646210856; bh=p2USqutq4//LpaG0ENKKU1X9SouIiHfbPC4fqeXKxnU=; h=References:In-Reply-To:From:Date:Subject:To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=HqnalyRCWjNGdLX+Dhz7UBAT14qC1bLPM1asJlzmiCPbE0h1lTGKkGJoTFBqWw1Xr fPOduykL+hkrIA+VlePjqBTlHyNNtL4OudAAumGt0jyNjuM1O7XEi8p/SiVt4AcVGT emX8YmBi+m8YWLtKhjvT3/F8B42AtSTHAGrq4aQo= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 47BFFF80630; Wed, 2 Mar 2022 09:34:07 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id F3CB3F8013C; Mon, 28 Feb 2022 21:37:42 +0100 (CET) Received: from mail-lj1-x235.google.com (mail-lj1-x235.google.com [IPv6:2a00:1450:4864:20::235]) (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 7993FF80125 for ; Mon, 28 Feb 2022 21:37:36 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 7993FF80125 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="JCfpf2Ek" Received: by mail-lj1-x235.google.com with SMTP id r20so19118271ljj.1 for ; Mon, 28 Feb 2022 12:37:36 -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=S/LNP14iVGpJY7HEU3KoWC3rGBeIOldyeXi/18P4YEg=; b=JCfpf2EkV0u8p2DIwI3SoZoRhHthQMEAy9/7LEkowc8JnTmPgsFXHlzh4U3t+Q6SEk Lc7ftzGO2kIrejoWkV3dzzd0jpx1zu67BigJ1Dmt6MH2aSREOTU5VOooJKZjMGKU+kco F0IyOo2hDxkf3WtcbllN4ffR7kqC0AZqO0I4w= 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=S/LNP14iVGpJY7HEU3KoWC3rGBeIOldyeXi/18P4YEg=; b=6KEnCf4VgP+rXb1V3QizdeUhiFWpvBfEnlgTSunLOg9Wl7Pt9REJGQo3Ud0iguiB1U ZF0AJ+LKFqxDmuZiz46EWx6DNU6CHQEQ6ZZoFyeXt6cvhoFpbWBYWZB+uXFPpCnJcQU6 vq8q4dmSVmaFSkfw8YGXPSKEgtgPPi0/lK6cHqGJnf26jVAbOA9d4DEnVKgLjRsbISeB 4pAe+KDWUtz3oAxAF6LxLZOtkHGqoXMz5kxTWj6DyAb9ST+0+We9QiP6DKXIqqOzfE/d IqBd+jWVufxPn81pvFi5bdxvZaTYaqEWeWTdlDMWo5HcYxX/HZMFLJHBEyn7MoaMM2/C Kw2A== X-Gm-Message-State: AOAM532zIXVAcvAz3ZGsS2yCqqxd6uFZXk/kQLoaCwfTeXJD61WM91FY F2bdqTA2JHiOqvFnQNOSYyGstxs+yS28iB3R7Sk= X-Google-Smtp-Source: ABdhPJxR+m/mYeQnBz31l07zwx6FlkihsYd/IFMfu798vkxeNh2prnsDf2+f64FwlL/Y8ed6IwnABA== X-Received: by 2002:a2e:a171:0:b0:244:c2fc:d1d with SMTP id u17-20020a2ea171000000b00244c2fc0d1dmr14893352ljl.159.1646080654911; Mon, 28 Feb 2022 12:37:34 -0800 (PST) Received: from mail-lj1-f176.google.com (mail-lj1-f176.google.com. [209.85.208.176]) by smtp.gmail.com with ESMTPSA id z4-20020a0565120c0400b00443823361d0sm1127915lfu.243.2022.02.28.12.37.32 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 28 Feb 2022 12:37:32 -0800 (PST) Received: by mail-lj1-f176.google.com with SMTP id o6so19079805ljp.3 for ; Mon, 28 Feb 2022 12:37:32 -0800 (PST) X-Received: by 2002:a2e:924d:0:b0:246:370c:5618 with SMTP id v13-20020a2e924d000000b00246370c5618mr15158756ljg.358.1646080652034; Mon, 28 Feb 2022 12:37:32 -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:37:15 -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: Matthew Wilcox 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 , =?UTF-8?Q?Christian_K=C3=B6nig?= , 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:16 PM Matthew Wilcox wrote: > > Then we can never use -Wshadow ;-( I'd love to be able to turn it on; > it catches real bugs. Oh, we already can never use -Wshadow regardless of things like this. That bridge hasn't just been burned, it never existed in the first place. The whole '-Wshadow' thing simply cannot work with local variables in macros - something that we've used since day 1. Try this (as a "p.c" file): #define min(a,b) ({ \ typeof(a) __a = (a); \ typeof(b) __b = (b); \ __a < __b ? __a : __b; }) int min3(int a, int b, int c) { return min(a,min(b,c)); } and now do "gcc -O2 -S t.c". Then try it with -Wshadow. In other words, -Wshadow is simply not acceptable. Never has been, never will be, and that has nothing to do with the typeof(pos) pos kind of thing. Your argument just isn't an argument. 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 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 E10A1C433FE for ; Mon, 28 Feb 2022 20:45:08 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.94.2) (envelope-from ) id 1nOmtH-00052R-6V; Mon, 28 Feb 2022 20:45:06 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nOmtF-00052K-U1 for linux-f2fs-devel@lists.sourceforge.net; Mon, 28 Feb 2022 20:45:04 +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=S/LNP14iVGpJY7HEU3KoWC3rGBeIOldyeXi/18P4YEg=; b=CFWPhxoql0gKACiRJoSCoaVE4M +97avcBrRglUeHvdghmyqXIVXP8oPGtZgAl9wBKzkufFHkC8YblLjGvRjFJafM1hMPedzpxfALuM/ q2RxpKCrrFd/o9xMA8iFH9WCw7vW6YqUQYiBya3W+OnA4R0jtuyW8mMgMLeHFhaAHKYY=; 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=S/LNP14iVGpJY7HEU3KoWC3rGBeIOldyeXi/18P4YEg=; b=LS/mTeR+GKzOsygrMSv1QIAj0y jzbPdjrMUcXNRhXoc01GRMy385Rdkg/q/vmLhxSZmWN8afjkg+WzxggDFXxUfwOVFjFuwEE71OHFP oztMcUrkBhPJvJ3f9oc0cBytqmBpaeAQYsHzv2V2ZUJAUpD1aZ9b5Ln3Dl7DtBiy2/10=; Received: from mail-lf1-f43.google.com ([209.85.167.43]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.94.2) id 1nOmtA-0005US-Bx for linux-f2fs-devel@lists.sourceforge.net; Mon, 28 Feb 2022 20:45:04 +0000 Received: by mail-lf1-f43.google.com with SMTP id f37so23401466lfv.8 for ; Mon, 28 Feb 2022 12:45:00 -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=S/LNP14iVGpJY7HEU3KoWC3rGBeIOldyeXi/18P4YEg=; b=JCfpf2EkV0u8p2DIwI3SoZoRhHthQMEAy9/7LEkowc8JnTmPgsFXHlzh4U3t+Q6SEk Lc7ftzGO2kIrejoWkV3dzzd0jpx1zu67BigJ1Dmt6MH2aSREOTU5VOooJKZjMGKU+kco F0IyOo2hDxkf3WtcbllN4ffR7kqC0AZqO0I4w= 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=S/LNP14iVGpJY7HEU3KoWC3rGBeIOldyeXi/18P4YEg=; b=XHfRUG7ezAmRiqWQZ4XWP1OGatV9n4tMG7PbqM5PqCkHcOU6rSV0qZkRdfFm8cO2tM w41Cz7IaZgIW+zo/nfWihd6UyRvq3jKTxqR3YQ7ynyh4KCZ016Rli877fx0QF9gAu+e1 8tVbEQBIuB1kHNQ7eXYrVfkCoFlNu8CZMhtUOlXhq5kSFz/34JeGnw/zroA2SDSrvSU0 exXzJjkHS8FmvpNgcG0XRhxRSZSyUWtRHySAKpTvSyjG4LMuzClXO7OqmbRiC9rfT5Wx AJHuNVzAC3lxB9axf0blHjMtjoFzNxNrp+x+CZz5ofZ6LZtIiJ2F4w/vKDM9yBYDwOh9 BVMA== X-Gm-Message-State: AOAM532YRWLkNjCB+UyaM4oypSB5zdO0tA4rY2Gj0L6Tx3piSzGAADvL YKEkJ225heNqymbvznSMrWRP/qml4rslYw9zfmE= X-Google-Smtp-Source: ABdhPJwqfGeEi7Uieo/G0ajxdQB0OmEj9zhRp5YnOjEp6UGdXgAlLy9fyWb8OYclNKh8MZR9aLQpSg== X-Received: by 2002:a19:fc15:0:b0:445:79b6:3bf6 with SMTP id a21-20020a19fc15000000b0044579b63bf6mr11336611lfi.282.1646081093610; Mon, 28 Feb 2022 12:44:53 -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 i6-20020a198c46000000b0044424910c94sm1137125lfj.113.2022.02.28.12.44.53 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 28 Feb 2022 12:44:53 -0800 (PST) Received: by mail-lj1-f169.google.com with SMTP id p20so19171665ljo.0 for ; Mon, 28 Feb 2022 12:44:53 -0800 (PST) X-Received: by 2002:a2e:924d:0:b0:246:370c:5618 with SMTP id v13-20020a2e924d000000b00246370c5618mr15158756ljg.358.1646080652034; Mon, 28 Feb 2022 12:37:32 -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:37:15 -0800 X-Gmail-Original-Message-ID: Message-ID: To: Matthew Wilcox X-Headers-End: 1nOmtA-0005US-Bx 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 , =?UTF-8?Q?Christian_K=C3=B6nig?= , 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:16 PM Matthew Wilcox wrote: > > Then we can never use -Wshadow ;-( I'd love to be able to turn it on; > it catches real bugs. Oh, we already can never use -Wshadow regardless of things like this. That bridge hasn't just been burned, it never existed in the first place. The whole '-Wshadow' thing simply cannot work with local variables in macros - something that we've used since day 1. Try this (as a "p.c" file): #define min(a,b) ({ \ typeof(a) __a = (a); \ typeof(b) __b = (b); \ __a < __b ? __a : __b; }) int min3(int a, int b, int c) { return min(a,min(b,c)); } and now do "gcc -O2 -S t.c". Then try it with -Wshadow. In other words, -Wshadow is simply not acceptable. Never has been, never will be, and that has nothing to do with the typeof(pos) pos kind of thing. Your argument just isn't an argument. 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 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 DFC95C433F5 for ; Mon, 28 Feb 2022 20:44:35 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5CB9710E70E; Mon, 28 Feb 2022 20:44:35 +0000 (UTC) Received: from mail-lj1-x233.google.com (mail-lj1-x233.google.com [IPv6:2a00:1450:4864:20::233]) by gabe.freedesktop.org (Postfix) with ESMTPS id B0ABA10E8BD for ; Mon, 28 Feb 2022 20:44:33 +0000 (UTC) Received: by mail-lj1-x233.google.com with SMTP id e8so19130907ljj.2 for ; Mon, 28 Feb 2022 12:44:33 -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=S/LNP14iVGpJY7HEU3KoWC3rGBeIOldyeXi/18P4YEg=; b=JCfpf2EkV0u8p2DIwI3SoZoRhHthQMEAy9/7LEkowc8JnTmPgsFXHlzh4U3t+Q6SEk Lc7ftzGO2kIrejoWkV3dzzd0jpx1zu67BigJ1Dmt6MH2aSREOTU5VOooJKZjMGKU+kco F0IyOo2hDxkf3WtcbllN4ffR7kqC0AZqO0I4w= 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=S/LNP14iVGpJY7HEU3KoWC3rGBeIOldyeXi/18P4YEg=; b=QcTi99221f1Z32kuegGwL+QnLxRmJZ5V3qBXDc8FVUtNMwFG4GyZnnktX9qgy8JdL8 Ojv2cKQnNjQWiVyOAYtyB/AgJ8fW76WZooiZr4ZuDd7ZDvkvGMen6BgP7EkH6f+1mW0B usuZQq9XdLHXDKRZG/oV4MeauzQ2hWqJHQ9iTEHNw1vOfgevxyYHxuXaYizoAUJfGlzG ZA5M5kJgtW0R7iQXwlOut/Pcv+VqjnSJ/1aj/uR1JAtfGdx1aPemv7/bW2KdLqvbohrg 2yOPRvLY+GgG7AuvJFg71HNQL5zR0DfsMZuGGUuSbB2AchpenvDHkkYMhy64QeMP7Raq sZIA== X-Gm-Message-State: AOAM530CpHQ9ldSlQa55gZ3ZN7GPDDfjyiO8o5/ArWUx1cqA0vnW+efW rDliMSfEJCVLySzBmbXIOhCRwzQfa5JsJWDm9K8= X-Google-Smtp-Source: ABdhPJwWLIsc5w3iTwXM5y54Ig9XBE8o6EfT2tfHDU6vx+1whZNEe+5YbjEgIcbsZlKjl9P7bNWPqg== X-Received: by 2002:a05:651c:307:b0:244:c6a1:167d with SMTP id a7-20020a05651c030700b00244c6a1167dmr15575868ljp.263.1646081071779; Mon, 28 Feb 2022 12:44:31 -0800 (PST) Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com. [209.85.167.48]) by smtp.gmail.com with ESMTPSA id j9-20020a2ea909000000b0023742cb505dsm1517367ljq.82.2022.02.28.12.44.31 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 28 Feb 2022 12:44:31 -0800 (PST) Received: by mail-lf1-f48.google.com with SMTP id b11so23415246lfb.12 for ; Mon, 28 Feb 2022 12:44:31 -0800 (PST) X-Received: by 2002:a2e:924d:0:b0:246:370c:5618 with SMTP id v13-20020a2e924d000000b00246370c5618mr15158756ljg.358.1646080652034; Mon, 28 Feb 2022 12:37:32 -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:37:15 -0800 X-Gmail-Original-Message-ID: Message-ID: To: Matthew Wilcox 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 , =?UTF-8?Q?Christian_K=C3=B6nig?= , Mike Rapoport Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On Mon, Feb 28, 2022 at 12:16 PM Matthew Wilcox wrote: > > Then we can never use -Wshadow ;-( I'd love to be able to turn it on; > it catches real bugs. Oh, we already can never use -Wshadow regardless of things like this. That bridge hasn't just been burned, it never existed in the first place. The whole '-Wshadow' thing simply cannot work with local variables in macros - something that we've used since day 1. Try this (as a "p.c" file): #define min(a,b) ({ \ typeof(a) __a = (a); \ typeof(b) __b = (b); \ __a < __b ? __a : __b; }) int min3(int a, int b, int c) { return min(a,min(b,c)); } and now do "gcc -O2 -S t.c". Then try it with -Wshadow. In other words, -Wshadow is simply not acceptable. Never has been, never will be, and that has nothing to do with the typeof(pos) pos kind of thing. Your argument just isn't an argument. 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 9F183C433F5 for ; Tue, 1 Mar 2022 04:38:17 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 524AD10EB47; Tue, 1 Mar 2022 04:37:48 +0000 (UTC) Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8364F10E8C7 for ; Mon, 28 Feb 2022 20:37:36 +0000 (UTC) Received: by mail-lf1-x136.google.com with SMTP id bu29so23543843lfb.0 for ; Mon, 28 Feb 2022 12:37:36 -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=S/LNP14iVGpJY7HEU3KoWC3rGBeIOldyeXi/18P4YEg=; b=JCfpf2EkV0u8p2DIwI3SoZoRhHthQMEAy9/7LEkowc8JnTmPgsFXHlzh4U3t+Q6SEk Lc7ftzGO2kIrejoWkV3dzzd0jpx1zu67BigJ1Dmt6MH2aSREOTU5VOooJKZjMGKU+kco F0IyOo2hDxkf3WtcbllN4ffR7kqC0AZqO0I4w= 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=S/LNP14iVGpJY7HEU3KoWC3rGBeIOldyeXi/18P4YEg=; b=lgD/VbTcpjr0r7EWW9xuVtTutKP//lVD7L5L+JcZtOGSlQNMcKJOjSs6FFpMGcbkCh 3U7ZwrdDM5oSdjjG6055XwRbXeUPWhikOqn4SEf7HjNDCjwDTLepD9YVQtKnuUlKnwGg QVvX+fVu6UDhadd/DRzwxuDmbrUa7OB0C6Irz6VbNTeATU4Ym8rIUxw34hmtEbhCdX1i mCLR4RELFMASiCOAvdDCZKShEQbfMAOdFNQA6E0K/6DRMIMkGi2LIjxFkC3zKVW4isNp T8mTJtptTVzoBeCdrArMDoOfHacdYi2+lQ3ACTiRPQ69kSTUe3g8GAGLi0lU3wi/geo8 JHTQ== X-Gm-Message-State: AOAM532+lEwhB5+varDblLFobgoKv8Y0vylgmzcmG3k5AcatvSBP6Qrb 4JR9avBU8y0nYNDwwBXLwa2Xs+iHGiyumOUUATw= X-Google-Smtp-Source: ABdhPJx1+za66U0/gCZKfluzvEJ9JxTUf2tuVFEELZKUnCfwrpScSkySEf7zQiVeuWLwDDfBhtK5TQ== X-Received: by 2002:a05:6512:3335:b0:444:869:882e with SMTP id l21-20020a056512333500b004440869882emr13327097lfe.41.1646080654602; Mon, 28 Feb 2022 12:37:34 -0800 (PST) Received: from mail-lj1-f181.google.com (mail-lj1-f181.google.com. [209.85.208.181]) by smtp.gmail.com with ESMTPSA id z11-20020a2eb52b000000b00246666fdd86sm1521076ljm.72.2022.02.28.12.37.32 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 28 Feb 2022 12:37:32 -0800 (PST) Received: by mail-lj1-f181.google.com with SMTP id y24so79644ljh.11 for ; Mon, 28 Feb 2022 12:37:32 -0800 (PST) X-Received: by 2002:a2e:924d:0:b0:246:370c:5618 with SMTP id v13-20020a2e924d000000b00246370c5618mr15158756ljg.358.1646080652034; Mon, 28 Feb 2022 12:37:32 -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:37:15 -0800 X-Gmail-Original-Message-ID: Message-ID: To: Matthew Wilcox 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 , =?UTF-8?Q?Christian_K=C3=B6nig?= , Mike Rapoport Errors-To: nouveau-bounces@lists.freedesktop.org Sender: "Nouveau" On Mon, Feb 28, 2022 at 12:16 PM Matthew Wilcox wrote: > > Then we can never use -Wshadow ;-( I'd love to be able to turn it on; > it catches real bugs. Oh, we already can never use -Wshadow regardless of things like this. That bridge hasn't just been burned, it never existed in the first place. The whole '-Wshadow' thing simply cannot work with local variables in macros - something that we've used since day 1. Try this (as a "p.c" file): #define min(a,b) ({ \ typeof(a) __a = (a); \ typeof(b) __b = (b); \ __a < __b ? __a : __b; }) int min3(int a, int b, int c) { return min(a,min(b,c)); } and now do "gcc -O2 -S t.c". Then try it with -Wshadow. In other words, -Wshadow is simply not acceptable. Never has been, never will be, and that has nothing to do with the typeof(pos) pos kind of thing. Your argument just isn't an argument. Linus From mboxrd@z Thu Jan 1 00:00:00 1970 From: Linus Torvalds Date: Mon, 28 Feb 2022 12:37:15 -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:16 PM Matthew Wilcox wrote: > > Then we can never use -Wshadow ;-( I'd love to be able to turn it on; > it catches real bugs. Oh, we already can never use -Wshadow regardless of things like this. That bridge hasn't just been burned, it never existed in the first place. The whole '-Wshadow' thing simply cannot work with local variables in macros - something that we've used since day 1. Try this (as a "p.c" file): #define min(a,b) ({ \ typeof(a) __a = (a); \ typeof(b) __b = (b); \ __a < __b ? __a : __b; }) int min3(int a, int b, int c) { return min(a,min(b,c)); } and now do "gcc -O2 -S t.c". Then try it with -Wshadow. In other words, -Wshadow is simply not acceptable. Never has been, never will be, and that has nothing to do with the typeof(pos) pos kind of thing. Your argument just isn't an argument. Linus