* [PATCH] cros_ec: use uint instead of uint8_t for cmd param
@ 2019-12-09 20:27 Michael Auchter
2019-12-09 21:34 ` Simon Glass
0 siblings, 1 reply; 2+ messages in thread
From: Michael Auchter @ 2019-12-09 20:27 UTC (permalink / raw)
To: u-boot
Chromium EC commands can be up to 16-bits, so using a uint8_t here can
cause truncation. Update to use a uint instead.
It looks like this should likely have been done as a part of
9fea76f5d30264dc08ac591a7a89427b8441555b, but this function was skipped
for some reason.
Signed-off-by: Michael Auchter <michael.auchter@ni.com>
Cc: Simon Glass <sjg@chromium.org>
---
drivers/misc/cros_ec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/misc/cros_ec.c b/drivers/misc/cros_ec.c
index 3b6370a6d5..3332c1c8a5 100644
--- a/drivers/misc/cros_ec.c
+++ b/drivers/misc/cros_ec.c
@@ -316,7 +316,7 @@ static int send_command(struct cros_ec_dev *dev, uint cmd, int cmd_version,
* @param din_len Maximum size of response in bytes
* @return number of bytes in response, or -ve on error
*/
-static int ec_command_inptr(struct udevice *dev, uint8_t cmd,
+static int ec_command_inptr(struct udevice *dev, uint cmd,
int cmd_version, const void *dout, int dout_len,
uint8_t **dinp, int din_len)
{
--
2.23.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH] cros_ec: use uint instead of uint8_t for cmd param
2019-12-09 20:27 [PATCH] cros_ec: use uint instead of uint8_t for cmd param Michael Auchter
@ 2019-12-09 21:34 ` Simon Glass
0 siblings, 0 replies; 2+ messages in thread
From: Simon Glass @ 2019-12-09 21:34 UTC (permalink / raw)
To: u-boot
On Mon, 9 Dec 2019 at 13:27, Michael Auchter <michael.auchter@ni.com> wrote:
>
> Chromium EC commands can be up to 16-bits, so using a uint8_t here can
> cause truncation. Update to use a uint instead.
>
> It looks like this should likely have been done as a part of
> 9fea76f5d30264dc08ac591a7a89427b8441555b, but this function was skipped
> for some reason.
>
> Signed-off-by: Michael Auchter <michael.auchter@ni.com>
> Cc: Simon Glass <sjg@chromium.org>
> ---
> drivers/misc/cros_ec.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Simon Glass <sjg@chromium.org>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-12-09 21:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-09 20:27 [PATCH] cros_ec: use uint instead of uint8_t for cmd param Michael Auchter
2019-12-09 21:34 ` Simon Glass
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.