lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 12 Apr 2019 13:47:52 -0600
From:   Raul Rangel <rrangel@...omium.org>
To:     Steven Rostedt <rostedt@...dmis.org>
Cc:     linux-trace-devel@...r.kernel.org, eballetbo@...il.com,
        zwisler@...omium.org, djkurtz@...omium.org,
        Enric Balletbo i Serra <enric.balletbo@...labora.com>,
        Guenter Roeck <groeck@...omium.org>,
        linux-kernel@...r.kernel.org, Benson Leung <bleung@...omium.org>
Subject: Re: [PATCH v2] chrome/platform: cros_ec_proto:: Add trace event to
 trace EC commands

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@...omium.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ