Received: by 2002:a89:288:0:b0:1f7:eeee:6653 with SMTP id j8csp273031lqh; Mon, 6 May 2024 20:28:25 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVUwRrYB7vPZvOZe9K7jNxYlxPXy2MKnN53VtPK5T7EjyNL75I+EiwlfU21so0rH9Gbe4yX/i2TgPcrkaPrz5bVvB+uTSnuWcnaVEUKuA== X-Google-Smtp-Source: AGHT+IGtUSyNWlrMiZr2toq9L+dAS2aoDj4Ph/i1D42PaoG+H8+4SHiQmvp8rPBduM1WZMpNGBQF X-Received: by 2002:ad4:5fc7:0:b0:6a0:def5:8281 with SMTP id jq7-20020ad45fc7000000b006a0def58281mr2504926qvb.11.1715052505028; Mon, 06 May 2024 20:28:25 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715052505; cv=pass; d=google.com; s=arc-20160816; b=LzHZtF4Ipzj6JeKz6vFJlAhQYhlTHev+kZNVOZ18hvvdbqENJUGHSxNr9jjRk8JL1b CQhadeIYA4Dl+0BGV70VhJr65mfQAJS55pC9NOldw5GEGXj/HNNsNX0RG2E8n1QSjmqZ bjFvZqkLS5vMH53oECNltn9OQ7/BDjEmWatyMGo3PYNl6uk+/ogByfkD+QJ5OoXNaA/x 2b5XdUSVN4U3ix4EMVtr5NWcOMbQWBajaORNalidIhkyJs5O9gBbX5XzVTYL+0N+CQ/m Zva0yRhai1iEPw/4KHI+BGiSIMVooZybpNisfU3w7PAlctHgHZzXt1/rCm8ciOaabzWF ijGw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=yG0hyI/fiqqTDu9hk0CUtBDwmucjumAbk3/rvFBap28=; fh=4Vq7PglDPzS1qAe04/syrMZpNFzkYxedlO1cVuvHKnM=; b=B7Wacz6YNHPTlI/FKAdtU+/p48vmq7AuSwkfUgwmiJ9BjzKe+pvQJMJ7/Z8Dch/aHP MZmKc25c5j6xL9Rcxi1T2Z2tXxsEcL8G5vPFn+NKP5QrCJ8LXYuVrXdVoVwNvsVFQ/W1 8sJGzFYNEScdYOQ+RhHBIFk3bsFNu19GNgUe60fcaBHmYhwrcrsTSRMmZwveEi0Iiolc EuATuCeAYD+ihaPfzbfc1a3zsMQzrlQtoHREIncrSkyI/JiE+QUu8u5QOEEGQ+Rian0P MKykk6asl0frNKVGMOfIElF/Vy8fkBF0i1UxhkWQn+zKvXCzb2CnMxUF1X78WsDPzpDe HZeg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=KYwa9sLS; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-170612-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-170612-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id a8-20020a056214062800b006a0c91ea778si10561198qvx.210.2024.05.06.20.28.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 May 2024 20:28:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-170612-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=@gmail.com header.s=20230601 header.b=KYwa9sLS; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-170612-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-170612-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 BBC1D1C21D22 for ; Tue, 7 May 2024 03:28:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D62223FBB0; Tue, 7 May 2024 03:28:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="KYwa9sLS" Received: from mail-pf1-f177.google.com (mail-pf1-f177.google.com [209.85.210.177]) (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 B7C8C4C94; Tue, 7 May 2024 03:28:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715052498; cv=none; b=oUHssI82dNwPIfwNn/d+RMBxxTo6ExE4zTgLJtHpBekiE8NcZuDqPX7piJ67YDbouKZHeOMC4i9rD+zT46eYlxUUUaOzdL1svvtq+bJeLtGkHYH1aB8Ml+UN6CPL6klo3TjR6VrUN9V0ZROp9ldjWqyWdiN6cgSVwh4wu4ZsHME= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715052498; c=relaxed/simple; bh=oFI7tm++PMwnpezXZl6+RVdttyuxeXzDX3sJCx+Aak0=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=oEJa28YVE8+VNnUfd5+q8jJ8/oJ3N3KG6SAMOrFZo/hr3D7lp40WMsnCIU4iODRPZy12fVZqZpBTaPL8jg6HXhCPqUYptvNebmM/E6CYf15MI0JhOw8G7cLC70PfTfpr8e1Kw09lo55AZ74Noezuv0UEfMuBS1M4e0bzYQm94iQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=KYwa9sLS; arc=none smtp.client-ip=209.85.210.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pf1-f177.google.com with SMTP id d2e1a72fcca58-6f457853950so1679565b3a.0; Mon, 06 May 2024 20:28:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715052496; x=1715657296; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=yG0hyI/fiqqTDu9hk0CUtBDwmucjumAbk3/rvFBap28=; b=KYwa9sLSXcn+NCJnGyeLhjD/tgCat5GQegioFbSBlGBjPXiQ2BoO5sIkd4Y2kThUuy MoaZ/MzBs0OwxDWiJ1fRYRo61OpL/f62miUwwiUalY7McLwCYaOx72hh9Hmzom+zdpk2 A55E01C9B+ike+WEuWu18ujwJKbjR2/vFy9pgXEBlAQzNBcQQm7vqe648cEHn/ElepYJ N0htIxc9KOCju+q5sMkkfUYV4D6fQPggzP85t/FHZBXSLMtQyzTOK2B08l3SH2qfpnpY j/tfiy1Ud2UY35HpQ7xJ2D9NBQXQM4Hs/vp+2jT9aAN6QAYsaYyYNruao0JwdegkvZ7p GP7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715052496; x=1715657296; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=yG0hyI/fiqqTDu9hk0CUtBDwmucjumAbk3/rvFBap28=; b=QPZteD9g1gclYg8sc+AYd2+DR7cMph7fJszicZ2RvnT07/HWB/grnGB53m4DsSH7lz Wgx4QGeoh+64Df+hoJBkQES+1CW5J/wkARnOHSMf8tftRPForyJ88nq9/AgDPhvF0dTj J8r+aIj3L3gp/j09VMY+9snVcVLRsU1fTRH+bYquA8Z7kWE3EYs6KlyzxFPZAbfVIKCF vWvc0bBZaBZxj6csUKOllGUVNkspI/MaAhbxKwYBGyN/6zX32KTnvLCSiYCs1jPl6+9z AQrd15HDAeJpNwW7dZ1mNw18yJU5vH6kBMBiNRDxkOXjYNRi9ktwhJeQAp/339uQ2ZEF l5Ug== X-Forwarded-Encrypted: i=1; AJvYcCVL/g9CZnNwRLGdioQO8TUiVx5H+tF4jq9/UujnS+FH0Gfl+AhzCc9HD28cYhAbbRC6loCD6jFnDvxc2SZzVBzHoUQI0Oy5hgdW0kLswmlBCdRi8sAGJAndCUDC2z9zbvQQ3DLGGgfrysviSHW4tlZlLHpmI3PLmPLmQ/wp70vQrHH2 X-Gm-Message-State: AOJu0Yy8FMp0q9JyPBKUgxHQHaAtc+9lk74EBg8fYhg3oNZZGfdDion8 T0dCanFQ3tpxMZqYnx+1pSr/Z+Jzxm0deDGYVZ3n5TI5gi8IyP2r X-Received: by 2002:a17:902:e891:b0:1e2:58f:7ed4 with SMTP id w17-20020a170902e89100b001e2058f7ed4mr2443528plg.5.1715052495885; Mon, 06 May 2024 20:28:15 -0700 (PDT) Received: from localhost.localdomain ([2407:7000:8942:5500:aaa1:59ff:fe57:eb97]) by smtp.gmail.com with ESMTPSA id p16-20020a170902ebd000b001ebd7bdaaffsm8988409plg.288.2024.05.06.20.28.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 May 2024 20:28:15 -0700 (PDT) From: Barry Song <21cnbao@gmail.com> To: akpm@linux-foundation.org, linux-doc@vger.kernel.org Cc: apw@canonical.com, broonie@kernel.org, chenhuacai@loongson.cn, chris@zankel.net, corbet@lwn.net, dwaipayanray1@gmail.com, herbert@gondor.apana.org.au, joe@perches.com, linux-kernel@vger.kernel.org, linux@roeck-us.net, lukas.bulwahn@gmail.com, mac.xxn@outlook.com, sfr@canb.auug.org.au, v-songbaohua@oppo.com, workflows@vger.kernel.org Subject: [PATCH v7 0/2] codingstyle: avoid unused parameters for a function-like macro Date: Tue, 7 May 2024 15:27:55 +1200 Message-Id: <20240507032757.146386-1-21cnbao@gmail.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Barry Song -v7: * collect ack of Joe for checkpatch.pl, thanks! * fixed an indentation per Joe -v6: * collect ack of Joe, thanks! * refine docs according to Jonathan, thanks! * add checkpatch doc according to Joe, thanks! v6 link: https://lore.kernel.org/lkml/20240506014606.8638-1-21cnbao@gmail.com/ -v5: * Simplify the code for Patch 2 according to Joe's suggestions. * add s-o-b of Barry according to Jeff Johnson v5 link: https://lore.kernel.org/all/20240401012120.6052-1-21cnbao@gmail.com/ -v4: * fix Xining's email address, s/ma.xxn@outlook.com/mac.xxn@outlook.com/g * fix some false positives of checkpatch.pl * downgrade from ERROR to WARN in checkpatch.pl Thanks for Joe's comments! v4 link: https://lore.kernel.org/all/20240328022136.5789-1-21cnbao@gmail.com/ -v3: https://lore.kernel.org/all/20240322084937.66018-1-21cnbao@gmail.com/ A function-like macro could result in build warnings such as "unused variable." This patchset updates the guidance to recommend always using a static inline function instead and also provides checkpatch support for this new rule. Barry Song (1): Documentation: coding-style: ask function-like macros to evaluate parameters Xining Xu (1): scripts: checkpatch: check unused parameters for function-like macro Documentation/dev-tools/checkpatch.rst | 14 ++++++++++++++ Documentation/process/coding-style.rst | 23 +++++++++++++++++++++++ scripts/checkpatch.pl | 6 ++++++ 3 files changed, 43 insertions(+) -- 2.34.1