From: Raul Rangel <rrangel@chromium.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-trace-devel@vger.kernel.org, eballetbo@gmail.com,
zwisler@chromium.org, djkurtz@chromium.org,
Enric Balletbo i Serra <enric.balletbo@collabora.com>,
Guenter Roeck <groeck@chromium.org>,
linux-kernel@vger.kernel.org, Benson Leung <bleung@chromium.org>
Subject: Re: [PATCH v2] chrome/platform: cros_ec_proto:: Add trace event to trace EC commands
Date: Fri, 12 Apr 2019 13:47:52 -0600 [thread overview]
Message-ID: <20190412194752.GA238393@google.com> (raw)
In-Reply-To: <20190412150438.56ba4429@gandalf.local.home>
On Fri, Apr 12, 2019 at 03:04:38PM -0400, Steven Rostedt wrote:
> On Fri, 12 Apr 2019 12:49:44 -0600
> Raul E Rangel <rrangel@chromium.org> wrote:
>
> > +#define ec_cmds \
> > + {EC_CMD_PROTO_VERSION, "PROTO_VERSION"}, \
> > + {EC_CMD_HELLO, "HELLO"}, \
> > + {EC_CMD_GET_VERSION, "GET_VERSION"}, \
> > + {EC_CMD_READ_TEST, "READ_TEST"}, \
> > + {EC_CMD_GET_BUILD_INFO, "GET_BUILD_INFO"}, \
> > + {EC_CMD_GET_CHIP_INFO, "GET_CHIP_INFO"}, \
> > + {EC_CMD_GET_BOARD_VERSION, "GET_BOARD_VERSION"}, \
> > + {EC_CMD_READ_MEMMAP, "READ_MEMMAP"}, \
> > + {EC_CMD_GET_CMD_VERSIONS, "GET_CMD_VERSIONS"}, \
> > + {EC_CMD_GET_COMMS_STATUS, "GET_COMMS_STATUS"}, \
> > + {EC_CMD_TEST_PROTOCOL, "TEST_PROTOCOL"}, \
> > + {EC_CMD_GET_PROTOCOL_INFO, "GET_PROTOCOL_INFO"}, \
> > + {EC_CMD_GSV_PAUSE_IN_S5, "GSV_PAUSE_IN_S5"}, \
> > + {EC_CMD_GET_FEATURES, "GET_FEATURES"}, \
>
> Usually, if I have something like this, I would do:
>
>
> #define ec_cmds \
> EC(PROTO_VERSION), \
> EC(HELLO), \
> EC(GET_VERSION), \
> EC(READ_TEST), \
> [...]
>
> Then:
>
> #define EC(a) {EC_CMD_##a, #a}
>
> and then ec_cmds ends up with the same result with much less typing and
> little risk for copy past errors.
I generally don't like doing that because it breaks my editors Goto
Definition, but I can send out a patch that uses the macro.
Thanks,
Raul
>
> -- Steve
next prev parent reply other threads:[~2019-04-12 19:47 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-12 18:49 [PATCH v2] chrome/platform: cros_ec_proto:: Add trace event to trace EC commands Raul E Rangel
2019-04-12 19:04 ` Steven Rostedt
2019-04-12 19:47 ` Raul Rangel [this message]
2019-04-15 13:05 ` kbuild test robot
2019-04-15 13:24 ` kbuild test robot
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=20190412194752.GA238393@google.com \
--to=rrangel@chromium.org \
--cc=bleung@chromium.org \
--cc=djkurtz@chromium.org \
--cc=eballetbo@gmail.com \
--cc=enric.balletbo@collabora.com \
--cc=groeck@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-devel@vger.kernel.org \
--cc=rostedt@goodmis.org \
--cc=zwisler@chromium.org \
/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).