From e63e0515e46b8799b33a8a034dafef26e3246cc9 Mon Sep 17 00:00:00 2001 From: Vadim Bendebury Date: Mon, 16 Oct 2017 15:00:18 -0700 Subject: [PATCH] gsctool: harden the APIs marking pointers const This is just a tweak marking pointers to the vendor command payloads as const, as the command payloads are not supposed to be modified by the communication layers. BRANCH=none BUG=none TEST=make buildall -j; make -c ./extra/usb_updater Change-Id: I68f15e8c77dc892173ff0241072128d960712a80 Signed-off-by: Vadim Bendebury Reviewed-on: https://chromium-review.googlesource.com/722114 Reviewed-by: Andrey Pronin --- extra/usb_updater/gsctool.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extra/usb_updater/gsctool.c b/extra/usb_updater/gsctool.c index 6e79be1e3a..4a271c23cb 100644 --- a/extra/usb_updater/gsctool.c +++ b/extra/usb_updater/gsctool.c @@ -1139,7 +1139,7 @@ static void setup_connection(struct transfer_descriptor *td) * if it is - of what maximum size. */ static int ext_cmd_over_usb(struct usb_endpoint *uep, uint16_t subcommand, - void *cmd_body, size_t body_size, + const void *cmd_body, size_t body_size, void *resp, size_t *resp_size) { struct update_frame_header *ufh; @@ -1221,7 +1221,7 @@ static int transfer_image(struct transfer_descriptor *td, static uint32_t send_vendor_command(struct transfer_descriptor *td, uint16_t subcommand, - void *command_body, + const void *command_body, size_t command_body_size, void *response, size_t *response_size)