Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3072747pxu; Mon, 14 Dec 2020 20:07:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJw9PDJp4LDb+0uzQlDXJSSAmmT3qIh/nRVnDgmttt4cBOz8tuzKgJbFy2aeRV3EpS8KEI7+ X-Received: by 2002:a17:907:2116:: with SMTP id qn22mr25283733ejb.483.1608005221210; Mon, 14 Dec 2020 20:07:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608005221; cv=none; d=google.com; s=arc-20160816; b=sL7hUZd5a+Stbnnm1k2oDjdPVOSZmiTHpAKFljidK5QixHd2Qhac+vYQSrOB7AZSYv cLfDYBbLKc1zYP1l6hH6Ebkw3xnccIVeqoTA8hB8qIb0Ptf3xfta7YHN6MvfMovs2qFJ 2HFnD2WJ4g06xsuHZQeaNpQ+0VXHSjjt6Jb9080eFkKOS9Rx8h2R3VLhG2gJ50A2+Byc Qoc4yLGTGk+GhkONXCN3ACBrwjO36uUzYDxvUkf+fvBPJ4qUiG9sMeMZFxeefWEQYWwa HlcborKZ++VRbAZsFO9TK2D2nx71/rqHZPIoapdWaIMGRpXUHUenyX7NXMbrMR5fm7Y4 JEKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=VXsLElP1GmiRoNBFenx6L8okAa2aRVYwcddT6YJM2CY=; b=hxK9U+zIiNeZwCSUXzqVkiHJcF3Jvg0IFd/64QPHc8MhrWWlzGv+wFcUbPUzBscYqG Mz2o8nsVfKq+P6bF7xWTmdq1aRf9uWHKu42/uTHdj5wVNLBslrwmy39UCZ4I8GpJnmXa jzdSg8r8Ea3+RAs6/dB3QNmMfulk2nMraM7Vn1jpEyGoHvRhkMg/aatSb+wKkHjAi0YA QUUJMpVUMfBVboRt55ZDd7ynKMd3zCoR+xzzS6DaAzVCcwQ1S3DEdfmc8bPxjtcjjpDc 2GIfh4tDCeIiL0hJA9md8FQLxPglGqwevQewSV78dQHAIm6Uue2WRvhtVihOU1vRxRSh dQGg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g2si225506edn.508.2020.12.14.20.06.38; Mon, 14 Dec 2020 20:07:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387743AbgLNXWN (ORCPT + 99 others); Mon, 14 Dec 2020 18:22:13 -0500 Received: from mail.kernel.org ([198.145.29.99]:48428 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725993AbgLNXWB (ORCPT ); Mon, 14 Dec 2020 18:22:01 -0500 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5E1E32250F; Mon, 14 Dec 2020 23:21:19 +0000 (UTC) Date: Mon, 14 Dec 2020 18:21:17 -0500 From: Steven Rostedt To: David Laight Cc: 'Bean Huo' , "alim.akhtar@samsung.com" , "avri.altman@wdc.com" , "asutoshd@codeaurora.org" , "jejb@linux.ibm.com" , "martin.petersen@oracle.com" , "stanley.chu@mediatek.com" , "beanhuo@micron.com" , "bvanassche@acm.org" , "tomas.winkler@intel.com" , "cang@codeaurora.org" , "joe@perches.com" , "linux-scsi@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v3 1/6] scsi: ufs: Remove stringize operator '#' restriction Message-ID: <20201214182117.1bbc717d@gandalf.local.home> In-Reply-To: <977f3ea155644cd89bc83f2e9dcf281e@AcuMS.aculab.com> References: <20201214202014.13835-1-huobean@gmail.com> <20201214202014.13835-2-huobean@gmail.com> <977f3ea155644cd89bc83f2e9dcf281e@AcuMS.aculab.com> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 14 Dec 2020 23:11:40 +0000 David Laight wrote: > > --- > > include/trace/events/ufs.h | 40 +++++++++++++++++++------------------- > > 1 file changed, 20 insertions(+), 20 deletions(-) > > > > diff --git a/include/trace/events/ufs.h b/include/trace/events/ufs.h > > index 0bd54a184391..fa755394bc0f 100644 > > --- a/include/trace/events/ufs.h > > +++ b/include/trace/events/ufs.h > > @@ -20,28 +20,28 @@ > .. > > +#define UFS_LINK_STATES \ > > + EM(UIC_LINK_OFF_STATE, "UIC_LINK_OFF_STATE") \ > > + EM(UIC_LINK_ACTIVE_STATE, "UIC_LINK_ACTIVE_STATE") \ > > + EMe(UIC_LINK_HIBERN8_STATE, "UIC_LINK_HIBERN8_STATE") > > If you make EM a parameter to UFS_LINK_STATES then the caller > can pass in the name of a #define that does the required expansion. > The caller can also add in any required terminator after the last entry. > For an enum (which doesn't want a , at the end) just add a dummy entry. > You often want a constant for the number of items anyway. This is currently the way its done in multiple other places. When creating the "EMe" trick, I've thought about it, but then realized it would make the other locations look strange without the expected comma, and decided that EMe() would be the best solution, as it's only strange in where it's added, and not where its used. $ git grep -l EMe include/trace/ |wc -l 11 It's already used in 11 other files, let's not muck with it now. -- Steve