From: Tzung-Bi Shih <tzungbi@kernel.org>
To: Guenter Roeck <groeck@google.com>
Cc: Benson Leung <bleung@chromium.org>,
Guenter Roeck <groeck@chromium.org>,
"open list:CHROME HARDWARE PLATFORM SUPPORT"
<chrome-platform@lists.linux.dev>,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3 16/23] platform/chrome: cros_ec_proto: return 0 on getting cmd mask success
Date: Thu, 9 Jun 2022 08:44:14 +0000 [thread overview]
Message-ID: <YqGy3v5Vpb8/79XA@google.com> (raw)
In-Reply-To: <CABXOdTd76gczEimVxqWFmyHtbjG=dqALcGcudfZJrUd7qKcVfA@mail.gmail.com>
On Wed, Jun 08, 2022 at 09:20:29AM -0700, Guenter Roeck wrote:
> On Wed, Jun 8, 2022 at 4:08 AM Tzung-Bi Shih <tzungbi@kernel.org> wrote:
> >
> > cros_ec_get_host_command_version_mask() used to return value from
> > send_command() which is number of available bytes for input payload on
> > success (i.e. sizeof(struct ec_response_get_cmd_versions)).
> >
> > However, the callers don't need to know how many bytes are available.
> >
> > Don't return number of available bytes. Instead, return 0 on success;
> > otherwise, negative integers on error.
> >
> > Also remove the unneeded `ver_mask` initialization as the callers should
> > take it only if cros_ec_get_host_command_version_mask() returns 0.
>
> Make sure this compiles with W=1. Compilers may think that ver_mask
> may be uninitialized when used.
If I tested it correctly, it compiles.
$ make mrproper
$ make allmodconfig
$ make W=1 drivers/platform/chrome/
...
CC drivers/platform/chrome/cros_ec_proto.o
CC drivers/platform/chrome/cros_ec_trace.o
AR drivers/platform/chrome/built-in.a
CC [M] drivers/platform/chrome/chromeos_acpi.o
CC [M] drivers/platform/chrome/chromeos_laptop.o
CC [M] drivers/platform/chrome/chromeos_privacy_screen.o
CC [M] drivers/platform/chrome/chromeos_pstore.o
CC [M] drivers/platform/chrome/chromeos_tbmc.o
CC [M] drivers/platform/chrome/cros_ec.o
...
next prev parent reply other threads:[~2022-06-09 8:48 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-08 11:07 [PATCH v3 00/23] platform/chrome: Kunit tests and refactor for cros_ec_query_all() Tzung-Bi Shih
2022-06-08 11:07 ` [PATCH v3 01/23] platform/chrome: cros_ec_commands: fix compile errors Tzung-Bi Shih
2022-06-08 11:07 ` [PATCH v3 02/23] platform/chrome: cros_ec_proto: add Kunit tests for cros_ec_query_all() Tzung-Bi Shih
2022-06-08 16:12 ` Guenter Roeck
2022-06-08 11:07 ` [PATCH v3 03/23] platform/chrome: use macros for passthru indexes Tzung-Bi Shih
2022-06-08 11:07 ` [PATCH v3 04/23] platform/chrome: cros_ec_proto: assign buffer size from protocol info Tzung-Bi Shih
2022-06-08 11:07 ` [PATCH v3 05/23] platform/chrome: cros_ec_proto: remove redundant NULL check Tzung-Bi Shih
2022-06-08 11:07 ` [PATCH v3 06/23] platform/chrome: cros_ec_proto: use cros_ec_map_error() Tzung-Bi Shih
2022-06-08 11:07 ` [PATCH v3 07/23] platform/chrome: cros_ec_proto: separate cros_ec_get_proto_info() Tzung-Bi Shih
2022-06-08 11:07 ` [PATCH v3 08/23] platform/chrome: cros_ec_proto: add Kunit tests for getting proto info Tzung-Bi Shih
2022-06-08 16:13 ` Guenter Roeck
2022-06-08 11:07 ` [PATCH v3 09/23] platform/chrome: cros_ec_proto: handle empty payload in " Tzung-Bi Shih
2022-06-08 16:13 ` Guenter Roeck
2022-06-08 11:07 ` [PATCH v3 10/23] platform/chrome: cros_ec_proto: separate cros_ec_get_proto_info_legacy() Tzung-Bi Shih
2022-06-08 11:07 ` [PATCH v3 11/23] platform/chrome: cros_ec_proto: add Kunit test for getting legacy info Tzung-Bi Shih
2022-06-08 16:14 ` Guenter Roeck
2022-06-08 11:07 ` [PATCH v3 12/23] platform/chrome: cros_ec_proto: handle empty payload in getting info legacy Tzung-Bi Shih
2022-06-08 16:14 ` Guenter Roeck
2022-06-08 11:07 ` [PATCH v3 13/23] platform/chrome: cros_ec: don't allocate `din` and `dout` in cros_ec_register() Tzung-Bi Shih
2022-06-08 16:15 ` Guenter Roeck
2022-06-09 5:09 ` Tzung-Bi Shih
2022-06-08 11:07 ` [PATCH v3 14/23] platform/chrome: don't use devm variants for `din` and `dout` Tzung-Bi Shih
2022-06-08 16:17 ` Guenter Roeck
2022-06-08 11:07 ` [PATCH v3 15/23] platform/chrome: cros_ec_proto: don't show MKBP version if unsupported Tzung-Bi Shih
2022-06-08 11:07 ` [PATCH v3 16/23] platform/chrome: cros_ec_proto: return 0 on getting cmd mask success Tzung-Bi Shih
2022-06-08 16:20 ` Guenter Roeck
2022-06-09 8:44 ` Tzung-Bi Shih [this message]
2022-06-08 11:07 ` [PATCH v3 17/23] platform/chrome: cros_ec_proto: add Kunit test for getting cmd mask error Tzung-Bi Shih
2022-06-08 16:21 ` Guenter Roeck
2022-06-08 11:07 ` [PATCH v3 18/23] platform/chrome: cros_ec_proto: check `msg->result` in getting cmd mask Tzung-Bi Shih
2022-06-08 16:23 ` Guenter Roeck
2022-06-08 16:27 ` Guenter Roeck
2022-06-08 11:07 ` [PATCH v3 19/23] platform/chrome: cros_ec_proto: add Kunit tests for " Tzung-Bi Shih
2022-06-08 16:28 ` Guenter Roeck
2022-06-08 11:07 ` [PATCH v3 20/23] platform/chrome: cros_ec_proto: handle empty payload in " Tzung-Bi Shih
2022-06-08 16:24 ` Guenter Roeck
2022-06-08 11:07 ` [PATCH v3 21/23] platform/chrome: cros_ec_proto: return 0 on getting wake mask success Tzung-Bi Shih
2022-06-08 16:26 ` Guenter Roeck
2022-06-08 11:07 ` [PATCH v3 22/23] platform/chrome: cros_ec_proto: add Kunit test for getting wake mask Tzung-Bi Shih
2022-06-08 16:29 ` Guenter Roeck
2022-06-08 11:07 ` [PATCH v3 23/23] platform/chrome: cros_ec_proto: handle empty payload in " Tzung-Bi Shih
2022-06-08 16:30 ` Guenter Roeck
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=YqGy3v5Vpb8/79XA@google.com \
--to=tzungbi@kernel.org \
--cc=bleung@chromium.org \
--cc=chrome-platform@lists.linux.dev \
--cc=groeck@chromium.org \
--cc=groeck@google.com \
--cc=linux-kernel@vger.kernel.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