summaryrefslogtreecommitdiff
path: root/drivers/misc
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2018-11-07 01:21:18 +0300
committerSimon Glass <sjg@chromium.org>2018-11-21 05:14:22 +0300
commit9fea76f5d30264dc08ac591a7a89427b8441555b (patch)
tree04670175fa5cbf05856962fa75729e08a0a07b61 /drivers/misc
parent6af7101b75d0e30cf7ed7d1f57fdb68ed5f8ffa0 (diff)
downloadu-boot-9fea76f5d30264dc08ac591a7a89427b8441555b.tar.xz
cros_ec: Use uint instead of u8 for parameters
There is no advantage to using a u8 for function parameters. It forces the compiler to mask values and can increase code size. Also the command enum has been extended to 16 bits. Update the functions to use uint instead. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/cros_ec.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/misc/cros_ec.c b/drivers/misc/cros_ec.c
index 190505c11c..4013f50d59 100644
--- a/drivers/misc/cros_ec.c
+++ b/drivers/misc/cros_ec.c
@@ -227,7 +227,7 @@ static int send_command_proto3(struct cros_ec_dev *cdev,
return handle_proto3_response(cdev, dinp, din_len);
}
-static int send_command(struct cros_ec_dev *dev, uint8_t cmd, int cmd_version,
+static int send_command(struct cros_ec_dev *dev, uint cmd, int cmd_version,
const void *dout, int dout_len,
uint8_t **dinp, int din_len)
{
@@ -330,7 +330,7 @@ static int ec_command_inptr(struct udevice *dev, uint8_t cmd,
* @param din_len Maximum size of response in bytes
* @return number of bytes in response, or -ve on error
*/
-static int ec_command(struct udevice *dev, uint8_t cmd, int cmd_version,
+static int ec_command(struct udevice *dev, uint cmd, int cmd_version,
const void *dout, int dout_len,
void *din, int din_len)
{
@@ -650,16 +650,14 @@ static int cros_ec_check_version(struct udevice *dev)
cdev->protocol_version = 3;
req.in_data = 0;
if (ec_command_inptr(dev, EC_CMD_HELLO, 0, &req, sizeof(req),
- (uint8_t **)&resp, sizeof(*resp)) > 0) {
+ (uint8_t **)&resp, sizeof(*resp)) > 0)
return 0;
- }
/* Try sending a version 2 packet */
cdev->protocol_version = 2;
if (ec_command_inptr(dev, EC_CMD_HELLO, 0, &req, sizeof(req),
- (uint8_t **)&resp, sizeof(*resp)) > 0) {
+ (uint8_t **)&resp, sizeof(*resp)) > 0)
return 0;
- }
/*
* Fail if we're still here, since the EC doesn't understand any