Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp2210624rbb; Tue, 27 Feb 2024 14:35:43 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUf0tmGR4irqPvvkUs8HLibOMcM9i0u7m6nRcMchyArCQ+t8mdzSLnaKHCYfKjz0v2kzFsR6vgyISlkaizb73X928ATgepdjibZH31ikw== X-Google-Smtp-Source: AGHT+IGpZE/DOLFhCJCaH1Yv/VJzJPxHeymBiCczgAG2iFM8rj7SVrNPMd8VXypOykMzEuo/bZ29 X-Received: by 2002:a37:c242:0:b0:787:ef5f:26bf with SMTP id j2-20020a37c242000000b00787ef5f26bfmr550384qkm.17.1709073343658; Tue, 27 Feb 2024 14:35:43 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709073343; cv=pass; d=google.com; s=arc-20160816; b=VAmIb0BhE0g+53bT0nwzOrm8VFootG+0no+cwkwh6auIUlsvbA3plbJn3y90/LstYP 0l8RXu7hFS7z5EzLqGew5pNMrdizMZSv3GkDDOEggh8J/nAUTw1P34zWtcABOYXz5u1F cF3Y+2Wx4IA98F2rwu3j3z71mRwKa7vHqEO+0K5oOyt4Pv/rcghGyTaqMitSLXSj1fta JYBUNkAK9GLnRwU2+OmzKpaJvtsx2PBOE4qTGuqcF2bL9riIiVKc48pv7Wimms1l7e7c l9IaeOSlE67u2btpiTJ1FWntR/W+hyF/lOSCM1UtsqXa/18nDxvT2hltP3xtRpFHi8ms gq6A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=80tkN5Eohd449xb1/o8bHCFsCfXV3ux6KwUX2Tit340=; fh=GcpMcvKlYy68USsNtEwrJpktVQIPmAhUQjN8tSJNCWg=; b=F/DUjwisf33hjBiLiVXLo02CN6vAlapED4VMGJEH7r6wjnhItuYi3NGmqx+d5Kuhnc tZo3r4gl0gkdsJnwGssRLxKS1YeTHHvfG9vWEEG8PFWzuD6cz9rk/IjkcICocR3u1oJF v+B093Xg0ZeAhxaulfJOyYkBlDHWv1lXc6MQJaQzl2AZDnf6V1hK4cEaTJugi3748YH+ 302eaGYAsxUXfYQZfUpzmSNHDedSQeU4NTuORfRQHBw/V3JFq1wC3KSyY7ks73c0sIS0 uyhvdbs0IU23ZwIo7PKIMi5lr+TKybvVnIewuoFV2sU87TrjGug9wLxNilUrHSyJK+Bq Po2w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=CpXjLBgf; arc=pass (i=1 spf=pass spfdomain=linuxfoundation.org dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-84131-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84131-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id pi32-20020a05620a37a000b00787cb02f53dsi6877440qkn.69.2024.02.27.14.35.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 14:35:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-84131-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=CpXjLBgf; arc=pass (i=1 spf=pass spfdomain=linuxfoundation.org dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-84131-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84131-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id C8AEE1C2582C for ; Tue, 27 Feb 2024 22:35:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 267535577B; Tue, 27 Feb 2024 22:35:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="CpXjLBgf" Received: from mail-ej1-f47.google.com (mail-ej1-f47.google.com [209.85.218.47]) (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 DBD6B1E86C for ; Tue, 27 Feb 2024 22:35:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709073315; cv=none; b=DBxx/P5Kjfa/973jIXdRrZPScaya85sXrcCijjB6sXzos9ZyLt16CZjkLXFUryD3JBd4lpK9TpkFRccxBW91xPN9DnadrPuTtEXm6Ef158xQhZeG6ALRt+pbsdhWpBcnE8rBORQPb2WdWoLAAcXn8shw7tBP7Iz333BJ4DC/rHM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709073315; c=relaxed/simple; bh=bU1XyaKXGe+O/mEyWnCgT6O04rrbmrD9+GXNZIedtCA=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=f5ks2lwNMS/omboHoJfF0cxnGhcsmTTBJQeL9wKXJ18Ts2AmREBNs6t2a25QFFLEVPW0uXU+c/vnxD706x5SfiZvct/aXFqGvYvVvdoGfcDkWR+tyFkTEXwEaUw0y/opZjIJvFaDB6hC7Gj3Jle49J60wAaiB0evQEE63OCFjTA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org; spf=pass smtp.mailfrom=linuxfoundation.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=CpXjLBgf; arc=none smtp.client-ip=209.85.218.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linuxfoundation.org Received: by mail-ej1-f47.google.com with SMTP id a640c23a62f3a-a26ed1e05c7so772051566b.2 for ; Tue, 27 Feb 2024 14:35:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; t=1709073311; x=1709678111; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=80tkN5Eohd449xb1/o8bHCFsCfXV3ux6KwUX2Tit340=; b=CpXjLBgfg3Q+5vek8hLkIQcosuVvPflUendIgyuIGBfMzgGrlU0L7NUsPHWrE6wHbp lI3k64YoKwmJf0c/M/sfEx7IzEB9kxxSwiH+Atlmnlm6oYBM3CnCB5AXUJouY1vT/f59 6+gZB1sRw09AJpSbQSf2U5pkkqBJ8EfJzyKC0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709073311; x=1709678111; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=80tkN5Eohd449xb1/o8bHCFsCfXV3ux6KwUX2Tit340=; b=HB918YLD7mAnGMlAzdZUcohtTXbMxOoDTjaoOMA7It1Qe1u8mV87odV6tpf8G1/eCF KGPEoLFK0F+biWhWmOSucHWkzgMXcX4eB0II9YT74tDtV7NRZX+pvx+0G07EME/EAcRw ZAHYtwfwW4A1qhIpksppjgP9UtW/5StaxQvNBVFIIB5uqu6bZ62VrLU9ESMbHt0TNDnd p0FvcJwXJnRJ5GWJ+ced9RyjgXK2aL9Xfr4gxtrBSgpn7EhoJs57VpBen8tspAtHnRtH ln9ePiaWx2NY4B0p2nn3tbSfr00CXErztVlYwYJC+Jo5BQkEMEtrOWRwqeaW+CrD2Pkq udLQ== X-Forwarded-Encrypted: i=1; AJvYcCUWNEex0nIXw97fws+Vm4Absow/rV5iEuRLuMfpQ1GKY9gWzQsEW8blU/LCXI/xa1l+AzSvCr8m6i2el0tyKbq84Tn3IgXjkNVv+BiB X-Gm-Message-State: AOJu0YxZpVWbia4zBGB29Xllali0tAm7sIqDicR70FM0obF0OFFrdpQe jrygf1n1OOjnXqUm4Zst33Tjh3fYV4/2/2J7kRnvbUJy5awmJoqd9r9jfax1DEfy7r/zCu/HRPk jZk+z0A== X-Received: by 2002:a17:906:a00b:b0:a43:39fe:b475 with SMTP id p11-20020a170906a00b00b00a4339feb475mr4975931ejy.45.1709073311126; Tue, 27 Feb 2024 14:35:11 -0800 (PST) Received: from mail-ej1-f47.google.com (mail-ej1-f47.google.com. [209.85.218.47]) by smtp.gmail.com with ESMTPSA id w9-20020a1709061f0900b00a3e4fc3919esm1184192ejj.31.2024.02.27.14.35.09 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 27 Feb 2024 14:35:10 -0800 (PST) Received: by mail-ej1-f47.google.com with SMTP id a640c23a62f3a-a431324e84cso366331166b.1 for ; Tue, 27 Feb 2024 14:35:09 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCVMTyzNUWYMKlhw8qzbot1uXU/YBpQK4TVObiSM14KufAHGRk7HkCl0xB7jh0lflRuxperkLrjJo8Feo50VIHmCuNJGuUKVvQotNlIo X-Received: by 2002:a17:906:b118:b0:a3e:c3b0:e346 with SMTP id u24-20020a170906b11800b00a3ec3b0e346mr7243442ejy.16.1709073309594; Tue, 27 Feb 2024 14:35:09 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <170905252721.2268463.6714121678946763402.stgit@dwillia2-xfh.jf.intel.com> <170905254443.2268463.935306988251313983.stgit@dwillia2-xfh.jf.intel.com> <65de5725824ba_1138c72948c@dwillia2-xfh.jf.intel.com.notmuch> In-Reply-To: <65de5725824ba_1138c72948c@dwillia2-xfh.jf.intel.com.notmuch> From: Linus Torvalds Date: Tue, 27 Feb 2024 14:34:52 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 3/3] cxl/region: Use cond_guard() in show_targetN() To: Dan Williams Cc: peterz@infradead.org, gregkh@linuxfoundation.org, Ira Weiny , Dave Jiang , Jonathan Cameron , "Fabio M. De Francesco" , linux-kernel@vger.kernel.org, linux-cxl@vger.kernel.org Content-Type: multipart/mixed; boundary="00000000000083e343061264a3e1" --00000000000083e343061264a3e1 Content-Type: text/plain; charset="UTF-8" On Tue, 27 Feb 2024 at 13:42, Dan Williams wrote: > > I will also note that these last 3 statements, nuking the proposal from > space, I find excessive. Yes, on the internet no one can hear you being > subtle, but the "MORE READABLE" and "NOTHING" were pretty darn > unequivocal, especially coming from the person who has absolute final > say on what enters his project. Heh. It's not just " one can hear you being subtle", sometimes it's also "people don't take hints". It can be hard to tell.. Anyway, it's not that I hate the guard things in general. But I do think they need to be used carefully, and I do think it's very important that they have clean interfaces. The current setup came about after quite long discussions about getting reasonable syntax, and I'm still a bit worried even about the current simpler ones. And by "simpler ones" I don't mean our current scoped_cond_guard() thing. We have exactly one user of it, and I have considered getting rid of that one user because I think it's absolutely horrid. I haven't figured out a better syntax for it. For the non-scoped version, I actually think there *would* be a better syntax - putting the error case after the macro (the way we put the success case after the macro for the scoped one). In fact, maybe the solution is to make the scoped and non-scoped versions act very similar: we could do something like this: [scoped_]cond_guard(name, args) { success } else { fail }; and that syntax feels much more C-line to me. So maybe something like the attached (TOTALLY UNTESTED!!) patch for the scoped version, and then the non-scoped version would have the same syntax (except it would have to generate that __UNIQUE_ID() thing, of course). I haven't thought much about this. But I think this would be more acceptable to me, and also solve some of the ugliness with the current pre-existing scoped_cond_guard(). I dunno. PeterZ did the existing stuff, but he's offlined due to shoulder problems so not likely to chip in. Linus --00000000000083e343061264a3e1 Content-Type: text/x-patch; charset="US-ASCII"; name="patch.diff" Content-Disposition: attachment; filename="patch.diff" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_lt4y3wa90 IGluY2x1ZGUvbGludXgvY2xlYW51cC5oIHwgNyArKystLS0tCiBrZXJuZWwvcHRyYWNlLmMgICAg ICAgICB8IDUgKysrLS0KIDIgZmlsZXMgY2hhbmdlZCwgNiBpbnNlcnRpb25zKCspLCA2IGRlbGV0 aW9ucygtKQoKZGlmZiAtLWdpdCBhL2luY2x1ZGUvbGludXgvY2xlYW51cC5oIGIvaW5jbHVkZS9s aW51eC9jbGVhbnVwLmgKaW5kZXggYzJkMDliYzRmOTc2Li5hMDE1YWM5NTE3YTYgMTAwNjQ0Ci0t LSBhL2luY2x1ZGUvbGludXgvY2xlYW51cC5oCisrKyBiL2luY2x1ZGUvbGludXgvY2xlYW51cC5o CkBAIC0xNDIsNyArMTQyLDcgQEAgc3RhdGljIGlubGluZSBjbGFzc18jI19uYW1lIyNfdCBjbGFz c18jI19uYW1lIyNleHQjI19jb25zdHJ1Y3RvcihfaW5pdF9hcmdzKSBcCiAgKglmb3IgY29uZGl0 aW9uYWwgbG9ja3MgdGhlIGxvb3AgYm9keSBpcyBza2lwcGVkIHdoZW4gdGhlIGxvY2sgaXMgbm90 CiAgKglhY3F1aXJlZC4KICAqCi0gKiBzY29wZWRfY29uZF9ndWFyZCAobmFtZSwgZmFpbCwgYXJn cy4uLikgeyB9OgorICogc2NvcGVkX2NvbmRfZ3VhcmQgKG5hbWUsIGFyZ3MuLi4pIHsgfSBbIGVs c2UgeyBmYWlsIH0gOgogICogICAgICBzaW1pbGFyIHRvIHNjb3BlZF9ndWFyZCgpLCBleGNlcHQg aXQgZG9lcy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