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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7EE8CC433F5 for ; Sat, 12 Mar 2022 21:44:13 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B439E8D0002; Sat, 12 Mar 2022 16:44:12 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id AF3468D0001; Sat, 12 Mar 2022 16:44:12 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9BAA78D0002; Sat, 12 Mar 2022 16:44:12 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0240.hostedemail.com [216.40.44.240]) by kanga.kvack.org (Postfix) with ESMTP id 8D2088D0001 for ; Sat, 12 Mar 2022 16:44:12 -0500 (EST) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 0DD0A181F3B4A for ; Sat, 12 Mar 2022 21:44:12 +0000 (UTC) X-FDA: 79237062744.27.F684A31 Received: from mail-lf1-f44.google.com (mail-lf1-f44.google.com [209.85.167.44]) by imf19.hostedemail.com (Postfix) with ESMTP id 8FA671A0023 for ; Sat, 12 Mar 2022 21:44:11 +0000 (UTC) Received: by mail-lf1-f44.google.com with SMTP id g17so20913240lfh.2 for ; Sat, 12 Mar 2022 13:44:11 -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:content-transfer-encoding; bh=Al6bnHgVgcqWGS7SzpEP6EcNnlitYzP4oWhkmGFLRYg=; b=TUNQe6vdMdyq5Mk9RcZa0WrgFWSQNBekv3itbnQYPfxEcKkulC5M9G35QESGHx3lCs CkiAAaqI2HmrSs4euU/9PrCa+nGQ4kj+UavhRfZqSrLFd9YMMCelxwBYrKyghkz/zT4k cSm+n0RWPhJ3qKq/xEsoqAW/Ef3Ix0mfhyfWA= 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:content-transfer-encoding; bh=Al6bnHgVgcqWGS7SzpEP6EcNnlitYzP4oWhkmGFLRYg=; b=zTYYDLx5kjWGpREZJvPB2fRzmnA2apZY0LUXKhNmjZX7CU4REyaL/Oc+AGnzB3o3p1 m+ogylFMg7s+TsGUwT7hIXqKanKZTBo49YuNyB9dnUPMsIAZ2A8jk0cXjU4zcow/JHxx RSgdGgQGmLlGVtYme8p9yjW+F7hqSj9WZd35Z09D2ty1ylhmsh5RPGBQINCfV67WNfRN 9f+tT0IyvFiAWyqsVTWl6zf4yEP2KQdv1ZPT5dHmX/rK8tCLTIqIxAaV37g0iEFnTR8a anyQ9V+K6zFKsqbt/DdYQbjJN3r50oVE+9v3dNBDScpwDPtqRzRC1BWRWUGBjmlSkUiy tIPw== X-Gm-Message-State: AOAM532SrlRkl6dsqK2ih9X1C3tCv+fcuyIPnGsr5KC4XdHCHn2oV0zJ BOAQG2svHfrowFfq+0HpRIe9sBZ5FCJ1t1KmUCo= X-Google-Smtp-Source: ABdhPJxVRnpATtd9oDpd2+xzR1akIJqeJODuPOUP6eVXj/yO8X1ID6dsktsatBS7UU+xC9gUm9IiMA== X-Received: by 2002:a05:6512:2090:b0:448:5050:9131 with SMTP id t16-20020a056512209000b0044850509131mr9248877lfr.326.1647121449563; Sat, 12 Mar 2022 13:44:09 -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 u15-20020a2e2e0f000000b00247e32add6esm2682871lju.0.2022.03.12.13.44.06 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 12 Mar 2022 13:44:07 -0800 (PST) Received: by mail-lf1-f48.google.com with SMTP id h14so20870423lfk.11 for ; Sat, 12 Mar 2022 13:44:06 -0800 (PST) X-Received: by 2002:a05:6512:b13:b0:448:90c6:dc49 with SMTP id w19-20020a0565120b1300b0044890c6dc49mr147974lfu.542.1647121446538; Sat, 12 Mar 2022 13:44:06 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Linus Torvalds Date: Sat, 12 Mar 2022 13:43:50 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 2/6] list: add new MACROs to make iterator invisiable To: =?UTF-8?B?TWljaGHFgiBNaXJvc8WCYXc=?= Cc: Xiaomeng Tong , Arnd Bergmann , Greg Kroah-Hartman , Jakob Koschel , Jann Horn , Kees Cook , Linux Kbuild mailing list , Linux Kernel Mailing List , Linux-MM , Netdev Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 8FA671A0023 X-Stat-Signature: xkxm17d49cuy8q8g9azp9a8mt67eoozr Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=google header.b=TUNQe6vd; spf=pass (imf19.hostedemail.com: domain of torvalds@linuxfoundation.org designates 209.85.167.44 as permitted sender) smtp.mailfrom=torvalds@linuxfoundation.org; dmarc=none X-HE-Tag: 1647121451-987474 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Sat, Mar 12, 2022 at 2:24 AM Micha=C5=82 Miros=C5=82aw wrote: > > The source type is not needed for the macros [..] Ahh. Yeah, as long as we don't do typedefs, it looks like we don't need to pre-declare the member access types. I expected that to be required, because function declarations taking arguments need it, but that's because they create their own scope. Just doing it in a regular struct (or in this case union) declaration is fine. So we would only need that post-declaration. That said, your naming is wrong. It's not just about "self". It's any case where the type we iterate over is declared after the type that has the head. So I suspect it would be a lot better to just always do it, and not do that "self vs non-self" distinction. Linus