Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp2166680rbb; Tue, 27 Feb 2024 12:50:04 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVZM5/6FWBmP9g1bf53YJ3CUw9WqYN9yapk8rRwkuo7mAYIO8USDCmZiINOCIz6WPTxJde2OnyCW/azeI3QJmL+tMLJYnudJUpq/4PG/g== X-Google-Smtp-Source: AGHT+IF9GNWP3rlX1sC7fWxCA45gLioozi5GE9o619Gan5tYJmCBh4NNVfeyp86q+JRoAxZFAgeJ X-Received: by 2002:a05:6102:825:b0:470:48ea:1966 with SMTP id k5-20020a056102082500b0047048ea1966mr8351292vsb.14.1709067003806; Tue, 27 Feb 2024 12:50:03 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709067003; cv=pass; d=google.com; s=arc-20160816; b=Zbc+WFN8KScy6uwOd2Q+YqX/cY7nd5Jys0sNxbnE/+7b+9+iVW/qTloq99fIMuCYuP 3BKZpyVG/TI4in89KskZMZ1bZEsFAEEIOi7xz8IHAoAyLKVayDcZlxkwMd+t1ZaAjMKf CuosOmcIt+iACWmyk4jLXCX6mJByDllFvBucXSb1aEaxvZirZXKgUdgjDFvnDtiGGphQ 9y3Znr460A7gcy7FrrlnuvRHHJc3oE5kdIsOFLLUmQJchybKRHCUEqL301SMHZ0TziI9 IVbahJ+rQt3P/zpB4tQ72DKUi2HxlvHRDZJK46LbV+pC4O2Q+y2LQMMX/yzlYnPsCWSW MB3A== 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=yi/RZQ8KqnZwl+S2VL1o58Mg6IThl5Qs0hc2x6y80JI=; fh=d6KgACdmTA9e5KTN9Y9G6BGaxzP7I3C7ntSQRi6nZd8=; b=kZ9SoZBHFx7A5m4bPxdnc0EOygNNz207Dyz41fgrcDvCHeOCnYeYyMXo+hPxBDQFXK zkDlLyVxeR0PIagcoIanQXHtUaahDLEVtUfio+KunElVcSGQmAAEckB9ebB211n0VfRc EFdKEYL72WrY7INtJrne2XWJv1w9L3bNFiPB2Z28s2mCcE38by5GPFsROkezxVfg9gqU BJBZ1LfPU97rDksP+sDFoyn8jNmeedmweZZUX2GyAUC0pFJxMu6JuqIS8fIIwPL5KIcm iGeWfukzV3IoxZ6cX+oeX2MKzRy4JJ5qAyfUJQe0L/eK38UWTfH9VeZICO6fUv/jUKgl 0r4g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=N7mHnDdl; arc=pass (i=1 spf=pass spfdomain=linuxfoundation.org dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-83987-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83987-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id f21-20020ac859d5000000b0042ea4fb6165si1303707qtf.28.2024.02.27.12.50.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 12:50:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-83987-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=N7mHnDdl; arc=pass (i=1 spf=pass spfdomain=linuxfoundation.org dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-83987-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83987-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 8E20A1C2472C for ; Tue, 27 Feb 2024 20:50:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C6F4E14E2C8; Tue, 27 Feb 2024 20:49:56 +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="N7mHnDdl" Received: from mail-ej1-f54.google.com (mail-ej1-f54.google.com [209.85.218.54]) (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 0639614DFF0 for ; Tue, 27 Feb 2024 20:49:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709066996; cv=none; b=tG1rKBwlloNompqOSikl0lWDiEie1aVxwMG8VSLTemPIkEeSe6zfs8SIDyqritz0xfG/0YH48p6enOGlh2HR+fWhhr47WOzJ6ICFGypE715g/DRVxfNdbEm0kzoDIgnus13EGnxzm+ylKkfaxNLHCEGelBv6aW8V2KUC3xqUyhM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709066996; c=relaxed/simple; bh=p9k/50J2fJtv36WtCUbSmzFiwVLwISsJpimpNmnaOJo=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=Tkw3RuSCNN8JhqWbg7/mlxNA62vNAW1b41HGDTVf1xZnWfimXY4SXX8+CNYHhrOcULHfRLHuYV1l9lqovQWXlO1+mdWo7iv1Im5cQEDUTQCJ9pLl7GTPvKKNvUp9Vg5Lms4bNp2yfsXtEWgtIZv7SzFSa2VoK0HyX18B11x6aq0= 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=N7mHnDdl; arc=none smtp.client-ip=209.85.218.54 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-f54.google.com with SMTP id a640c23a62f3a-a3d5e77cfbeso39010066b.0 for ; Tue, 27 Feb 2024 12:49:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; t=1709066992; x=1709671792; 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=yi/RZQ8KqnZwl+S2VL1o58Mg6IThl5Qs0hc2x6y80JI=; b=N7mHnDdlSqH85ZaFemTfQk9eMgpfdEUeRWT7CHXa8EPKcauFoDCcpaMVyu/YxebETE w1F9NBzgpidkkMvZtV0K9R22ci7jz1k7hBHYYhNZWdvRizycBwdPnE1h0s1h5cIBWVhe dQwhJd/0LKY7j/VkVx0yJN8rVG1xlBWDfhal0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709066992; x=1709671792; 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=yi/RZQ8KqnZwl+S2VL1o58Mg6IThl5Qs0hc2x6y80JI=; b=SyAjn0sbDB64r5pCF8yR47pqu7Iqh/dx99XSw90gkYAlLAAzIgMjEP3NuqPXHBeVpk 4RjKmsTt9ihchjYHLZfAKcOJ/eztP1E1fyG1T9GrNNhmGz6Veg4AGM33otDmKu/Em1XF N/zT3lS4tMr/VIi3v3oWDstfh90sOaUGNJ7kVgCfQw5bHyjiOsVLBMfmrbQ+MWTg72p5 aK1zW6D8Pgr7vWJ/HKwJX7nzgmCOduwUvuZY0+YTzZm1JwPXatd95029SAFYlf/Sk20m QfWnbH8l3XZRLPTNySBrhmSuQ+qJ1aeeZ209s8VxXiBkUJn4SE+vBMU2IJ7P6hO3VMc9 ScEw== X-Forwarded-Encrypted: i=1; AJvYcCXPgpzEpzQuZdLY52UhoKztRt3cMJ3XXEGEavUkZGqB7kmh/Bp+2c5hO+ywGbdMy2+hB/lxGh6OcXlpbhWGK9K55ofXzSXTJII0lNa6 X-Gm-Message-State: AOJu0YwOu84LA+luoWNKnD9mrDeusyicHzIUhJ0E+jB+nnT+hZbv4iM5 xGBxEsC/uY5T5smpeA/eOscs3K/qtrEwZ2GbOEMjtseC0+M+VLCgIrZWA5JTOvgm+O9TPsMz8Sl K98CZUQ== X-Received: by 2002:a17:906:2414:b0:a3e:c1ef:e1bd with SMTP id z20-20020a170906241400b00a3ec1efe1bdmr416515eja.16.1709066992293; Tue, 27 Feb 2024 12:49:52 -0800 (PST) Received: from mail-ej1-f51.google.com (mail-ej1-f51.google.com. [209.85.218.51]) by smtp.gmail.com with ESMTPSA id wb16-20020a170907d51000b00a4329670e9csm1103903ejc.126.2024.02.27.12.49.51 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 27 Feb 2024 12:49:51 -0800 (PST) Received: by mail-ej1-f51.google.com with SMTP id a640c23a62f3a-a3ed9cae56fso33995366b.1 for ; Tue, 27 Feb 2024 12:49:51 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCWAtKA2UyoUsGEKy82xePsS8QvImdfA10xHOQYWtbkLrKhHeuVfgEPJU/muB5LcK823pvJ22tmjm+IJ3cfCrJijzZEKHFLA3MdY9B/+ X-Received: by 2002:a17:906:4557:b0:a43:1099:7e72 with SMTP id s23-20020a170906455700b00a4310997e72mr375001ejq.35.1709066990810; Tue, 27 Feb 2024 12:49:50 -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> <170905253339.2268463.9376907713092612237.stgit@dwillia2-xfh.jf.intel.com> In-Reply-To: <170905253339.2268463.9376907713092612237.stgit@dwillia2-xfh.jf.intel.com> From: Linus Torvalds Date: Tue, 27 Feb 2024 12:49:34 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/3] cleanup: Add cond_guard() to conditional guards To: Dan Williams Cc: peterz@infradead.org, gregkh@linuxfoundation.org, Dave Jiang , Ira Weiny , Jonathan Cameron , "Fabio M. De Francesco" , linux-kernel@vger.kernel.org, linux-cxl@vger.kernel.org Content-Type: text/plain; charset="UTF-8" On Tue, 27 Feb 2024 at 08:48, Dan Williams wrote: > > cond_guard(mutex_intr, return -EINTR, &mutex); Again, this is *not* helping make code readable and less likely to have bugs. The macro has obvious deficiencies, like the "_fail" argument not being surrounded by "{ }" (the equivalent of parenthesizing an expression argument), but even with that trivial fix the syntax is just too ugly to live, and doesn't match normal C syntax. And yes, we have other macros that don't have normal C syntax, and they are ugly too (example: #define CHKINFO(ret) in drivers/video/fbdev/hgafb.c), but we should have higher standards for globally visible helpers, and we should have *MUCH* higher standards for helpers that are supposed to be all about reducing mistakes. Bad / odd syntax does not reduce mistakes. If a sane 'guard' model doesn't work for some code, the answer is not to make an insane guard model. The answer is to not use 'guard' in code like that. Linus