linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: David Laight <David.Laight@ACULAB.COM>
Cc: 'Bean Huo' <huobean@gmail.com>,
	"alim.akhtar@samsung.com" <alim.akhtar@samsung.com>,
	"avri.altman@wdc.com" <avri.altman@wdc.com>,
	"asutoshd@codeaurora.org" <asutoshd@codeaurora.org>,
	"jejb@linux.ibm.com" <jejb@linux.ibm.com>,
	"martin.petersen@oracle.com" <martin.petersen@oracle.com>,
	"stanley.chu@mediatek.com" <stanley.chu@mediatek.com>,
	"beanhuo@micron.com" <beanhuo@micron.com>,
	"bvanassche@acm.org" <bvanassche@acm.org>,
	"tomas.winkler@intel.com" <tomas.winkler@intel.com>,
	"cang@codeaurora.org" <cang@codeaurora.org>,
	"joe@perches.com" <joe@perches.com>,
	"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3 1/6] scsi: ufs: Remove stringize operator '#' restriction
Date: Mon, 14 Dec 2020 18:21:17 -0500	[thread overview]
Message-ID: <20201214182117.1bbc717d@gandalf.local.home> (raw)
In-Reply-To: <977f3ea155644cd89bc83f2e9dcf281e@AcuMS.aculab.com>

On Mon, 14 Dec 2020 23:11:40 +0000
David Laight <David.Laight@ACULAB.COM> 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


  reply	other threads:[~2020-12-14 23:22 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-14 20:20 [PATCH v3 0/6] Several changes for the UPIU trace Bean Huo
2020-12-14 20:20 ` [PATCH v3 1/6] scsi: ufs: Remove stringize operator '#' restriction Bean Huo
2020-12-14 21:23   ` Joe Perches
2020-12-14 22:26     ` Bean Huo
2020-12-14 23:11   ` David Laight
2020-12-14 23:21     ` Steven Rostedt [this message]
2020-12-14 20:20 ` [PATCH v3 2/6] scsi: ufs: Use __print_symbolic() for UFS trace string print Bean Huo
2020-12-14 20:20 ` [PATCH v3 3/6] scsi: ufs: Don't call trace_ufshcd_upiu() in case trace poit is disabled Bean Huo
2020-12-14 20:20 ` [PATCH v3 4/6] scsi: ufs: Distinguish between query REQ and query RSP in query trace Bean Huo
2020-12-14 20:20 ` [PATCH v3 5/6] scsi: ufs: Distinguish between TM request UPIU and response UPIU in TM UPIU trace Bean Huo
2020-12-14 20:20 ` [PATCH v3 6/6] scsi: ufs: Make UPIU trace easier differentiate among CDB, OSF, and TM Bean Huo
2020-12-14 22:13 ` [PATCH v3 0/6] Several changes for the UPIU trace Avri Altman
2020-12-14 22:37   ` Bean Huo
2020-12-15 22:18     ` Bean Huo
2021-01-04 20:39       ` Bean Huo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201214182117.1bbc717d@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=David.Laight@ACULAB.COM \
    --cc=alim.akhtar@samsung.com \
    --cc=asutoshd@codeaurora.org \
    --cc=avri.altman@wdc.com \
    --cc=beanhuo@micron.com \
    --cc=bvanassche@acm.org \
    --cc=cang@codeaurora.org \
    --cc=huobean@gmail.com \
    --cc=jejb@linux.ibm.com \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=stanley.chu@mediatek.com \
    --cc=tomas.winkler@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).