chrome-platform.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Tzung-Bi Shih <tzungbi@kernel.org>
To: bleung@chromium.org, groeck@chromium.org
Cc: chrome-platform@lists.linux.dev, linux-kernel@vger.kernel.org,
	tzungbi@kernel.org
Subject: [PATCH v2 00/15] platform/chrome: Kunit tests and refactor for cros_ec_query_all()
Date: Tue,  7 Jun 2022 14:56:24 +0000	[thread overview]
Message-ID: <20220607145639.2362750-1-tzungbi@kernel.org> (raw)

The series adds Kunit tests, refactors, and clean-ups for cros_ec_query_all().

Tzung-Bi Shih (15):
  platform/chrome: cros_ec_commands: fix compile errors
-> Fixes compile errors when including cros_ec_commands.h.

  platform/chrome: cros_ec_proto: add Kunit tests for
    cros_ec_query_all()
-> Adds Kunit tests for cros_ec_query_all().  They are baseline tests
   for the following refactor patches.

  platform/chrome: use macros for passthru indexes
  platform/chrome: cros_ec_proto: assign buffer size from protocol info
-> Refactors.

  platform/chrome: cros_ec_proto: remove redundant NULL check
-> Clean up.

  platform/chrome: cros_ec_proto: use cros_ec_map_error()
-> Changes the internal return code.

  platform/chrome: cros_ec_proto: separate cros_ec_get_proto_info()
  platform/chrome: cros_ec_proto: handle empty payload in getting proto
    info
  platform/chrome: cros_ec_proto: separate
    cros_ec_get_proto_info_legacy()
  platform/chrome: cros_ec_proto: handle empty payload in getting info
    legacy
-> Check if send_command() returns negative integer.
   Call cros_ec_map_error() to see if msg->result isn't EC_RES_SUCCESS.
   Report -EPROTO if send_command() returns 0.

  platform/chrome: cros_ec: don't allocate `din` and `dout` in
    cros_ec_register()
-> Clean up.

  platform/chrome: use krealloc() for `din` and `dout`
-> Replace devm variant to non-devm.

  platform/chrome: cros_ec_proto: don't show MKBP version if unsupported
-> Minor fix up.

  platform/chrome: cros_ec_proto: return 0 on getting version mask
    success
  platform/chrome: cros_ec_proto: return 0 on getting wake mask success
-> Conform to kernel convention: return 0 on success;
   otherwise, negative integers.

 drivers/platform/chrome/Kconfig               |    6 +
 drivers/platform/chrome/Makefile              |    1 +
 drivers/platform/chrome/cros_ec.c             |   17 +-
 drivers/platform/chrome/cros_ec_proto.c       |  318 ++--
 drivers/platform/chrome/cros_ec_proto_test.c  | 1400 +++++++++++++++++
 drivers/platform/chrome/cros_ec_trace.h       |    8 +-
 drivers/platform/chrome/cros_kunit_util.c     |   98 ++
 drivers/platform/chrome/cros_kunit_util.h     |   36 +
 .../linux/platform_data/cros_ec_commands.h    |    4 +-
 include/linux/platform_data/cros_ec_proto.h   |    3 +
 10 files changed, 1713 insertions(+), 178 deletions(-)
 create mode 100644 drivers/platform/chrome/cros_kunit_util.c
 create mode 100644 drivers/platform/chrome/cros_kunit_util.h

Changes from v1:
(https://patchwork.kernel.org/project/chrome-platform/cover/20220606141051.285823-1-tzungbi@kernel.org/)
- Fix review comments.
- Split and reorder patches.

-- 
2.36.1.255.ge46751e96f-goog


             reply	other threads:[~2022-06-07 14:56 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-07 14:56 Tzung-Bi Shih [this message]
2022-06-07 14:56 ` [PATCH v2 01/15] platform/chrome: cros_ec_commands: fix compile errors Tzung-Bi Shih
2022-06-07 14:56 ` [PATCH v2 02/15] platform/chrome: cros_ec_proto: add Kunit tests for cros_ec_query_all() Tzung-Bi Shih
2022-06-07 14:56 ` [PATCH v2 03/15] platform/chrome: use macros for passthru indexes Tzung-Bi Shih
2022-06-07 14:56 ` [PATCH v2 04/15] platform/chrome: cros_ec_proto: assign buffer size from protocol info Tzung-Bi Shih
2022-06-07 14:56 ` [PATCH v2 05/15] platform/chrome: cros_ec_proto: remove redundant NULL check Tzung-Bi Shih
2022-06-07 14:56 ` [PATCH v2 06/15] platform/chrome: cros_ec_proto: use cros_ec_map_error() Tzung-Bi Shih
2022-06-07 14:56 ` [PATCH v2 07/15] platform/chrome: cros_ec_proto: separate cros_ec_get_proto_info() Tzung-Bi Shih
2022-06-07 18:45   ` Guenter Roeck
2022-06-07 14:56 ` [PATCH v2 08/15] platform/chrome: cros_ec_proto: handle empty payload in getting proto info Tzung-Bi Shih
2022-06-07 18:47   ` Guenter Roeck
2022-06-08  2:16     ` Tzung-Bi Shih
2022-06-08 14:37       ` Guenter Roeck
2022-06-07 14:56 ` [PATCH v2 09/15] platform/chrome: cros_ec_proto: separate cros_ec_get_proto_info_legacy() Tzung-Bi Shih
2022-06-07 18:50   ` Guenter Roeck
2022-06-07 14:56 ` [PATCH v2 10/15] platform/chrome: cros_ec_proto: handle empty payload in getting info legacy Tzung-Bi Shih
2022-06-07 14:56 ` [PATCH v2 11/15] platform/chrome: cros_ec: don't allocate `din` and `dout` in cros_ec_register() Tzung-Bi Shih
2022-06-07 14:56 ` [PATCH v2 12/15] platform/chrome: use krealloc() for `din` and `dout` Tzung-Bi Shih
2022-06-07 19:06   ` Guenter Roeck
2022-06-08  2:17     ` Tzung-Bi Shih
2022-06-07 14:56 ` [PATCH v2 13/15] platform/chrome: cros_ec_proto: don't show MKBP version if unsupported Tzung-Bi Shih
2022-06-07 19:08   ` Guenter Roeck
2022-06-07 14:56 ` [PATCH v2 14/15] platform/chrome: cros_ec_proto: return 0 on getting version mask success Tzung-Bi Shih
2022-06-07 19:11   ` Guenter Roeck
2022-06-08  2:17     ` Tzung-Bi Shih
2022-06-07 14:56 ` [PATCH v2 15/15] platform/chrome: cros_ec_proto: return 0 on getting wake " Tzung-Bi Shih
2022-06-07 19:12   ` Guenter Roeck
2022-06-08  2:17     ` Tzung-Bi Shih

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=20220607145639.2362750-1-tzungbi@kernel.org \
    --to=tzungbi@kernel.org \
    --cc=bleung@chromium.org \
    --cc=chrome-platform@lists.linux.dev \
    --cc=groeck@chromium.org \
    --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;
as well as URLs for NNTP newsgroup(s).