Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp1912450rdg; Sun, 15 Oct 2023 03:01:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHeB7vHJKeOV0ZRzAv0Ysb5oT3GyF3rUCxPlneyWoiHa9mOgpatmfE2JRObgYY1w+hT93/h X-Received: by 2002:a05:6e02:1d93:b0:349:296c:9b8a with SMTP id h19-20020a056e021d9300b00349296c9b8amr40476934ila.2.1697364087706; Sun, 15 Oct 2023 03:01:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697364087; cv=none; d=google.com; s=arc-20160816; b=ZpdGqE60FwqdupaRGeGLtuuscAMszWas4PqZOH4iOKBkQijz1nxuSpAvlbzNlsWmzm GGRU26Wvj/yVBrUWA46pI2pGlXcIxQV/Z+J8xHIxGFPyOnKYQPPlbVxQYwqpoAYX3YB2 poyzcT2FguZwq10xtb0xzN0LEfRH834VJl/B4QKz+MzUTh5yUVHdB1HVP97bElYV3fuy KwsoazlbjsqFC38bfICCqXwJJfDEt3kMPr96cbBVnxEiBqNWTLxyKAhy0BMK/YxG00sJ eDMweuFZw4kMTARdxZtK2ligukzolYS+wY0P8kIguzJ3h6JWHr9IqnT55u06bNW7qmZs OqdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=WvfQbrUOAety/yQQMKIQiictUB3muNGYsVZ1vSvxI3g=; fh=1AmGqSEG/4sVN1l+fyZ7DsnJh6yTDRPUTWTnvQVT+Qk=; b=VwqGJhrQ5Ooro8UIqsrDsDuCjp3jTm5Ac7hSjjOhpScgXNNlMLUraLE3w4Od+mq4wy Xu21eu93nFxo+F/0k0/DT2l1BA5mKsnh+rATntYmSPEK/rzb2IeZhH99PsQNFBEg1nuE zwRYuhiEd/jPHHVUeCIil1t4VcQtIiWHYPYkli4Ox4YLadzdWOGaS3cJcD/FqX19793h f/+NRhsCnB1qptEWdSxhm3YoLnfntBFFTwl5XNlLvhCiyLRGFg9aWK1DbUDlRwZf30hi igXg61NjPJuPhQIc0QnyzGAR9/Iwq17YuRi8/kF6UFpN5N27LU1c2FXwpBH1Fdh2KLbw f39w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=GhXEcA0F; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id q11-20020a170902bd8b00b001bbf293f45esi7957857pls.625.2023.10.15.03.01.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Oct 2023 03:01:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=GhXEcA0F; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 7D97E8054EF0; Sun, 15 Oct 2023 03:01:25 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229641AbjJOJzZ (ORCPT + 99 others); Sun, 15 Oct 2023 05:55:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229559AbjJOJzY (ORCPT ); Sun, 15 Oct 2023 05:55:24 -0400 Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF324AD for ; Sun, 15 Oct 2023 02:55:21 -0700 (PDT) Received: by mail-ed1-x534.google.com with SMTP id 4fb4d7f45d1cf-53e855d7dacso1168428a12.0 for ; Sun, 15 Oct 2023 02:55:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697363720; x=1697968520; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=WvfQbrUOAety/yQQMKIQiictUB3muNGYsVZ1vSvxI3g=; b=GhXEcA0FIO87MWvMyLWvsXwtu/kLh+tzUnrnX4XJSYhVOlkGOupELtKMtpKtYW+ss5 DgLl/lIGgpUmqeIHRuFJLT12pLPS3349+Vi/stkwrb0HBxxeOuabCQ4O8QqOXOyvSXaM 2fIUFcrkux+ATazIFHHkdyOlTkm7efJkgtnvJv9aoj3n8iD0TQ0vgEc5nxgxKPHw0mMs WqSdnLtlINHaclLt9CBNvpY2y+6AkwvgXJn4hUpcjAncj2NpE6178yIgUtRp39e2AZ+s HgZHecW3O0qGvcGThi4NPfuI8zUsgTaAM4+14wjvK2zuWbJf4touk4LvO4UwbXXH/c5V q0ng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697363720; x=1697968520; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=WvfQbrUOAety/yQQMKIQiictUB3muNGYsVZ1vSvxI3g=; b=OYqVplKcs4L0ymNCDBwq2xQVcP9QJ3IRdD8jOgP9ni9yKh0DFF27kLWlqQkCV1kMQ6 nfpx/S+IrphIXGV4EFqKWVkRin5+3LCPCVmRorrc4xvSHIC87+DcX+Qo0K7oRIC0Z2D2 lMZa+MjqzQ56u922T3lU5lN92DdDPPv8XmNGcsSFcBV6UHN8noNKtNrAJIzdF9ALNoXL 1wcsZytzbSL9UBAe6q7d8HufbDz5NXqSzFbKLQ/CXltubAGB0YxvvzK78d8IKA+gdQA5 6Y3o7NkEMMKCq5733XwwEEkR91Lh6qpAfd6Ovx8h38VxPXjdewkWg493bCIV5MXwUo4F rrwQ== X-Gm-Message-State: AOJu0Yza6Uj12ijsLJ/EQViGEWYeeGm4vOg/ERexpuLuu84w8DOKRJe1 JDEeny4EcUVkgrOkuYgZGQ== X-Received: by 2002:a17:906:254:b0:9b2:b691:9b5f with SMTP id 20-20020a170906025400b009b2b6919b5fmr27177944ejl.41.1697363720160; Sun, 15 Oct 2023 02:55:20 -0700 (PDT) Received: from p183 ([46.53.250.251]) by smtp.gmail.com with ESMTPSA id o19-20020a17090637d300b009b65a698c16sm2038960ejc.220.2023.10.15.02.55.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Oct 2023 02:55:19 -0700 (PDT) Date: Sun, 15 Oct 2023 12:55:17 +0300 From: Alexey Dobriyan To: Andrew Morton Cc: linux-kernel@vger.kernel.org, Peter Zijlstra Subject: Re: [PATCH] smp: fix __smp_processor_id() backup macro Message-ID: References: <20231014151221.46096b7fc17ccaeb691ff5d0@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20231014151221.46096b7fc17ccaeb691ff5d0@linux-foundation.org> X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Sun, 15 Oct 2023 03:01:25 -0700 (PDT) On Sat, Oct 14, 2023 at 03:12:21PM -0700, Andrew Morton wrote: > On Sat, 14 Oct 2023 19:14:15 +0300 Alexey Dobriyan wrote: > > > Every __smp_processor_id usage doesn't have arguments and > > every raw_smp_processor_id usage doesn't have arguments, > > therefore "#define __smp_processor_id(x)" can not possibly work. > > > > ... > > > > --- a/include/linux/smp.h > > +++ b/include/linux/smp.h > > @@ -261,7 +261,7 @@ static inline int get_boot_cpu_id(void) > > * regular asm read for the stable. > > */ > > #ifndef __smp_processor_id > > -#define __smp_processor_id(x) raw_smp_processor_id(x) > > +#define __smp_processor_id() raw_smp_processor_id() > > #endif > > > > It's been that way for at least 4 years. Presumably this is never used > and should be removed? Deleting breaks compilation immediately. C89 6.8.3 §4 says "The number of arguments in an invocation of a function-like macro shall agree with the number of parameters in the macro definition, ..." C99 relaxes this in 6.10.3 §4 the number of arguments (including those arguments consisting of no preprocesing tokens) ... shall equal the number of parameters in the macro definition. So, "#define M()" works with M() only, but "#define M(a)" worked with M(1) and started working as M() which is very funny. In other words changelog is wrong: it can and does work (sort of by accident).