Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp1399061rwr; Fri, 5 May 2023 13:33:28 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ66WcVmIiOlVk8Nk/MNyJKqgQPEM3gHiC/XimOoM9tUetmRQd1e8Zws2B4915OOZqj+gTv+ X-Received: by 2002:a17:902:c40b:b0:1aa:fd48:f5e2 with SMTP id k11-20020a170902c40b00b001aafd48f5e2mr3026149plk.32.1683318808033; Fri, 05 May 2023 13:33:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683318808; cv=none; d=google.com; s=arc-20160816; b=jYEfdaQyU/OjdWQekMpyZz5mQEBNHyvYRrzPueaAdQqlYqUdMr/Z59K0Kox9dqUVqc FnCfkYrUMbPvATB5TQMUoL4dPTaFpt+7P3A8DVM1AO6L1WAHScZ4qqLjXVrbj1gWP23S Wv/ZDurwcA5D79nBllqUG4q9xfzLZy3Kb129f3U1M42CGjPxn0cXiByIToGFhTslLhv5 GH5U7zA+IbnHZ8yRChnWYMQRE4/IsXL00DgVjgyA2i+aAahmBgVEBJJOxwCpSSNz3gZF YkotEiNtfmzsEfcNHu3idp3vY15cLzJheb7fOChqcoq3N8fuEMUcEsSwxrqhB5nM6XHT vo1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=ltKupTWDl7vxR6KIX6MAfdEjJwGwAXEv9EmQk2RQVAs=; b=cPQ8QVoEL4e0dylccEWFiXNUvB9Q1jDv7GRx/RIPPqujTcBmkR78mmJDAleCLg0S0d CfE6S/SRhbsKK8+jn1ZypcvxQHwiSltNO9w4YB4GLfD19RVZWQtFHPm3l3LdohvFpOLP tFO7SS6ux4LEgUPEtKXvXlAzLAOR44NS/a3dIyP78aPiqNLzC+QOLF8MQ1yHXRoyw+HY BjaqwMIoX8V2hslHAOqSh12BmKnL5SWbA/avZLZtTqY+Ap6+P2BSTFA7PzYsgYoxlo4Q DpEz9RfUXVIW65+gmfyoJZhfir9571s33gpZ3FaMnVRqmiLzQyYvJSiB9ZwkywOS1dKq KALw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@efficios.com header.s=smtpout1 header.b=IIcIIZrY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=efficios.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w12-20020a170902e88c00b001a97c1afb8asi2560797plg.622.2023.05.05.13.33.15; Fri, 05 May 2023 13:33:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@efficios.com header.s=smtpout1 header.b=IIcIIZrY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=efficios.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232913AbjEEU2q (ORCPT + 99 others); Fri, 5 May 2023 16:28:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230144AbjEEU2o (ORCPT ); Fri, 5 May 2023 16:28:44 -0400 Received: from smtpout.efficios.com (unknown [IPv6:2607:5300:203:b2ee::31e5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 011D040FB; Fri, 5 May 2023 13:28:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=efficios.com; s=smtpout1; t=1683318523; bh=lOJceDItkMuBUJjwo0/e9SQZdXHqosSpw9xAH6N0hSM=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=IIcIIZrYQo99YktN7rvaAwW/GoJRUepRYirU5YqtkVo6qWs3SMFtZtUxh7Eq6E6dm r+kzwA8jLWUce/l5P6XRVYkTMPGShiuwgRTIfEjcyOc1o6nur/dnB6g3kitT0PtSts dnoBFz3lXu8THYVBa1DaOT7fw9ts3f7cppPd3BYiOPVpkQmxiGZcNYtKPxvIB0ymDX KtycY6HDS14VG7/nw4MeIkwqDwL2kRt6SniOB9bsKKooiS+vl30WuLc+AVA2HpxTh7 CzL+Zi0yff5UwKXR1LjYjfZOlx8lbcUtFWfrWCCXeCPK34xSVw+IJKpHrd+qRZHpgU b+TdzSqZzqTgQ== Received: from [172.16.0.99] (192-222-143-198.qc.cable.ebox.net [192.222.143.198]) by smtpout.efficios.com (Postfix) with ESMTPSA id 4QCj231CCcz125Q; Fri, 5 May 2023 16:28:43 -0400 (EDT) Message-ID: <322d22f5-7ab0-adbd-45a0-879364d79ce8@efficios.com> Date: Fri, 5 May 2023 16:28:47 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [RFC PATCH 12/13] blk-mq.h: Fix parentheses around macro parameter use Content-Language: en-US To: Linus Torvalds Cc: Andrew Morton , linux-kernel@vger.kernel.org, Jens Axboe , linux-block@vger.kernel.org References: <20230504200527.1935944-1-mathieu.desnoyers@efficios.com> <20230504200527.1935944-13-mathieu.desnoyers@efficios.com> <3b017a9f-220d-4da8-2cf6-7f0d6175b30c@efficios.com> <3cc72a67-d648-0040-6f60-37663797e360@efficios.com> From: Mathieu Desnoyers In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RDNS_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2023-05-05 16:22, Linus Torvalds wrote: > On Fri, May 5, 2023 at 1:08 PM Mathieu Desnoyers > wrote: >> >> The reason why I think the lvalue of a "=" operator can be argued to be >> "special" is because it is simply invalid to apply many of the C >> operators to an lvalue (e.g. +, -, /, ...), > > Mathieu, you are simply objectively wrong. > > See here: > > #define m1(x) (x = 2) > #define m2(x) ((x) = 2) > > and then try using the argument "a = b" to those macros. > > Guess which one flags it as an error ("lvalue required") and which one does not? I'm glad you are proving me wrong. So it was just a lack of imagination on my end. > > m2 is the only "good" one. Yes, m1 works in 99% of all cases in > practice, but if you want a safer macro, you *will* add the > parentheses. > > So *STOP*ARGUING* based on an incorrect "lowest precedence" basis. > Even for the "lowest precedence" case, you have the *same* precedence. Yes, your example clearly shows it. > The fact is, assignment is not in any way special operation in macros, > and does not deserve - and should absolutely not have - any special > "doesn't need parentheses around argument" rules. Good point. You are right. So that strongly supports the parentheses around use of parameters as lvalues. One less special-case to care about, which is great. Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. https://www.efficios.com