From 5c64573c8398fc68d2a006a394c7509978203361 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Thu, 7 May 2020 14:50:19 -0700 Subject: [PATCH] shearwater: remove unused 'shearwater_common_command()' function Dirk added this helper in commit 9379004b2df5 ("Shearwater: add helper to send bytes to the dive computer"), and it was used for a short while by commit 437cc3e0cc9f ("Shearwater: try to gracefully shut down the Bluetooth connection"). But then the use was reverted in commit 8120b11258d8, and this helper function is now stale and unused, and an unnecessary difference to Jef's upstream code base. Signed-off-by: Linus Torvalds --- src/shearwater_common.c | 22 +--------------------- src/shearwater_common.h | 3 --- 2 files changed, 1 insertion(+), 24 deletions(-) diff --git a/src/shearwater_common.c b/src/shearwater_common.c index fd58488..a7f67f6 100644 --- a/src/shearwater_common.c +++ b/src/shearwater_common.c @@ -316,27 +316,6 @@ done: return status; } -dc_status_t -shearwater_common_command (shearwater_common_device_t *device, const unsigned char input[], unsigned int isize) -{ - dc_status_t status = DC_STATUS_SUCCESS; - dc_device_t *abstract = (dc_device_t *) device; - - if (isize > SZ_PACKET) - return DC_STATUS_INVALIDARGS; - - if (device_is_cancelled (abstract)) - return DC_STATUS_CANCELLED; - - // Send the command packet. - status = shearwater_common_slip_write (device, input, isize); - if (status != DC_STATUS_SUCCESS) - ERROR (abstract->context, "Failed to send the command packet."); - - return status; -} - - dc_status_t shearwater_common_transfer (shearwater_common_device_t *device, const unsigned char input[], unsigned int isize, unsigned char output[], unsigned int osize, unsigned int *actual) @@ -400,6 +379,7 @@ shearwater_common_transfer (shearwater_common_device_t *device, const unsigned c return DC_STATUS_SUCCESS; } + dc_status_t shearwater_common_download (shearwater_common_device_t *device, dc_buffer_t *buffer, unsigned int address, unsigned int size, unsigned int compression, dc_event_progress_t *progress) { diff --git a/src/shearwater_common.h b/src/shearwater_common.h index b6c4532..35a0d01 100644 --- a/src/shearwater_common.h +++ b/src/shearwater_common.h @@ -54,9 +54,6 @@ typedef struct shearwater_common_device_t { dc_status_t shearwater_common_setup (shearwater_common_device_t *device, dc_context_t *context, dc_iostream_t *iostream); -dc_status_t -shearwater_common_command (shearwater_common_device_t *device, const unsigned char input[], unsigned int isize); - dc_status_t shearwater_common_transfer (shearwater_common_device_t *device, const unsigned char input[], unsigned int isize, unsigned char output[], unsigned int osize, unsigned int *actual);